Skip to content

Commit c93bedf

Browse files
tkimura4mitsudome-rnnmmjilaadaTakaHoribe
authored
feat: add emergency_handler package (#13)
* release v0.4.0 * remove ROS1 packages temporarily Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Revert "remove ROS1 packages temporarily" This reverts commit bb6fdb15dd23df7eab978525dd7a1541cf61df4a. Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * add COLCON_IGNORE to ros1 packages Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Rename launch files to launch.xml (autowarefoundation#28) * ROS2 Porting: emergency_handler (autowarefoundation#40) * Pull emergency handler package from master for porting * Fix CMakeList - Change to format similar to the simple_simulation_planner - Doesn't compile due to src files * Rename of core implementation to be compliant with ROS2 naming guidelines * Use the node/core naming convention - Add _core file to hold the implementation - _node file now holds the executable - Modify CMakeLists to point to the new executable * Conversion of msg types - Compiles now - Add back functions * Convert node intrinsics to ROS2 - Add subscriptions - Add publisher - Add timer subscription - Add publishing and logging * Rearrange files and folders * Fix cmake and package xml * Interface with parameters and fix launch file - Fix configuration files - Correct main implementation - Clean up - Fix headers * Use correct timer implementation * Use throttle logs * Use class method to get time instead of static method * Make parameter file agnostic to node name Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> * fix duration unit for RCLCPP_*_THROTTLE (autowarefoundation#75) Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com> * Adjust copyright notice on 532 out of 699 source files (autowarefoundation#143) * Use quotes for includes where appropriate (autowarefoundation#144) * Use quotes for includes where appropriate * Fix lint tests * Make tests pass hopefully * Add linters (autowarefoundation#206) * Ros2 v0.8.0 emergency handler (autowarefoundation#280) * Ros2 v0.8.0 fix packages2 (autowarefoundation#354) * fix topic name * fix duration rate * fix sensing.yaml * fix topic name * add latch-option to autoware_state_monitor * fix timer callback * fix autoware state monitor config * fix sensing.yaml * fix emergency handler (autowarefoundation#361) * Sync with Ros2 v0.8.0 beta (autowarefoundation#393) * add nullptr check when publish concatenate data (autowarefoundation#369) * Add warning msg when concat pointcloud is not published (autowarefoundation#388) Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * add timeout notification stamp msgs (autowarefoundation#363) * add timeout notification stamp msgs * fix uncursify * delete timeout notification stamped * Revert "delete timeout notification stamped" This reverts commit 365d29209f6a7f5ec75eb80c5d8c2ef38daeae79. * fix message Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> * fix state_timeout (autowarefoundation#399) Signed-off-by: Kosuke Murakami <kosuke.murakami@tier4.jp> * fix param name (autowarefoundation#412) * add timeout_ignore_state to emergency_handler (autowarefoundation#415) * add timeout_ignore_state in emergency_handler * do not ignore is_state_timeout_->is_timeout * sort condition * Ros2 fix topic name part1 (autowarefoundation#408) * Fix topic name of lane_departure_checker debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of mpc_follower debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of velocity_controller debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of motion_velocity_optimizer debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of lane_change_planner debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of behavior_velocity_planner debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of obstacle_avoidance_planner debug Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of behavior_velocity_planner Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of motion_velocity_optimizer Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of lane_departure_checker Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of mpc_follower Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of behavior_velocity_planner Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of velocity_controller Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of lane_change_planner Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of obstacle_avoidance_planner Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of obstacle_stop_planner Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of costmap_generator Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of freespace_planner Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of surround_obstacle_checker Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of costmap_generator Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of emergency_handler Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix lint errors Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix typo Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix launch arg (autowarefoundation#426) Signed-off-by: Kosuke Murakami <kosuke.murakami@tier4.jp> * add use_sim-time option (autowarefoundation#454) * Fix for rolling (autowarefoundation#1226) * Replace doc by description Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Replace ns by push-ros-namespace Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Remove state_timeout_checker (autowarefoundation#1247) Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Remove use_sim_time for set_parameter (autowarefoundation#1260) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Prevent emergency hold during manual driving (autowarefoundation#1390) * Prevent emergency hold during manual driving Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Update README.md * Fix typo * Fix -Wunused-parameter (autowarefoundation#1836) * Fix -Wunused-parameter Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix mistake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * fix spell * Fix lint issues Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore flake8 warnings Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> * Add autoware api (autowarefoundation#1979) * enable autonomous recovery (autowarefoundation#1904) * Use EmergencyState instead of deprecated EmergencyMode (autowarefoundation#2030) * Use EmergencyState instead of deprecated EmergencyMode Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Use stamped type Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * add sort-package-xml hook in pre-commit (autowarefoundation#1881) * add sort xml hook in pre-commit * change retval to exit_status * rename * add prettier plugin-xml * use early return * add license note * add tier4 license * restore prettier * change license order * move local hooks to public repo * move prettier-xml to pre-commit-hooks-ros * update version for bug-fix * apply pre-commit * Add takeover-request feature in emergency_handler (autowarefoundation#2032) * Add takeover-request feature in emergency_handler Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Rename tor to takeover_request Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Use transitionTo Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Replace image URL Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add error handling Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix state transition Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix state transition Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix cpplint Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Return after state transition Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix state transition Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add initialization for control mode (autowarefoundation#2118) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Change formatter to clang-format and black (autowarefoundation#2332) * Revert "Temporarily comment out pre-commit hooks" This reverts commit 748e9cdb145ce12f8b520bcbd97f5ff899fc28a3. * Replace ament_lint_common with autoware_lint_common Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Remove ament_cmake_uncrustify and ament_clang_format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply Black Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix for cpplint * Fix include double quotes to angle brackets Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add COLCON_IGNORE (autowarefoundation#500) Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * [emergency_handler]support autoware.auto msg (autowarefoundation#513) * support auto msg * add readme * remove VehicleStateReport/VehicleStateCommand/VehicleControlCommand (autowarefoundation#549) * fix autoware_error_monitor * fix state monitor * fix emergency handler(vehicle_state_report) * fix emergency Handler(vehicle_state_command) * fix shift_decider * fix emergency_handler(vehicle_control_command) * fix topic name * fix readme * Update system/autoware_state_monitor/Readme.md Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> * fix format * Update system/autoware_state_monitor/launch/autoware_state_monitor.launch.xml Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> * fix typo Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> * [autowere_web_controller/autoware_state_monitor/emergency_handler]fix some packages (autowarefoundation#603) * fix vehicle_engage.js * fix autoware_state_monitor param * fix emergency_handler * oh * update autoware_state.js * fix topic name (autowarefoundation#679) * Fix/psim topics emergency handler awapi (autowarefoundation#702) * fix emergency handler * fix awapi * remove unused topic * remove duplecated vehicle cmd Co-authored-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> Co-authored-by: Nikolai Morin <nnmmgit@gmail.com> Co-authored-by: Jilada Eccleston <jilada.eccleston@gmail.com> Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> Co-authored-by: Kosuke Murakami <kosuke.murakami@tier4.jp> Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> Co-authored-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com> Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com>
1 parent 4e2784a commit c93bedf

File tree

8 files changed

+625
-0
lines changed

8 files changed

+625
-0
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(emergency_handler)
3+
4+
### Compile options
5+
if(NOT CMAKE_CXX_STANDARD)
6+
set(CMAKE_CXX_STANDARD 17)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
set(CMAKE_CXX_EXTENSIONS OFF)
9+
endif()
10+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
11+
add_compile_options(-Wall -Wextra -Wpedantic)
12+
endif()
13+
14+
### Dependencies
15+
find_package(ament_cmake_auto REQUIRED)
16+
ament_auto_find_build_dependencies()
17+
18+
### Target executable
19+
set(EMERGENCY_HANDLER_SRC
20+
src/emergency_handler/emergency_handler_core.cpp)
21+
22+
set(EMERGENCY_HANDLER_HEADERS
23+
include/emergency_handler/emergency_handler_core.hpp)
24+
25+
ament_auto_add_executable(emergency_handler
26+
src/emergency_handler/emergency_handler_node.cpp
27+
${EMERGENCY_HANDLER_SRC}
28+
${EMERGENCY_HANDLER_HEADERS}
29+
)
30+
31+
if(BUILD_TESTING)
32+
find_package(ament_lint_auto REQUIRED)
33+
ament_lint_auto_find_test_dependencies()
34+
endif()
35+
36+
ament_auto_package(INSTALL_TO_SHARE
37+
launch
38+
config
39+
)

system/emergency_handler/README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# emergency_handler
2+
3+
## Purpose
4+
5+
Emergency Handler is a node to select proper MRM from from system failure state contained in HazardStatus.
6+
7+
## Inner-workings / Algorithms
8+
9+
### State Transitions
10+
11+
![fail-safe-state](https://tier4.github.io/autoware.proj/tree/main/design/apis/image/fail-safe-state.drawio.svg)
12+
13+
## Inputs / Outputs
14+
15+
### Input
16+
17+
| Name | Type | Description |
18+
| --------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------- |
19+
| `/system/emergency/hazard_status` | `autoware_auto_system_msgs::msg::HazardStatusStamped` | Used to select proper MRM from system failure state contained in HazardStatus |
20+
| `/control/vehicle_cmd` | `autoware_auto_control_msgs::msg::AckermannControlCommand` | Used as reference when generate Emergency Control Command |
21+
| `/localization/kinematic_state` | `nav_msgs::msg::Odometry` | Used to decide whether vehicle is stopped or not |
22+
| `/vehicle/status/control_mode` | `autoware_auto_vehicle_msgs::msg::ControlModeReport` | Used to check vehicle mode: autonomous or manual. |
23+
24+
### Output
25+
26+
| Name | Type | Description |
27+
| ----------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------- |
28+
| `/system/emergency/control_cmd` | `autoware_auto_control_msgs::msg::AckermannControlCommand` | Required to execute proper MRM |
29+
| `/system/emergency/shift_cmd` | `autoware_auto_vehicle_msgs::msg::GearCommand` | Required to execute proper MRM (send gear cmd) |
30+
| `/system/emergency/hazard_cmd` | `autoware_auto_vehicle_msgs::msg::HazardLightsCommand` | Required to execute proper MRM (send turn signal cmd) |
31+
| `/system/emergency/emergency_state` | `autoware_auto_system_msgs::msg::EmergencyStateStamped` | Used to inform the emergency situation of the vehicle |
32+
33+
## Parameters
34+
35+
### Node Parameters
36+
37+
| Name | Type | Default Value | Explanation |
38+
| ----------- | ---- | ------------- | ---------------------- |
39+
| update_rate | int | `10` | Timer callback period. |
40+
41+
### Core Parameters
42+
43+
| Name | Type | Default Value | Explanation |
44+
| --------------------------- | ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------- |
45+
| timeout_hazard_status | double | `0.5` | If the input `hazard_status` topic cannot be received for more than `timeout_hazard_status`, vehicle will make an emergency stop. |
46+
| use_parking_after_stopped | bool | `false` | If this parameter is true, it will publish PARKING shift command. |
47+
| turning_hazard_on.emergency | bool | `true` | If this parameter is true, hazard lamps will be turned on during emergency state. |
48+
49+
## Assumptions / Known limits
50+
51+
TBD.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Default configuration for emergency handler
2+
---
3+
/**:
4+
ros__parameters:
5+
update_rate: 10
6+
timeout_hazard_status: 0.5
7+
timeout_takeover_request: 10.0
8+
use_takeover_request: false
9+
use_parking_after_stopped: false
10+
11+
# setting whether to turn hazard lamp on for each situation
12+
turning_hazard_on:
13+
emergency: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// Copyright 2020 Tier IV, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef EMERGENCY_HANDLER__EMERGENCY_HANDLER_CORE_HPP_
16+
#define EMERGENCY_HANDLER__EMERGENCY_HANDLER_CORE_HPP_
17+
18+
// Core
19+
#include <memory>
20+
#include <string>
21+
22+
// Autoware
23+
#include <autoware_auto_control_msgs/msg/ackermann_control_command.hpp>
24+
#include <autoware_auto_system_msgs/msg/emergency_state.hpp>
25+
#include <autoware_auto_system_msgs/msg/hazard_status_stamped.hpp>
26+
#include <autoware_auto_vehicle_msgs/msg/control_mode_report.hpp>
27+
#include <autoware_auto_vehicle_msgs/msg/gear_command.hpp>
28+
#include <autoware_auto_vehicle_msgs/msg/hazard_lights_command.hpp>
29+
30+
// ROS2 core
31+
#include <autoware_utils/system/heartbeat_checker.hpp>
32+
#include <rclcpp/create_timer.hpp>
33+
#include <rclcpp/rclcpp.hpp>
34+
35+
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
36+
#include <nav_msgs/msg/odometry.hpp>
37+
38+
struct HazardLampPolicy
39+
{
40+
bool emergency;
41+
};
42+
43+
struct Param
44+
{
45+
int update_rate;
46+
double timeout_hazard_status;
47+
double timeout_takeover_request;
48+
bool use_takeover_request;
49+
bool use_parking_after_stopped;
50+
HazardLampPolicy turning_hazard_on{};
51+
};
52+
53+
class EmergencyHandler : public rclcpp::Node
54+
{
55+
public:
56+
EmergencyHandler();
57+
58+
private:
59+
// Subscribers
60+
rclcpp::Subscription<autoware_auto_system_msgs::msg::HazardStatusStamped>::SharedPtr
61+
sub_hazard_status_stamped_;
62+
rclcpp::Subscription<autoware_auto_control_msgs::msg::AckermannControlCommand>::SharedPtr
63+
sub_prev_control_command_;
64+
rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr sub_odom_;
65+
rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::ControlModeReport>::SharedPtr
66+
sub_control_mode_;
67+
68+
autoware_auto_system_msgs::msg::HazardStatusStamped::ConstSharedPtr hazard_status_stamped_;
69+
autoware_auto_control_msgs::msg::AckermannControlCommand::ConstSharedPtr prev_control_command_;
70+
nav_msgs::msg::Odometry::ConstSharedPtr odom_;
71+
autoware_auto_vehicle_msgs::msg::ControlModeReport::ConstSharedPtr control_mode_;
72+
73+
void onHazardStatusStamped(
74+
const autoware_auto_system_msgs::msg::HazardStatusStamped::ConstSharedPtr msg);
75+
void onPrevControlCommand(
76+
const autoware_auto_control_msgs::msg::AckermannControlCommand::ConstSharedPtr msg);
77+
void onOdometry(const nav_msgs::msg::Odometry::ConstSharedPtr msg);
78+
void onControlMode(const autoware_auto_vehicle_msgs::msg::ControlModeReport::ConstSharedPtr msg);
79+
80+
// Publisher
81+
rclcpp::Publisher<autoware_auto_control_msgs::msg::AckermannControlCommand>::SharedPtr
82+
pub_control_command_;
83+
84+
// rclcpp::Publisher<autoware_vehicle_msgs::msg::ShiftStamped>::SharedPtr pub_shift_;
85+
// rclcpp::Publisher<autoware_vehicle_msgs::msg::TurnSignal>::SharedPtr pub_turn_signal_;
86+
rclcpp::Publisher<autoware_auto_vehicle_msgs::msg::HazardLightsCommand>::SharedPtr
87+
pub_hazard_cmd_;
88+
rclcpp::Publisher<autoware_auto_vehicle_msgs::msg::GearCommand>::SharedPtr pub_gear_cmd_;
89+
rclcpp::Publisher<autoware_auto_system_msgs::msg::EmergencyState>::SharedPtr pub_emergency_state_;
90+
91+
autoware_auto_vehicle_msgs::msg::HazardLightsCommand createHazardCmdMsg();
92+
autoware_auto_vehicle_msgs::msg::GearCommand createGearCmdMsg();
93+
void publishControlCommands();
94+
95+
// Timer
96+
rclcpp::TimerBase::SharedPtr timer_;
97+
98+
// Parameters
99+
Param param_;
100+
101+
bool isDataReady();
102+
void onTimer();
103+
104+
// Heartbeat
105+
std::shared_ptr<HeaderlessHeartbeatChecker<autoware_auto_system_msgs::msg::HazardStatusStamped>>
106+
heartbeat_hazard_status_;
107+
108+
// Algorithm
109+
autoware_auto_system_msgs::msg::EmergencyState::_state_type emergency_state_{
110+
autoware_auto_system_msgs::msg::EmergencyState::NORMAL};
111+
rclcpp::Time takeover_requested_time_;
112+
113+
void transitionTo(const int new_state);
114+
void updateEmergencyState();
115+
bool isStopped();
116+
bool isEmergency(const autoware_auto_system_msgs::msg::HazardStatus & hazard_status);
117+
autoware_auto_control_msgs::msg::AckermannControlCommand selectAlternativeControlCommand();
118+
};
119+
120+
#endif // EMERGENCY_HANDLER__EMERGENCY_HANDLER_CORE_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<launch>
2+
<arg name="input_hazard_status" default="/system/emergency/hazard_status" />
3+
<!-- To be replaced by ControlCommand -->
4+
<arg name="input_prev_control_command" default="/control/command/control_cmd" />
5+
<arg name="input_odometry" default="/localization/kinematic_state" />
6+
<arg name="input_control_mode" default="/vehicle/status/control_mode" />
7+
8+
<arg name="output_control_command" default="/system/emergency/control_cmd" />
9+
<arg name="output_gear" default="/system/emergency/gear_cmd" />
10+
<arg name="output_hazard" default="/system/emergency/hazard_lights_cmd" />
11+
<arg name="output_emergency_state" default="/system/emergency/emergency_state" />
12+
13+
<arg name="config_file" default="$(find-pkg-share emergency_handler)/config/emergency_handler.param.yaml" />
14+
15+
<!-- emergency_handler -->
16+
<node pkg="emergency_handler" exec="emergency_handler" name="emergency_handler" output="screen">
17+
<remap from="~/input/hazard_status" to="$(var input_hazard_status)"/>
18+
<remap from="~/input/prev_control_command" to="$(var input_prev_control_command)"/>
19+
<remap from="~/input/odometry" to="$(var input_odometry)"/>
20+
<remap from="~/input/control_mode" to="$(var input_control_mode)"/>
21+
22+
<remap from="~/output/control_command" to="$(var output_control_command)"/>
23+
<remap from="~/output/gear" to="$(var output_gear)"/>
24+
<remap from="~/output/hazard" to="$(var output_hazard)"/>
25+
<remap from="~/output/emergency_state" to="$(var output_emergency_state)"/>
26+
27+
<param from="$(var config_file)" />
28+
</node>
29+
</launch>

system/emergency_handler/package.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
2+
<package format="3">
3+
<name>emergency_handler</name>
4+
<version>0.1.0</version>
5+
<description>The emergency_handler ROS2 package</description>
6+
<maintainer email="kenji.miyake@tier4.jp">Kenji Miyake</maintainer>
7+
<license>Apache License 2.0</license>
8+
9+
<buildtool_depend>ament_cmake_auto</buildtool_depend>
10+
11+
<depend>autoware_auto_control_msgs</depend>
12+
<depend>autoware_auto_system_msgs</depend>
13+
<depend>autoware_auto_vehicle_msgs</depend>
14+
<depend>autoware_utils</depend>
15+
<depend>nav_msgs</depend>
16+
<depend>rclcpp</depend>
17+
<depend>std_msgs</depend>
18+
<depend>std_srvs</depend>
19+
20+
<test_depend>ament_lint_auto</test_depend>
21+
<test_depend>autoware_lint_common</test_depend>
22+
23+
<export>
24+
<build_type>ament_cmake</build_type>
25+
</export>
26+
</package>

0 commit comments

Comments
 (0)