Skip to content

Commit

Permalink
Add timer to rviz launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Myzhar committed Oct 21, 2022
1 parent b159532 commit a620cc9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions zed_display_rviz2/launch/display_zed2i.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
from launch.actions import DeclareLaunchArgument
from launch.actions import DeclareLaunchArgument, TimerAction
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node

Expand Down Expand Up @@ -131,6 +131,17 @@ def generate_launch_description():
# Add nodes to LaunchDescription
ld.add_action(zed_wrapper_launch)

ld.add_action(rviz2_node)
# Start Rviz when the ZED Node is ready
rviz_node_delay = 10.0

delayed_rviz_node = TimerAction(
period=rviz_node_delay,
actions=[rviz2_node]
)

ld.add_action(delayed_rviz_node)

else:
ld.add_action(rviz2_node)

return ld

0 comments on commit a620cc9

Please sign in to comment.