diff --git a/carma/launch/carma_src.launch b/carma/launch/carma_src.launch index a6dfd6a3ab..1ebcb2b1b2 100755 --- a/carma/launch/carma_src.launch +++ b/carma/launch/carma_src.launch @@ -86,18 +86,6 @@ - - - - - - - - - - - - diff --git a/carma/launch/carma_src.launch.py b/carma/launch/carma_src.launch.py index 29fcea45a2..6165f29d05 100644 --- a/carma/launch/carma_src.launch.py +++ b/carma/launch/carma_src.launch.py @@ -140,6 +140,9 @@ def generate_launch_description(): vector_map_file = LaunchConfiguration('vector_map_file') declare_vector_map_file = DeclareLaunchArgument(name='vector_map_file', default_value='/opt/carma/maps/vector_map.osm') + simulation_mode = LaunchConfiguration('simulation_mode') + declare_simulation_mode = DeclareLaunchArgument(name='simulation_mode', default_value = 'False', description = 'True if CARMA Platform is launched with CARLA Simulator') + # Nodes transform_group = GroupAction( @@ -178,7 +181,8 @@ def generate_launch_description(): 'area' : area, 'arealist_path' : arealist_path, 'vector_map_file' : vector_map_file, - 'vehicle_calibration_dir': vehicle_calibration_dir + 'vehicle_calibration_dir': vehicle_calibration_dir, + 'simulation_mode': simulation_mode, }.items() ) ] @@ -271,6 +275,7 @@ def generate_launch_description(): declare_area, declare_arealist_path, declare_vector_map_file, + declare_simulation_mode, drivers_group, transform_group, environment_group, diff --git a/carma/launch/localization.launch b/carma/launch/localization.launch deleted file mode 100755 index 49205a6c89..0000000000 --- a/carma/launch/localization.launch +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/carma/launch/localization.launch.py b/carma/launch/localization.launch.py index a67819e780..a4b891335e 100644 --- a/carma/launch/localization.launch.py +++ b/carma/launch/localization.launch.py @@ -30,6 +30,8 @@ from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.actions import GroupAction from launch_ros.actions import set_remap +from launch.conditions import IfCondition +from launch.substitutions import LaunchConfiguration, PythonExpression def generate_launch_description(): @@ -77,6 +79,8 @@ def generate_launch_description(): vector_map_file = LaunchConfiguration('vector_map_file') declare_map_file = DeclareLaunchArgument(name='vector_map_file', default_value='vector_map.osm', description='Path to the map osm file if using the noupdate load type') + simulation_mode = LaunchConfiguration('simulation_mode') + gnss_to_map_convertor_container = ComposableNodeContainer( package='carma_ros2_utils', name='gnss_to_map_convertor_container', @@ -235,6 +239,7 @@ def generate_launch_description(): # EKF Localizer # Comment out to remove and change marked line in waypoint following.launch ekf_localizer_container = ComposableNodeContainer( + condition=IfCondition(PythonExpression(['not ', simulation_mode])), package='carma_ros2_utils', name='ekf_localizer_container', namespace=GetCurrentNamespace(), @@ -373,4 +378,4 @@ def generate_launch_description(): ndt_matching_container, ekf_localizer_container, subsystem_controller - ]) + ]) \ No newline at end of file