1818import os
1919
2020def generate_launch_description ():
21+ boatcontrol_dir = get_package_share_directory ('boatcontrol' )
22+ boatcontrol = IncludeLaunchDescription (
23+ PythonLaunchDescriptionSource (
24+ os .path .join (boatcontrol_dir , 'launch' , 'simcontrol.launch.py' )
25+ )
26+ )
27+
2128 # --- Launch arguments ---
2229 xacro_file = LaunchConfiguration ("xacro_file" )
2330 world_sdf = LaunchConfiguration ("world_sdf" )
@@ -53,11 +60,6 @@ def generate_launch_description():
5360
5461 return LaunchDescription ([
5562 # Paths / args
56- DeclareLaunchArgument (
57- "xacro_file" ,
58- default_value = "navigation/config/karaburan.xacro" ,
59- description = "Path to .urdf.xacro file"
60- ),
6163 DeclareLaunchArgument (
6264 "world_sdf" ,
6365 default_value = "navigation/config/world.sdf" ,
@@ -76,9 +78,6 @@ def generate_launch_description():
7678 DeclareLaunchArgument ("R" , default_value = "0.0" ),
7779 DeclareLaunchArgument ("P" , default_value = "0.0" ),
7880 DeclareLaunchArgument ("Y" , default_value = "0.0" ),
79- DeclareLaunchArgument (
80- "xacro_args" , default_value = "" ,
81- ),
8281 # Launch args for the GZ - ROS2 bridge
8382 DeclareLaunchArgument ('ns' , default_value = '' , description = 'ROS namespace for the bridge' ),
8483 DeclareLaunchArgument ('imu_topic' , default_value = '/imu/data' , description = 'GZ/ROS topic for IMU' ),
@@ -99,21 +98,8 @@ def generate_launch_description():
9998 }.items ()
10099 ),
101100
102- Node (
103- package = "robot_state_publisher" ,
104- executable = "robot_state_publisher" ,
105- name = "robot_state_publisher" ,
106- output = "screen" ,
107- parameters = [{
108- "use_sim_time" : True ,
109- "robot_description" : Command ([
110- FindExecutable (name = "xacro" ), " " ,
111- xacro_file , " " ,
112- xacro_args
113- ])
114- }]
115- ),
116101 nav_launch ,
102+ boatcontrol ,
117103
118104 TimerAction (
119105 period = 2.0 ,
@@ -140,8 +126,8 @@ def generate_launch_description():
140126 PythonExpression (['"' , imu_topic , '" + \' @sensor_msgs/msg/Imu[gz.msgs.IMU\' ' ]),
141127 PythonExpression (['"' , gps_topic , '" + \' @sensor_msgs/msg/NavSatFix[gz.msgs.NavSat\' ' ]),
142128 PythonExpression (['"' , lidar_topic , '" + \' @sensor_msgs/msg/LaserScan[gz.msgs.LaserScan\' ' ]),
143- PythonExpression (['"' , left_topic , '" + \' @std_msgs/msg/Float [gz.msgs.Float \' ' ]),
144- PythonExpression (['"' , right_topic , '" + \' @std_msgs/msg/Float [gz.msgs.Float \' ' ]),
129+ PythonExpression (['"' , left_topic , '" + \' @std_msgs/msg/Float64 [gz.msgs.Double \' ' ]),
130+ PythonExpression (['"' , right_topic , '" + \' @std_msgs/msg/Float64 [gz.msgs.Double \' ' ]),
145131 '/tf@tf2_msgs/msg/TFMessage@gz.msgs.Pose_V' ,
146132 '/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'
147133 ],
0 commit comments