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

launch.py: add support to customize rviz.cfg file #554

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion crazyflie/launch/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def generate_launch_description():
'config',
'motion_capture.yaml')

default_rviz_config_path = os.path.join(
get_package_share_directory('crazyflie'),
'config',
'config.rviz')

telop_yaml_path = os.path.join(
get_package_share_directory('crazyflie'),
'config',
Expand All @@ -111,6 +116,8 @@ def generate_launch_description():
default_value=default_crazyflies_yaml_path),
DeclareLaunchArgument('motion_capture_yaml_file',
default_value=default_motion_capture_yaml_path),
DeclareLaunchArgument('rviz_config_file',
default_value=default_rviz_config_path),
DeclareLaunchArgument('backend', default_value='cpp'),
DeclareLaunchArgument('debug', default_value='False'),
DeclareLaunchArgument('rviz', default_value='False'),
Expand Down Expand Up @@ -148,7 +155,7 @@ def generate_launch_description():
namespace='',
executable='rviz2',
name='rviz2',
arguments=['-d' + os.path.join(get_package_share_directory('crazyflie'), 'config', 'config.rviz')],
arguments=['-d', LaunchConfiguration('rviz_config_file')],
parameters=[{
"use_sim_time": PythonExpression(["'", LaunchConfiguration('backend'), "' == 'sim'"]),
}]
Expand Down
Loading