Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update localization launch #2131

Merged
merged 8 commits into from
Aug 2, 2023
Merged

update localization launch #2131

merged 8 commits into from
Aug 2, 2023

Conversation

adev4a
Copy link
Contributor

@adev4a adev4a commented Aug 1, 2023

PR Details

This PR removes the localization launch file and updates the ros2 launch file with the required simulation mode launch argument.

Description

Related GitHub Issue

Related Jira Key

Motivation and Context

How Has This Been Tested?

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@adev4a adev4a requested a review from JonSmet August 1, 2023 13:34
@@ -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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this arg from simulation to simulation_arg as well?

subsystem_controller
])

if simulation_mode is False:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether we are actually able to use LaunchArguments directly in python conditional statements like this. I think the ROS2 launch approach for this would be to use IfConditional() instead. To do this, you can add:

from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, PythonExpression

    ...

    carma_port_drayage_plugin_container = ComposableNodeContainer(
        condition=IfCondition(PythonExpression(['not ', simulation_mode])), # Nodes in this container will only be launched if 'simulation_mode' evaluates to 'False'
    
    ...

@JonSmet JonSmet merged commit 131237b into develop Aug 2, 2023
2 of 3 checks passed
@JonSmet JonSmet deleted the fix/ros2_localization_launch branch August 2, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants