Добавлено уничтожение всего процеса при закрытии rviz
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
from launch_ros.actions import Node
|
from launch_ros.actions import Node
|
||||||
from launch import LaunchDescription
|
from launch import LaunchDescription
|
||||||
from launch.actions import DeclareLaunchArgument
|
from launch.actions import DeclareLaunchArgument, EmitEvent, RegisterEventHandler
|
||||||
from launch_ros.substitutions import FindPackageShare
|
from launch_ros.substitutions import FindPackageShare
|
||||||
from launch.substitutions import Command, LaunchConfiguration, PathJoinSubstitution
|
from launch.substitutions import Command, LaunchConfiguration, PathJoinSubstitution
|
||||||
|
from launch.events import Shutdown
|
||||||
|
from launch.event_handlers import OnProcessExit
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
@@ -62,10 +64,18 @@ def generate_launch_description():
|
|||||||
output='log'
|
output='log'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
shutdown_on_rviz_exit = RegisterEventHandler(
|
||||||
|
OnProcessExit(
|
||||||
|
target_action=rviz,
|
||||||
|
on_exit=[EmitEvent(event=Shutdown())]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
declare_model_arg,
|
declare_model_arg,
|
||||||
declare_robot_name_arg,
|
declare_robot_name_arg,
|
||||||
robot_state_publisher,
|
robot_state_publisher,
|
||||||
joint_state_publisher_gui,
|
joint_state_publisher_gui,
|
||||||
rviz
|
rviz,
|
||||||
|
shutdown_on_rviz_exit
|
||||||
])
|
])
|
||||||
Reference in New Issue
Block a user