File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 1+ <launch >
2+ <!--
3+ Arguments to the move_square.py node:
4+ - "vel [ left | right ]"
5+ - "odom"
6+ - "odom_imu"
7+ -->
8+ <arg name =" args" />
9+
10+ <arg name =" robot_id" default =" $(optenv ID 1)" doc =" Unique identifier of the robot [1-Inf.)" />
11+ <arg name =" ns" value =" create$(arg robot_id)" doc =" Namespace of the robot. By default: create1" />
12+
13+ <node pkg =" ca_tools" type =" move_square.py" name =" move_square"
14+ output =" screen" ns =" $(arg ns)"
15+ args =" $(arg args)" />
16+ </launch >
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ def __init__(self):
3030
3131 # Declare ROS subscribers and publishers
3232 self .node_name = "square_move"
33- self .odom_sub_name = "/create1/ odom"
34- self .vel_pub_name = "/create1/ cmd_vel"
33+ self .odom_sub_name = "odom"
34+ self .vel_pub_name = "cmd_vel"
3535 self .vel_pub = None
3636 self .odometry_sub = None
3737
@@ -65,8 +65,6 @@ def stop_robot(self):
6565 self .vel_ros_pub (Twist ())
6666 time .sleep (self .pub_rate )
6767
68- sys .exit ("The process has been interrupted by the user!" )
69-
7068 def move (self ):
7169 """ To be surcharged in the inheriting class"""
7270
@@ -243,7 +241,7 @@ def __init__(self):
243241 # The functions are the same as in the previous example except for the odometry name that is now filtered
244242 # in a, Extended Kalman Filter (EKF) with the IMU values thanks to the node robot_pose_ekf
245243 super (SquareMoveOdomIMU , self ).__init__ ()
246- self .odom_sub_name = "/create1/ odom_combined"
244+ self .odom_sub_name = "odom_combined"
247245
248246
249247if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments