Skip to content

Commit

Permalink
ROS2 warehouse demo launch: add use_rviz argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Dec 12, 2024
1 parent 3b117ee commit 67d31fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mvsim_tutorial/demo_warehouse.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from ament_index_python import get_package_share_directory
import os

Expand All @@ -28,6 +29,11 @@ def generate_launch_description():
"force_publish_vehicle_namespace", default_value='False',
description='Use vehicle name namespace even if there is only one vehicle')

use_rviz_arg = DeclareLaunchArgument(
'use_rviz', default_value='True',
description='Whether to launch RViz2'
)

mvsim_node = Node(
package='mvsim',
executable='mvsim_node',
Expand All @@ -45,6 +51,7 @@ def generate_launch_description():
)

rviz2_node = Node(
condition=IfCondition(LaunchConfiguration('use_rviz')),
package='rviz2',
executable='rviz2',
name='rviz2',
Expand All @@ -57,6 +64,7 @@ def generate_launch_description():
headless_launch_arg,
do_fake_localization_arg,
force_publish_vehicle_namespace_arg,
use_rviz_arg,
mvsim_node,
rviz2_node
])

0 comments on commit 67d31fa

Please sign in to comment.