diff --git a/clearpath_generator_gz/clearpath_generator_gz/launch/generator.py b/clearpath_generator_gz/clearpath_generator_gz/launch/generator.py index cd62862..e37f8a2 100644 --- a/clearpath_generator_gz/clearpath_generator_gz/launch/generator.py +++ b/clearpath_generator_gz/clearpath_generator_gz/launch/generator.py @@ -243,4 +243,15 @@ def generate_platform(self) -> None: def generate_manipulators(self) -> None: manipulators_service_launch_writer = LaunchWriter(self.manipulators_service_launch_file) + if self.clearpath_config.manipulators.get_all_manipulators(): + if self.clearpath_config.manipulators.moveit.enable: + manipulators_service_launch_writer.add(LaunchFile( + name='moveit', + package=self.pkg_clearpath_manipulators, + args=[ + ('setup_path', self.setup_path), + ('use_sim_time', 'true'), + ('namespace', self.namespace) + ] + )) manipulators_service_launch_writer.generate_file() diff --git a/clearpath_generator_gz/clearpath_generator_gz/param/sensors.py b/clearpath_generator_gz/clearpath_generator_gz/param/sensors.py index 744c3a7..2c2d05a 100644 --- a/clearpath_generator_gz/clearpath_generator_gz/param/sensors.py +++ b/clearpath_generator_gz/clearpath_generator_gz/param/sensors.py @@ -38,7 +38,7 @@ NovatelSmart7) from clearpath_config.sensors.types.imu import BaseIMU, Microstrain, CHRoboticsUM6, RedshiftUM7 from clearpath_config.sensors.types.lidars_2d import BaseLidar2D, HokuyoUST, SickLMS1XX -from clearpath_config.sensors.types.lidars_3d import BaseLidar3D, VelodyneLidar +from clearpath_config.sensors.types.lidars_3d import BaseLidar3D, OusterOS1, VelodyneLidar from clearpath_config.sensors.types.sensor import BaseSensor from clearpath_config.common.utils.yaml import write_yaml @@ -275,6 +275,7 @@ def __init__( Microstrain.SENSOR_MODEL: ImuParam, RedshiftUM7.SENSOR_MODEL: ImuParam, VelodyneLidar.SENSOR_MODEL: Lidar3dParam, + OusterOS1.SENSOR_MODEL: Lidar3dParam, Garmin18x.SENSOR_MODEL: GPSParam, NovatelSmart6.SENSOR_MODEL: GPSParam, NovatelSmart7.SENSOR_MODEL: GPSParam, diff --git a/clearpath_gz/launch/robot_spawn.launch.py b/clearpath_gz/launch/robot_spawn.launch.py index 11507f5..bb50d94 100644 --- a/clearpath_gz/launch/robot_spawn.launch.py +++ b/clearpath_gz/launch/robot_spawn.launch.py @@ -50,7 +50,11 @@ description='Gazebo World'), DeclareLaunchArgument('setup_path', default_value=[EnvironmentVariable('HOME'), '/clearpath/'], - description='Clearpath setup path') + description='Clearpath setup path'), + DeclareLaunchArgument('generate', + default_value='true', + choices=['true', 'false'], + description='Generate parameters and launch files') ] for pose_element in ['x', 'y', 'yaw']: @@ -67,6 +71,7 @@ def launch_setup(context, *args, **kwargs): use_sim_time = LaunchConfiguration('use_sim_time') x, y, z = LaunchConfiguration('x'), LaunchConfiguration('y'), LaunchConfiguration('z') yaw = LaunchConfiguration('yaw') + generate = LaunchConfiguration('generate') # Parse robot YAML into config clearpath_config = ClearpathConfig(os.path.join( @@ -88,6 +93,8 @@ def launch_setup(context, *args, **kwargs): setup_path, 'platform/launch', 'platform-service.launch.py']) launch_file_sensors_service = PathJoinSubstitution([ setup_path, 'sensors/launch', 'sensors-service.launch.py']) + launch_file_manipulators_service = PathJoinSubstitution([ + setup_path, 'manipulators/launch', 'manipulators-service.launch.py']) group_action_spawn_robot = GroupAction([ @@ -103,6 +110,10 @@ def launch_setup(context, *args, **kwargs): ('prefix', ['/world/', world, '/model/', robot_name, '/link/base_link/sensor/'])] ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource([launch_file_manipulators_service]), + ), + # Spawn robot Node( package='ros_gz_sim', @@ -123,6 +134,7 @@ def launch_setup(context, *args, **kwargs): executable='generate_description', name='generate_description', output='screen', + condition=IfCondition(generate), arguments=['-s', setup_path] ) @@ -131,6 +143,7 @@ def launch_setup(context, *args, **kwargs): executable='generate_semantic_description', name='generate_semantic_description', output='screen', + condition=IfCondition(generate), arguments=['-s', setup_path] ) @@ -139,6 +152,7 @@ def launch_setup(context, *args, **kwargs): executable='generate_launch', name='generate_launch', output='screen', + condition=IfCondition(generate), arguments=['-s', setup_path] ) @@ -147,6 +161,7 @@ def launch_setup(context, *args, **kwargs): executable='generate_param', name='generate_launch', output='screen', + condition=IfCondition(generate), arguments=['-s', setup_path] ) @@ -187,7 +202,7 @@ def launch_setup(context, *args, **kwargs): condition=IfCondition(LaunchConfiguration('rviz')), ) - return [ + actions = [ node_generate_description, event_generate_description, event_generate_semantic_description, @@ -196,6 +211,11 @@ def launch_setup(context, *args, **kwargs): rviz ] + if not generate.perform(context): + actions.append(group_action_spawn_robot) + + return actions + def generate_launch_description(): # Define LaunchDescription variable