-
Notifications
You must be signed in to change notification settings - Fork 123
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
Conversation
carma/launch/carma_src.launch.py
Outdated
@@ -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') |
There was a problem hiding this comment.
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?
carma/launch/localization.launch.py
Outdated
subsystem_controller | ||
]) | ||
|
||
if simulation_mode is False: |
There was a problem hiding this comment.
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'
...
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
Checklist: