forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(pcdless_launc/scripts): remove unnecessary scripts (autoware…
…foundation#11) * remove not useful scripts Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp> * rename scripts & add descriptions Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp> * little change Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp> * remove odaiba.rviz Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp> * grammer fix Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp> --------- Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp>
- Loading branch information
Showing
8 changed files
with
101 additions
and
792 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
localization/yabloc/pcdless_launch/scripts/control_command_publisher.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
localization/yabloc/pcdless_launch/scripts/initialpose_latch.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
localization/yabloc/pcdless_launch/scripts/plot_navpvt_vel.py
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
localization/yabloc/pcdless_launch/scripts/publish_control_command.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
''' | ||
This is a script to visualize the control topic of Autoware to validate planning/control component. | ||
The node subscribes /control/command/control_cmd and publishes it as string and floot value. | ||
e.g. $ ./publish_control_command.py | ||
''' | ||
import rclpy | ||
from rclpy.node import Node | ||
from autoware_auto_control_msgs.msg import AckermannControlCommand | ||
from std_msgs.msg import String | ||
from std_msgs.msg import Float32 | ||
import numpy as np | ||
|
||
|
||
class control_command_publisher(Node): | ||
def __init__(self): | ||
super().__init__('control_command_publisher') | ||
|
||
self.sub_command_ = self.create_subscription( | ||
AckermannControlCommand, '/control/command/control_cmd', self.command_callback, 10) | ||
|
||
self.pub_string_ = self.create_publisher(String, '/string/command', 10) | ||
self.pub_float_ = self.create_publisher(Float32, '/float/steer', 10) | ||
|
||
def command_callback(self, msg: AckermannControlCommand): | ||
|
||
commands = {} | ||
commands['steer_angle(deg)'] = msg.lateral.steering_tire_angle * \ | ||
180 / np.pi | ||
commands['steer_rate(deg/s)'] = msg.lateral.steering_tire_rotation_rate * 180 / np.pi | ||
commands['speed'] = msg.longitudinal.speed | ||
commands['accel'] = msg.longitudinal.acceleration | ||
commands['jerk '] = msg.longitudinal.jerk | ||
|
||
str_msg = String() | ||
str_msg.data = '-- Control Command Status --\n' | ||
for key, value in commands.items(): | ||
str_msg.data += key + ': ' + '{:.3f}'.format(value) + '\n' | ||
|
||
self.pub_string_.publish(str_msg) | ||
|
||
float_msg = Float32() | ||
float_msg.data = msg.lateral.steering_tire_angle * 180 / np.pi | ||
self.pub_float_.publish(float_msg) | ||
|
||
|
||
def main(args=None): | ||
rclpy.init(args=args) | ||
|
||
converter = control_command_publisher() | ||
rclpy.spin(converter) | ||
converter.destroy_node() | ||
rclpy.shutdown() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.