From b8905b1bca1ef22485909f9096b5b95cb3a79a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=93=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=B0=D1=80=D1=8C?= Date: Fri, 21 Nov 2025 14:12:12 +1000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=83=D0=BD=D0=B8=D1=87=D1=82=D0=BE=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=81=D0=B5=D0=B3=D0=BE=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=86=D0=B5=D1=81=D0=B0=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B8=20`rviz`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iiwa_bringup/launch/rviz_iiwa.launch.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/iiwa_bringup/launch/rviz_iiwa.launch.py b/src/iiwa_bringup/launch/rviz_iiwa.launch.py index 858d5fd..6de869d 100644 --- a/src/iiwa_bringup/launch/rviz_iiwa.launch.py +++ b/src/iiwa_bringup/launch/rviz_iiwa.launch.py @@ -1,8 +1,10 @@ from launch_ros.actions import Node from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument +from launch.actions import DeclareLaunchArgument, EmitEvent, RegisterEventHandler from launch_ros.substitutions import FindPackageShare from launch.substitutions import Command, LaunchConfiguration, PathJoinSubstitution +from launch.events import Shutdown +from launch.event_handlers import OnProcessExit def generate_launch_description(): @@ -62,10 +64,18 @@ def generate_launch_description(): output='log' ) + shutdown_on_rviz_exit = RegisterEventHandler( + OnProcessExit( + target_action=rviz, + on_exit=[EmitEvent(event=Shutdown())] + ) + ) + return LaunchDescription([ declare_model_arg, declare_robot_name_arg, robot_state_publisher, joint_state_publisher_gui, - rviz + rviz, + shutdown_on_rviz_exit ]) \ No newline at end of file