Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fail in case of process crash #42

Merged
merged 2 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/titan/launch/cloud-interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
from ament_index_python.packages import get_package_share_directory

import launch
from launch.actions import GroupAction, IncludeLaunchDescription
from launch.actions import (
GroupAction,
IncludeLaunchDescription,
RegisterEventHandler,
EmitEvent,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.events import Shutdown
from launch.event_handlers import OnProcessExit


robots = ["asterix"]

Expand Down Expand Up @@ -48,4 +56,13 @@ def generate_launch_description():
]
)
]
+ [
RegisterEventHandler(
event_handler=OnProcessExit(
on_exit=[
EmitEvent(event=Shutdown()),
]
)
)
]
)
14 changes: 13 additions & 1 deletion src/titan/launch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
from ament_index_python.packages import get_package_share_directory

import launch
from launch.actions import IncludeLaunchDescription
from launch.actions import IncludeLaunchDescription, RegisterEventHandler, EmitEvent
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.events import Shutdown
from launch.event_handlers import OnProcessExit


robots = ["asterix"]

Expand All @@ -31,4 +34,13 @@ def generate_launch_description():
)
for robot in robots
]
+ [
RegisterEventHandler(
event_handler=OnProcessExit(
on_exit=[
EmitEvent(event=Shutdown()),
]
)
)
]
)
18 changes: 17 additions & 1 deletion src/titan/launch/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
from ament_index_python.packages import get_package_share_directory

import launch
from launch.actions import GroupAction, IncludeLaunchDescription
from launch.actions import (
GroupAction,
IncludeLaunchDescription,
RegisterEventHandler,
EmitEvent,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.events import Shutdown
from launch.event_handlers import OnProcessExit
from webots_ros2_core.webots_launcher import WebotsLauncher


Expand Down Expand Up @@ -72,4 +79,13 @@ def generate_launch_description():
]
)
]
+ [
RegisterEventHandler(
event_handler=OnProcessExit(
on_exit=[
EmitEvent(event=Shutdown()),
]
)
)
]
)