mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
launch file ROS2
This commit is contained in:
@@ -41,15 +41,15 @@ def generate_launch_description():
|
|||||||
output='screen'
|
output='screen'
|
||||||
)
|
)
|
||||||
|
|
||||||
# Register a restart handler that re-creates both node + handler
|
# Instead of recursion at definition time, we delay the re-creation using a lambda
|
||||||
restart_handler = RegisterEventHandler(
|
restart_handler = RegisterEventHandler(
|
||||||
OnProcessExit(
|
OnProcessExit(
|
||||||
target_action=lidar_node,
|
target_action=lidar_node,
|
||||||
on_exit=[
|
on_exit=[
|
||||||
LogInfo(msg="[Launch] RPLIDAR crashed — restarting in 2s..."),
|
LogInfo(msg='[Launch] RPLIDAR crashed — restarting in 2s...'),
|
||||||
TimerAction(
|
TimerAction(
|
||||||
period=2.0,
|
period=2.0,
|
||||||
actions=create_lidar_with_restart() # recursive: spawns new node + handler
|
actions=[OpaqueFunction(function=lambda *_: create_lidar_with_restart())]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user