From b9849fd7c0182a4948f5ac774a6159481e1d3c1f Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Mon, 30 Aug 2021 18:23:32 +0900 Subject: [PATCH] Add autoware api (#22) * Add engage, emergency, door service (#4) * Add external engage and emergency service Signed-off-by: Takagi, Isamu * Fix api utils Signed-off-by: Takagi, Isamu * Add external door messages Signed-off-by: Takagi, Isamu * Fix lint Signed-off-by: Takagi, Isamu * Add service and client for logging Signed-off-by: Takagi, Isamu * Fix cppcheck Signed-off-by: Takagi, Isamu * Add error level Signed-off-by: Takagi, Isamu * Fix maintainer Signed-off-by: Takagi, Isamu * Fix package.xml Signed-off-by: Takagi, Isamu * Add response build functions Signed-off-by: Takagi, Isamu * Remove unnecessary explicit Signed-off-by: Takagi, Isamu * Add service result type alias Signed-off-by: Takagi, Isamu * Rename proxy class Signed-off-by: Takagi, Isamu * Change type name Signed-off-by: Takagi, Isamu * Add service call timeout * Add CI for develop branch Signed-off-by: Takagi, Isamu * Fix CI Signed-off-by: Takagi, Isamu * Fix lint Signed-off-by: Takagi, Isamu * Use default argument Signed-off-by: Takagi, Isamu * Rename package Signed-off-by: Takagi, Isamu * Move response message Signed-off-by: Takagi, Isamu * Move autoware_api_utils Signed-off-by: Takagi, Isamu * Fix package.xml format Signed-off-by: Takagi, Isamu * Fix package.xml format Signed-off-by: Takagi, Isamu * Fix package name Signed-off-by: Takagi, Isamu * Rename response type Signed-off-by: Takagi, Isamu * Fix enum type Signed-off-by: Takagi, Isamu * Add version service (#6) * Add diagnostics message (#7) Signed-off-by: Takagi, Isamu * Add route service (#8) * Add goal and route service Signed-off-by: Takagi, Isamu * Fix service name Signed-off-by: Takagi, Isamu * Add route message Signed-off-by: Takagi, Isamu * Add clear route service (#10) Signed-off-by: Takagi, Isamu * Add stop and velocity type (#9) * Add velocity service and message Signed-off-by: Takagi, Isamu * Add stop service Signed-off-by: Takagi, Isamu * Rename velocity limit service Signed-off-by: Takagi, Isamu * Rename pause driving service Signed-off-by: Takagi, Isamu * Add engage status message (#11) Signed-off-by: Takagi, Isamu * Add map info message (#13) * Add map info message Signed-off-by: Takagi, Isamu * Rename message Signed-off-by: Takagi, Isamu * Add driver type (#12) * Add driver type Signed-off-by: Takagi, Isamu * Modify variable size Signed-off-by: Takagi, Isamu * Modify message type Signed-off-by: Takagi, Isamu * Remove driver mode from observer Signed-off-by: Takagi, Isamu * Fix observer none mode Signed-off-by: Takagi, Isamu * Add initial pose service (#14) * Add initial pose service Signed-off-by: Takagi, Isamu * Rename service type name Signed-off-by: Takagi, Isamu * Remove use gnss flag Signed-off-by: Takagi, Isamu * Add service mode (#15) Signed-off-by: Takagi, Isamu * Add control command messages (#20) * Add control command messages Signed-off-by: Takagi, Isamu * Fix control command messages Signed-off-by: Takagi, Isamu * Add self package namespace (#21) Signed-off-by: Takagi, Isamu --- .../autoware_external_api_msgs/CMakeLists.txt | 60 +++++++++++++++++++ .../msg/ClassifiedDiagnostics.msg | 5 ++ .../msg/ControlCommand.msg | 4 ++ .../msg/ControlCommandStamped.msg | 2 + .../msg/DoorStatus.msg | 11 ++++ .../msg/EngageStatus.msg | 2 + .../msg/GearShift.msg | 10 ++++ .../msg/GearShiftStamped.msg | 2 + .../msg/Heartbeat.msg | 1 + .../msg/MapHash.msg | 1 + .../msg/Observer.msg | 7 +++ .../msg/Operator.msg | 7 +++ .../msg/ResponseStatus.msg | 9 +++ .../autoware_external_api_msgs/msg/Route.msg | 2 + .../msg/RouteSection.msg | 3 + .../msg/Service.msg | 6 ++ .../msg/TurnSignal.msg | 8 +++ .../msg/TurnSignalStamped.msg | 2 + .../autoware_external_api_msgs/package.xml | 31 ++++++++++ .../srv/ClearRoute.srv | 2 + .../autoware_external_api_msgs/srv/Engage.srv | 3 + .../srv/GetVersion.srv | 3 + .../srv/InitializePose.srv | 3 + .../srv/InitializePoseAuto.srv | 2 + .../srv/PauseDriving.srv | 3 + .../srv/SetDoor.srv | 3 + .../srv/SetEmergency.srv | 3 + .../srv/SetObserver.srv | 3 + .../srv/SetOperator.srv | 3 + .../srv/SetPose.srv | 3 + .../srv/SetRoute.srv | 3 + .../srv/SetService.srv | 3 + .../srv/SetVelocityLimit.srv | 3 + 33 files changed, 213 insertions(+) create mode 100644 messages/autoware_external_api_msgs/CMakeLists.txt create mode 100644 messages/autoware_external_api_msgs/msg/ClassifiedDiagnostics.msg create mode 100644 messages/autoware_external_api_msgs/msg/ControlCommand.msg create mode 100644 messages/autoware_external_api_msgs/msg/ControlCommandStamped.msg create mode 100644 messages/autoware_external_api_msgs/msg/DoorStatus.msg create mode 100644 messages/autoware_external_api_msgs/msg/EngageStatus.msg create mode 100644 messages/autoware_external_api_msgs/msg/GearShift.msg create mode 100644 messages/autoware_external_api_msgs/msg/GearShiftStamped.msg create mode 100644 messages/autoware_external_api_msgs/msg/Heartbeat.msg create mode 100644 messages/autoware_external_api_msgs/msg/MapHash.msg create mode 100644 messages/autoware_external_api_msgs/msg/Observer.msg create mode 100644 messages/autoware_external_api_msgs/msg/Operator.msg create mode 100644 messages/autoware_external_api_msgs/msg/ResponseStatus.msg create mode 100644 messages/autoware_external_api_msgs/msg/Route.msg create mode 100644 messages/autoware_external_api_msgs/msg/RouteSection.msg create mode 100644 messages/autoware_external_api_msgs/msg/Service.msg create mode 100644 messages/autoware_external_api_msgs/msg/TurnSignal.msg create mode 100644 messages/autoware_external_api_msgs/msg/TurnSignalStamped.msg create mode 100644 messages/autoware_external_api_msgs/package.xml create mode 100644 messages/autoware_external_api_msgs/srv/ClearRoute.srv create mode 100644 messages/autoware_external_api_msgs/srv/Engage.srv create mode 100644 messages/autoware_external_api_msgs/srv/GetVersion.srv create mode 100644 messages/autoware_external_api_msgs/srv/InitializePose.srv create mode 100644 messages/autoware_external_api_msgs/srv/InitializePoseAuto.srv create mode 100644 messages/autoware_external_api_msgs/srv/PauseDriving.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetDoor.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetEmergency.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetObserver.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetOperator.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetPose.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetRoute.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetService.srv create mode 100644 messages/autoware_external_api_msgs/srv/SetVelocityLimit.srv diff --git a/messages/autoware_external_api_msgs/CMakeLists.txt b/messages/autoware_external_api_msgs/CMakeLists.txt new file mode 100644 index 0000000000000..5655898c81a02 --- /dev/null +++ b/messages/autoware_external_api_msgs/CMakeLists.txt @@ -0,0 +1,60 @@ +cmake_minimum_required(VERSION 3.5) +project(autoware_external_api_msgs) + +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + msg/ClassifiedDiagnostics.msg + msg/ControlCommand.msg + msg/ControlCommandStamped.msg + msg/DoorStatus.msg + msg/Observer.msg + msg/Operator.msg + msg/EngageStatus.msg + msg/GearShift.msg + msg/GearShiftStamped.msg + msg/Heartbeat.msg + msg/MapHash.msg + msg/ResponseStatus.msg + msg/Route.msg + msg/RouteSection.msg + msg/Service.msg + msg/TurnSignal.msg + msg/TurnSignalStamped.msg + srv/ClearRoute.srv + srv/Engage.srv + srv/GetVersion.srv + srv/InitializePose.srv + srv/InitializePoseAuto.srv + srv/PauseDriving.srv + srv/SetDoor.srv + srv/SetObserver.srv + srv/SetOperator.srv + srv/SetEmergency.srv + srv/SetPose.srv + srv/SetRoute.srv + srv/SetService.srv + srv/SetVelocityLimit.srv + DEPENDENCIES + builtin_interfaces + diagnostic_msgs + geometry_msgs +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/messages/autoware_external_api_msgs/msg/ClassifiedDiagnostics.msg b/messages/autoware_external_api_msgs/msg/ClassifiedDiagnostics.msg new file mode 100644 index 0000000000000..8d4db7f9c4beb --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/ClassifiedDiagnostics.msg @@ -0,0 +1,5 @@ +builtin_interfaces/Time stamp +# TODO: move diagnostics +# TODO: move diagnostics_error +diagnostic_msgs/DiagnosticStatus[] diagnostics_notice +# TODO: move hazard_status diff --git a/messages/autoware_external_api_msgs/msg/ControlCommand.msg b/messages/autoware_external_api_msgs/msg/ControlCommand.msg new file mode 100644 index 0000000000000..8209a16efb163 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/ControlCommand.msg @@ -0,0 +1,4 @@ +float64 steering_angle +float64 steering_angle_velocity +float64 throttle +float64 brake diff --git a/messages/autoware_external_api_msgs/msg/ControlCommandStamped.msg b/messages/autoware_external_api_msgs/msg/ControlCommandStamped.msg new file mode 100644 index 0000000000000..82c1492003c09 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/ControlCommandStamped.msg @@ -0,0 +1,2 @@ +builtin_interfaces/Time stamp +autoware_external_api_msgs/ControlCommand control diff --git a/messages/autoware_external_api_msgs/msg/DoorStatus.msg b/messages/autoware_external_api_msgs/msg/DoorStatus.msg new file mode 100644 index 0000000000000..10428618bd6b0 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/DoorStatus.msg @@ -0,0 +1,11 @@ +# constants +int8 NOT_SUPPORTED = -1 +int8 UNKNOWN = 0 +int8 OPENED = 1 +int8 CLOSED = 2 +int8 OPENING = 3 +int8 CLOSING = 4 + +# fields +builtin_interfaces/Time stamp +int8 status diff --git a/messages/autoware_external_api_msgs/msg/EngageStatus.msg b/messages/autoware_external_api_msgs/msg/EngageStatus.msg new file mode 100644 index 0000000000000..c5fe7dc3988b9 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/EngageStatus.msg @@ -0,0 +1,2 @@ +builtin_interfaces/Time stamp +bool engage diff --git a/messages/autoware_external_api_msgs/msg/GearShift.msg b/messages/autoware_external_api_msgs/msg/GearShift.msg new file mode 100644 index 0000000000000..a7729854c08ba --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/GearShift.msg @@ -0,0 +1,10 @@ +# constants +uint8 NONE=0 +uint8 PARKING=1 +uint8 REVERSE=2 +uint8 NEUTRAL=3 +uint8 DRIVE=4 +uint8 LOW=5 + +# fields +uint8 data diff --git a/messages/autoware_external_api_msgs/msg/GearShiftStamped.msg b/messages/autoware_external_api_msgs/msg/GearShiftStamped.msg new file mode 100644 index 0000000000000..2a9cfb1716328 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/GearShiftStamped.msg @@ -0,0 +1,2 @@ +builtin_interfaces/Time stamp +autoware_external_api_msgs/GearShift gear_shift diff --git a/messages/autoware_external_api_msgs/msg/Heartbeat.msg b/messages/autoware_external_api_msgs/msg/Heartbeat.msg new file mode 100644 index 0000000000000..4b20d3199e5a6 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/Heartbeat.msg @@ -0,0 +1 @@ +builtin_interfaces/Time stamp diff --git a/messages/autoware_external_api_msgs/msg/MapHash.msg b/messages/autoware_external_api_msgs/msg/MapHash.msg new file mode 100644 index 0000000000000..9febad42d0627 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/MapHash.msg @@ -0,0 +1 @@ +string lanelet diff --git a/messages/autoware_external_api_msgs/msg/Observer.msg b/messages/autoware_external_api_msgs/msg/Observer.msg new file mode 100644 index 0000000000000..3f472c8b929d1 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/Observer.msg @@ -0,0 +1,7 @@ +# constants +# uint8 NONE=1 (reserved) +uint8 LOCAL=2 +uint8 REMOTE=3 + +# fields +uint8 mode diff --git a/messages/autoware_external_api_msgs/msg/Operator.msg b/messages/autoware_external_api_msgs/msg/Operator.msg new file mode 100644 index 0000000000000..18d508c615e96 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/Operator.msg @@ -0,0 +1,7 @@ +# constants +uint8 DRIVER=1 +uint8 AUTONOMOUS=2 +uint8 OBSERVER=3 + +# fields +uint8 mode diff --git a/messages/autoware_external_api_msgs/msg/ResponseStatus.msg b/messages/autoware_external_api_msgs/msg/ResponseStatus.msg new file mode 100644 index 0000000000000..440ffcd1f89ed --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/ResponseStatus.msg @@ -0,0 +1,9 @@ +# constants +uint32 SUCCESS=1 +uint32 IGNORED=2 +uint32 WARN=3 +uint32 ERROR=4 + +# fields +uint32 code +string message diff --git a/messages/autoware_external_api_msgs/msg/Route.msg b/messages/autoware_external_api_msgs/msg/Route.msg new file mode 100644 index 0000000000000..89c881d9d3d53 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/Route.msg @@ -0,0 +1,2 @@ +geometry_msgs/PoseStamped goal_pose +autoware_external_api_msgs/RouteSection[] route_sections diff --git a/messages/autoware_external_api_msgs/msg/RouteSection.msg b/messages/autoware_external_api_msgs/msg/RouteSection.msg new file mode 100644 index 0000000000000..9c056b7049735 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/RouteSection.msg @@ -0,0 +1,3 @@ +int64 preferred_lane_id +int64[] lane_ids +int64[] continued_lane_ids diff --git a/messages/autoware_external_api_msgs/msg/Service.msg b/messages/autoware_external_api_msgs/msg/Service.msg new file mode 100644 index 0000000000000..2630a53714e50 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/Service.msg @@ -0,0 +1,6 @@ +# constants +uint8 NOT_IN_SERVICE=1 +uint8 IN_SERVICE=2 + +# fields +uint8 mode diff --git a/messages/autoware_external_api_msgs/msg/TurnSignal.msg b/messages/autoware_external_api_msgs/msg/TurnSignal.msg new file mode 100644 index 0000000000000..d2a8eadd4dcdf --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/TurnSignal.msg @@ -0,0 +1,8 @@ +# constants +uint8 NONE = 0 +uint8 LEFT = 1 +uint8 RIGHT = 2 +uint8 HAZARD = 3 + +# fields +uint8 data diff --git a/messages/autoware_external_api_msgs/msg/TurnSignalStamped.msg b/messages/autoware_external_api_msgs/msg/TurnSignalStamped.msg new file mode 100644 index 0000000000000..40396b4f008a4 --- /dev/null +++ b/messages/autoware_external_api_msgs/msg/TurnSignalStamped.msg @@ -0,0 +1,2 @@ +builtin_interfaces/Time stamp +autoware_external_api_msgs/TurnSignal turn_signal diff --git a/messages/autoware_external_api_msgs/package.xml b/messages/autoware_external_api_msgs/package.xml new file mode 100644 index 0000000000000..157f52416f418 --- /dev/null +++ b/messages/autoware_external_api_msgs/package.xml @@ -0,0 +1,31 @@ + + + + + autoware_external_api_msgs + 0.0.0 + The autoware_external_api_msgs package + Takagi, Isamu + Apache License 2.0 + + ament_cmake_auto + + rosidl_default_generators + builtin_interfaces + + rosidl_default_runtime + builtin_interfaces + + diagnostic_msgs + geometry_msgs + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/messages/autoware_external_api_msgs/srv/ClearRoute.srv b/messages/autoware_external_api_msgs/srv/ClearRoute.srv new file mode 100644 index 0000000000000..0184f8d197fd3 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/ClearRoute.srv @@ -0,0 +1,2 @@ +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/Engage.srv b/messages/autoware_external_api_msgs/srv/Engage.srv new file mode 100644 index 0000000000000..33d9cb7dc1609 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/Engage.srv @@ -0,0 +1,3 @@ +bool engage +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/GetVersion.srv b/messages/autoware_external_api_msgs/srv/GetVersion.srv new file mode 100644 index 0000000000000..158b6b4b847ea --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/GetVersion.srv @@ -0,0 +1,3 @@ +--- +autoware_external_api_msgs/ResponseStatus status +string version diff --git a/messages/autoware_external_api_msgs/srv/InitializePose.srv b/messages/autoware_external_api_msgs/srv/InitializePose.srv new file mode 100644 index 0000000000000..0df0be88501f0 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/InitializePose.srv @@ -0,0 +1,3 @@ +geometry_msgs/PoseWithCovarianceStamped pose +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/InitializePoseAuto.srv b/messages/autoware_external_api_msgs/srv/InitializePoseAuto.srv new file mode 100644 index 0000000000000..0184f8d197fd3 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/InitializePoseAuto.srv @@ -0,0 +1,2 @@ +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/PauseDriving.srv b/messages/autoware_external_api_msgs/srv/PauseDriving.srv new file mode 100644 index 0000000000000..9e7d918a2785c --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/PauseDriving.srv @@ -0,0 +1,3 @@ +bool pause +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetDoor.srv b/messages/autoware_external_api_msgs/srv/SetDoor.srv new file mode 100644 index 0000000000000..aa8a042f0ff17 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetDoor.srv @@ -0,0 +1,3 @@ +bool open +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetEmergency.srv b/messages/autoware_external_api_msgs/srv/SetEmergency.srv new file mode 100644 index 0000000000000..7213c8724265b --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetEmergency.srv @@ -0,0 +1,3 @@ +bool emergency +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetObserver.srv b/messages/autoware_external_api_msgs/srv/SetObserver.srv new file mode 100644 index 0000000000000..faa2df42df4f9 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetObserver.srv @@ -0,0 +1,3 @@ +autoware_external_api_msgs/Observer mode +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetOperator.srv b/messages/autoware_external_api_msgs/srv/SetOperator.srv new file mode 100644 index 0000000000000..fde557769a2da --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetOperator.srv @@ -0,0 +1,3 @@ +autoware_external_api_msgs/Operator mode +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetPose.srv b/messages/autoware_external_api_msgs/srv/SetPose.srv new file mode 100644 index 0000000000000..b6360a13e2dd5 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetPose.srv @@ -0,0 +1,3 @@ +geometry_msgs/PoseStamped pose +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetRoute.srv b/messages/autoware_external_api_msgs/srv/SetRoute.srv new file mode 100644 index 0000000000000..84b4be958fc58 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetRoute.srv @@ -0,0 +1,3 @@ +autoware_external_api_msgs/Route route +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetService.srv b/messages/autoware_external_api_msgs/srv/SetService.srv new file mode 100644 index 0000000000000..fd40a19fee0b6 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetService.srv @@ -0,0 +1,3 @@ +autoware_external_api_msgs/Service mode +--- +autoware_external_api_msgs/ResponseStatus status diff --git a/messages/autoware_external_api_msgs/srv/SetVelocityLimit.srv b/messages/autoware_external_api_msgs/srv/SetVelocityLimit.srv new file mode 100644 index 0000000000000..2960a5e524440 --- /dev/null +++ b/messages/autoware_external_api_msgs/srv/SetVelocityLimit.srv @@ -0,0 +1,3 @@ +float32 velocity +--- +autoware_external_api_msgs/ResponseStatus status