From 20b64f69f612e6111828cc489d867025824c3bb9 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 13:45:11 +0900 Subject: [PATCH 01/24] feat: add control mode setting APIs to Autoware class --- external/concealer/include/concealer/autoware.hpp | 4 ++++ .../include/concealer/autoware_universe.hpp | 7 +++++++ external/concealer/src/autoware_universe.cpp | 12 +++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/external/concealer/include/concealer/autoware.hpp b/external/concealer/include/concealer/autoware.hpp index ff27ba70d0c..185b0603958 100644 --- a/external/concealer/include/concealer/autoware.hpp +++ b/external/concealer/include/concealer/autoware.hpp @@ -73,6 +73,10 @@ class Autoware : public rclcpp::Node, public ContinuousTransformBroadcaster void; virtual auto rethrow() -> void; + + virtual auto setManualMode() -> void = 0; + + virtual auto setAutonomousMode() -> void = 0; }; } // namespace concealer diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index 855e21b871e..e4a4b608c51 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -59,6 +59,9 @@ class AutowareUniverse : public Autoware std::atomic is_stop_requested = false; + std::atomic current_control_mode = + autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS; + std::atomic is_thrown = false; std::exception_ptr thrown; @@ -91,6 +94,10 @@ class AutowareUniverse : public Autoware autoware_auto_vehicle_msgs::msg::GearCommand> override; auto getRouteLanelets() const -> std::vector; + + auto setManualMode() -> void override; + + auto setAutonomousMode() -> void override; }; } // namespace concealer diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index 6016eb0d322..e97771dfa0c 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -111,7 +111,7 @@ auto AutowareUniverse::updateVehicleState() -> void { setControlModeReport([this]() { autoware_auto_vehicle_msgs::msg::ControlModeReport message; - message.mode = autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS; + message.mode = current_control_mode.load(); return message; }()); @@ -179,4 +179,14 @@ auto AutowareUniverse::getRouteLanelets() const -> std::vector } return ids; } + +auto AutowareUniverse::setManualMode() -> void +{ + current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL); +} + +auto AutowareUniverse::setAutonomousMode() -> void +{ + current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS); +} } // namespace concealer From 644f42c27fb90b707ce77a8c7474cdceb818788a Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 13:45:39 +0900 Subject: [PATCH 02/24] feat: use manual mode when follow trajectory action is enabled --- .../simple_sensor_simulator/src/simple_sensor_simulator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp index ad7d92218e2..7f12645dd10 100644 --- a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp +++ b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp @@ -159,12 +159,14 @@ auto ScenarioSimulator::updateEntityStatus( if (isEgo(status.name())) { assert(ego_entity_simulation_ && "Ego is spawned but ego_entity_simulation_ is nullptr!"); if (req.overwrite_ego_status()) { + ego_entity_simulation_->autoware->setManualMode(); traffic_simulator_msgs::msg::EntityStatus ego_status_msg; simulation_interface::toMsg(status, ego_status_msg); ego_entity_simulation_->overwrite( ego_status_msg, current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); } else { + ego_entity_simulation_->autoware->setAutonomousMode(); ego_entity_simulation_->update( current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); } From f37bfd0818110c8201f5e4f975cecda745cd6cc1 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Tue, 4 Jun 2024 14:11:55 +0900 Subject: [PATCH 03/24] feat: add requestAutowareControl to FieldOperatorApplicationFor class --- .../include/concealer/field_operator_application.hpp | 2 ++ ...ield_operator_application_for_autoware_universe.hpp | 7 ++++++- ...ield_operator_application_for_autoware_universe.cpp | 10 ++++++++++ simulation/traffic_simulator/src/entity/ego_entity.cpp | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/external/concealer/include/concealer/field_operator_application.hpp b/external/concealer/include/concealer/field_operator_application.hpp index 75b1cd0a62b..51f8aa3f3c1 100644 --- a/external/concealer/include/concealer/field_operator_application.hpp +++ b/external/concealer/include/concealer/field_operator_application.hpp @@ -154,6 +154,8 @@ class FieldOperatorApplication : public rclcpp::Node virtual auto sendCooperateCommand(const std::string &, const std::string &) -> void = 0; virtual auto setVelocityLimit(double) -> void = 0; + + virtual auto requestAutowareControl(const bool) -> void = 0; }; } // namespace concealer diff --git a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp index e9d14665928..fbc1693d104 100644 --- a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp +++ b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp @@ -43,6 +43,7 @@ #include #include #include +#include namespace concealer { @@ -72,6 +73,7 @@ class FieldOperatorApplicationFor ServiceWithValidation requestSetRoutePoints; ServiceWithValidation requestSetRtcAutoMode; ServiceWithValidation requestSetVelocityLimit; + ServiceWithValidation requestChangeAutowareControl; // clang-format on tier4_rtc_msgs::msg::CooperateStatusArray latest_cooperate_status_array; @@ -132,7 +134,8 @@ class FieldOperatorApplicationFor // NOTE: /api/routing/set_route_points takes a long time to return. But the specified duration is not decided by any technical reasons. requestSetRoutePoints("/api/routing/set_route_points", *this, std::chrono::seconds(10)), requestSetRtcAutoMode("/api/external/set/rtc_auto_mode", *this), - requestSetVelocityLimit("/api/autoware/set/velocity_limit", *this) + requestSetVelocityLimit("/api/autoware/set/velocity_limit", *this), + requestChangeAutowareControl("/system/operation_mode/change_autoware_control", *this) // clang-format on { } @@ -171,6 +174,8 @@ class FieldOperatorApplicationFor auto sendCooperateCommand(const std::string &, const std::string &) -> void override; auto setVelocityLimit(double) -> void override; + + auto requestAutowareControl(const bool autoware_control) -> void override; }; } // namespace concealer diff --git a/external/concealer/src/field_operator_application_for_autoware_universe.cpp b/external/concealer/src/field_operator_application_for_autoware_universe.cpp index b86d4b3a657..dfc7a0a7875 100644 --- a/external/concealer/src/field_operator_application_for_autoware_universe.cpp +++ b/external/concealer/src/field_operator_application_for_autoware_universe.cpp @@ -481,6 +481,16 @@ auto FieldOperatorApplicationFor::requestAutoModeForCooperatio } } +auto FieldOperatorApplicationFor::requestAutowareContro( + const bool autoware_control) -> void +{ + task_queue.delay([this, autoware_control]() { + auto request = std::make_shared(); + request->autoware_control = autoware_control; + requestChangeAutowareControl(request); + }); +} + auto FieldOperatorApplicationFor::receiveEmergencyState( const tier4_external_api_msgs::msg::Emergency & message) -> void { diff --git a/simulation/traffic_simulator/src/entity/ego_entity.cpp b/simulation/traffic_simulator/src/entity/ego_entity.cpp index e3a056c2dc8..c72e6111dd4 100644 --- a/simulation/traffic_simulator/src/entity/ego_entity.cpp +++ b/simulation/traffic_simulator/src/entity/ego_entity.cpp @@ -224,6 +224,7 @@ auto EgoEntity::requestFollowTrajectory( { polyline_trajectory_ = parameter; VehicleEntity::requestFollowTrajectory(parameter); + field_operator_application->requestAutowareControl(false); is_controlled_by_simulator_ = true; } From c3221a698bfdf8adb612a4fcce0d534284c5584a Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 5 Jun 2024 11:44:41 +0900 Subject: [PATCH 04/24] fix: build errors --- .../src/field_operator_application_for_autoware_universe.cpp | 2 +- simulation/traffic_simulator/src/entity/ego_entity.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/external/concealer/src/field_operator_application_for_autoware_universe.cpp b/external/concealer/src/field_operator_application_for_autoware_universe.cpp index dfc7a0a7875..0ee5b0c8785 100644 --- a/external/concealer/src/field_operator_application_for_autoware_universe.cpp +++ b/external/concealer/src/field_operator_application_for_autoware_universe.cpp @@ -481,7 +481,7 @@ auto FieldOperatorApplicationFor::requestAutoModeForCooperatio } } -auto FieldOperatorApplicationFor::requestAutowareContro( +auto FieldOperatorApplicationFor::requestAutowareControl( const bool autoware_control) -> void { task_queue.delay([this, autoware_control]() { diff --git a/simulation/traffic_simulator/src/entity/ego_entity.cpp b/simulation/traffic_simulator/src/entity/ego_entity.cpp index c72e6111dd4..10aa790ea65 100644 --- a/simulation/traffic_simulator/src/entity/ego_entity.cpp +++ b/simulation/traffic_simulator/src/entity/ego_entity.cpp @@ -159,6 +159,7 @@ void EgoEntity::onUpdate(double current_time, double step_time) target_speed_ ? target_speed_.value() : status_.getTwist().linear.x)) { setStatus(CanonicalizedEntityStatus(*updated_status, hdmap_utils_ptr_)); } else { + field_operator_application->requestAutowareControl(true); is_controlled_by_simulator_ = false; } } From a1acf2284ea594bf23cb76a504503b57a8a6762e Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 5 Jun 2024 11:45:17 +0900 Subject: [PATCH 05/24] feat: add new scenario for overriding with FollowTrajectoryAction --- ...ction.FollowTrajectoryAction-override.yaml | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 test_runner/scenario_test_runner/scenario/RoutingAction.FollowTrajectoryAction-override.yaml diff --git a/test_runner/scenario_test_runner/scenario/RoutingAction.FollowTrajectoryAction-override.yaml b/test_runner/scenario_test_runner/scenario/RoutingAction.FollowTrajectoryAction-override.yaml new file mode 100644 index 00000000000..15420dc70cf --- /dev/null +++ b/test_runner/scenario_test_runner/scenario/RoutingAction.FollowTrajectoryAction-override.yaml @@ -0,0 +1,235 @@ +OpenSCENARIO: + FileHeader: + revMajor: 0 + revMinor: 0 + date: '1970-01-01T09:00:00+09:00' + description: '' + author: 'Kotaro Yoshimoto' + ParameterDeclarations: + ParameterDeclaration: [] + CatalogLocations: + VehicleCatalog: + Directory: + path: $(ros2 pkg prefix --share openscenario_experimental_catalog)/vehicle + RoadNetwork: + LogicFile: + filepath: $(ros2 pkg prefix --share kashiwanoha_map)/map + Entities: + ScenarioObject: + - name: ego + CatalogReference: &SAMPLE_VEHICLE + catalogName: sample_vehicle + entryName: sample_vehicle + ObjectController: + Controller: + name: '' + Properties: + Property: + - name: 'isEgo' + value: 'true' + - name: car_1 + CatalogReference: *SAMPLE_VEHICLE + - name: car_2 + CatalogReference: *SAMPLE_VEHICLE + Storyboard: + Init: + Actions: + Private: + - entityRef: ego + PrivateAction: + - TeleportAction: + Position: + LanePosition: + roadId: '' + laneId: '34513' + s: 1 + offset: 0 + Orientation: &ORIENTATION_ZERO + type: relative + h: 0 + p: 0 + r: 0 + - RoutingAction: + AcquirePositionAction: + Position: &EGO_DESTINATION + LanePosition: + roadId: '' + laneId: '34507' + s: 50 + offset: 0 + Orientation: *ORIENTATION_ZERO + - entityRef: car_1 + PrivateAction: + - TeleportAction: + Position: + LanePosition: + roadId: '' + laneId: '34513' + s: 40 + offset: -1.0 + Orientation: + type: relative + h: -1.57 + p: 0 + r: 0 + - LongitudinalAction: + SpeedAction: + SpeedActionDynamics: + dynamicsDimension: time + value: 0 + dynamicsShape: step + SpeedActionTarget: + AbsoluteTargetSpeed: + value: 0 + Story: + - name: '' + Act: + - name: '' + ManeuverGroup: + - maximumExecutionCount: 1 + name: '' + Actors: + selectTriggeringEntities: false + EntityRef: + - entityRef: ego + Maneuver: + - name: '' + Event: + - name: '' + priority: parallel + StartTrigger: + ConditionGroup: + - Condition: + - name: 'check stopped' + delay: 0 + conditionEdge: none + ByEntityCondition: + TriggeringEntities: + triggeringEntitiesRule: any + EntityRef: + - entityRef: ego + EntityCondition: + SpeedCondition: + rule: lessThan + value: 3.0 + Action: + - name: 'follow_trajectory_override' + PrivateAction: + - RoutingAction: + FollowTrajectoryAction: + initialDistanceOffset: 1 + TimeReference: + Timing: + domainAbsoluteRelative: relative + offset: 0 + scale: 1 + TrajectoryFollowingMode: + followingMode: position + TrajectoryRef: + Trajectory: + closed: false + name: straight + Shape: + Polyline: + Vertex: + - Position: + LanePosition: + roadId: '' + laneId: '34513' + s: 40 + offset: 2 + Orientation: *ORIENTATION_ZERO + - Position: + LanePosition: + roadId: '' + laneId: '34507' + s: 0 + offset: 0 + Orientation: *ORIENTATION_ZERO + - Position: + LanePosition: + roadId: '' + laneId: '34507' + s: 5 + offset: 0 + Orientation: *ORIENTATION_ZERO + StartTrigger: + ConditionGroup: + - Condition: + - name: '' + delay: 0 + conditionEdge: none + ByValueCondition: + SimulationTimeCondition: + value: 10 + rule: greaterThan + - name: _EndCondition + ManeuverGroup: + - maximumExecutionCount: 1 + name: '' + Actors: + selectTriggeringEntities: false + EntityRef: + - entityRef: ego + Maneuver: + - name: '' + Event: + - name: '' + priority: parallel + StartTrigger: + ConditionGroup: + - Condition: + - name: '' + delay: 0 + conditionEdge: none + ByValueCondition: + StoryboardElementStateCondition: + storyboardElementRef: follow_trajectory_override + storyboardElementType: action + state: completeState + - name: '' + delay: 0 + conditionEdge: none + ByEntityCondition: + TriggeringEntities: + triggeringEntitiesRule: any + EntityRef: + - entityRef: ego + EntityCondition: + ReachPositionCondition: + Position: *EGO_DESTINATION + tolerance: 1 + Action: + - name: '' + UserDefinedAction: + CustomCommandAction: + type: exitSuccess + - name: '' + priority: parallel + StartTrigger: + ConditionGroup: + - Condition: + - name: '' + delay: 0 + conditionEdge: none + ByValueCondition: + SimulationTimeCondition: + value: 60 + rule: greaterThan + Action: + - name: '' + UserDefinedAction: + CustomCommandAction: + type: exitFailure + StartTrigger: + ConditionGroup: + - Condition: + - name: '' + delay: 0 + conditionEdge: none + ByValueCondition: + SimulationTimeCondition: + value: 0 + rule: greaterThan + StopTrigger: + ConditionGroup: [] From 5dec62b0a24eee6e7beb0db51c1e75bcb38d6e3c Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 19 Jun 2024 18:16:50 +0900 Subject: [PATCH 06/24] feat: use ADAPI for change autoware control --- .../concealer/field_operator_application.hpp | 4 +++- ..._operator_application_for_autoware_universe.hpp | 11 ++++++++--- ..._operator_application_for_autoware_universe.cpp | 14 ++++++++++---- .../traffic_simulator/src/entity/ego_entity.cpp | 4 ++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/external/concealer/include/concealer/field_operator_application.hpp b/external/concealer/include/concealer/field_operator_application.hpp index 51f8aa3f3c1..b3aa58e2338 100644 --- a/external/concealer/include/concealer/field_operator_application.hpp +++ b/external/concealer/include/concealer/field_operator_application.hpp @@ -155,7 +155,9 @@ class FieldOperatorApplication : public rclcpp::Node virtual auto setVelocityLimit(double) -> void = 0; - virtual auto requestAutowareControl(const bool) -> void = 0; + virtual auto enableAutowareControl() -> void = 0; + + virtual auto disableAutowareControl() -> void = 0; }; } // namespace concealer diff --git a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp index fbc1693d104..b01d847eac6 100644 --- a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp +++ b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp @@ -20,6 +20,7 @@ #endif #include +#include #include #include #include @@ -73,7 +74,8 @@ class FieldOperatorApplicationFor ServiceWithValidation requestSetRoutePoints; ServiceWithValidation requestSetRtcAutoMode; ServiceWithValidation requestSetVelocityLimit; - ServiceWithValidation requestChangeAutowareControl; + ServiceWithValidation requestEnableAutowareControl; + ServiceWithValidation requestDisableAutowareControl; // clang-format on tier4_rtc_msgs::msg::CooperateStatusArray latest_cooperate_status_array; @@ -135,7 +137,8 @@ class FieldOperatorApplicationFor requestSetRoutePoints("/api/routing/set_route_points", *this, std::chrono::seconds(10)), requestSetRtcAutoMode("/api/external/set/rtc_auto_mode", *this), requestSetVelocityLimit("/api/autoware/set/velocity_limit", *this), - requestChangeAutowareControl("/system/operation_mode/change_autoware_control", *this) + requestEnableAutowareControl("/api/operation_mode/enable_autoware_control", *this), + requestDisableAutowareControl("/api/operation_mode/disable_autoware_control", *this) // clang-format on { } @@ -175,7 +178,9 @@ class FieldOperatorApplicationFor auto setVelocityLimit(double) -> void override; - auto requestAutowareControl(const bool autoware_control) -> void override; + auto enableAutowareControl() -> void override; + + auto disableAutowareControl() -> void override; }; } // namespace concealer diff --git a/external/concealer/src/field_operator_application_for_autoware_universe.cpp b/external/concealer/src/field_operator_application_for_autoware_universe.cpp index 0ee5b0c8785..fd51846f31e 100644 --- a/external/concealer/src/field_operator_application_for_autoware_universe.cpp +++ b/external/concealer/src/field_operator_application_for_autoware_universe.cpp @@ -481,13 +481,19 @@ auto FieldOperatorApplicationFor::requestAutoModeForCooperatio } } -auto FieldOperatorApplicationFor::requestAutowareControl( - const bool autoware_control) -> void +auto FieldOperatorApplicationFor::enableAutowareControl() -> void { task_queue.delay([this, autoware_control]() { auto request = std::make_shared(); - request->autoware_control = autoware_control; - requestChangeAutowareControl(request); + requestEnableAutowareControl(request); + }); +} + +auto FieldOperatorApplicationFor::disableAutowareControl() -> void +{ + task_queue.delay([this, autoware_control]() { + auto request = std::make_shared(); + requestDisableAutowareControl(request); }); } diff --git a/simulation/traffic_simulator/src/entity/ego_entity.cpp b/simulation/traffic_simulator/src/entity/ego_entity.cpp index 291c5fff4cd..937dff24420 100644 --- a/simulation/traffic_simulator/src/entity/ego_entity.cpp +++ b/simulation/traffic_simulator/src/entity/ego_entity.cpp @@ -150,7 +150,7 @@ void EgoEntity::onUpdate(double current_time, double step_time) target_speed_ ? target_speed_.value() : status_.getTwist().linear.x)) { setStatus(CanonicalizedEntityStatus(*updated_status, hdmap_utils_ptr_)); } else { - field_operator_application->requestAutowareControl(true); + field_operator_application->enableAutowareControl(); is_controlled_by_simulator_ = false; } } @@ -216,7 +216,7 @@ auto EgoEntity::requestFollowTrajectory( { polyline_trajectory_ = parameter; VehicleEntity::requestFollowTrajectory(parameter); - field_operator_application->requestAutowareControl(false); + field_operator_application->disableAutowareControl(); is_controlled_by_simulator_ = true; } From 91a981207076c11bfc9213b035bdcae4bc2626dd Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 19 Jun 2024 18:19:39 +0900 Subject: [PATCH 07/24] feat: enrich error message of ServiceWithValidation for ResponseStatus of ADAPI --- .../include/concealer/service_with_validation.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/external/concealer/include/concealer/service_with_validation.hpp b/external/concealer/include/concealer/service_with_validation.hpp index f083724d722..62421299c85 100644 --- a/external/concealer/include/concealer/service_with_validation.hpp +++ b/external/concealer/include/concealer/service_with_validation.hpp @@ -116,11 +116,12 @@ class ServiceWithValidation return; } else { RCLCPP_ERROR_STREAM( - logger, service_name - << " service request was accepted, but ResponseStatus::success is false " - << (service_call_status.message.empty() - ? "" - : " (" + service_call_status.message + ")")); + logger, service_name << " service request was accepted, but " + "ResponseStatus::success is false with error code: " + << service_call_status.code << ", and message: " + << (service_call_status.message.empty() + ? "" + : " (" + service_call_status.message + ")")); } } else { RCLCPP_INFO_STREAM(logger, service_name << " service request has been accepted."); From d5db6ab7912c0a1c15725af38603b511add0d4b4 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Thu, 27 Jun 2024 13:33:15 +0900 Subject: [PATCH 08/24] chore(concealer): use ADAPI to change Autoware control --- .../field_operator_application_for_autoware_universe.hpp | 1 - .../field_operator_application_for_autoware_universe.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp index b01d847eac6..0e0e4a703b6 100644 --- a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp +++ b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp @@ -44,7 +44,6 @@ #include #include #include -#include namespace concealer { diff --git a/external/concealer/src/field_operator_application_for_autoware_universe.cpp b/external/concealer/src/field_operator_application_for_autoware_universe.cpp index fd51846f31e..e473fb673c6 100644 --- a/external/concealer/src/field_operator_application_for_autoware_universe.cpp +++ b/external/concealer/src/field_operator_application_for_autoware_universe.cpp @@ -483,16 +483,16 @@ auto FieldOperatorApplicationFor::requestAutoModeForCooperatio auto FieldOperatorApplicationFor::enableAutowareControl() -> void { - task_queue.delay([this, autoware_control]() { - auto request = std::make_shared(); + task_queue.delay([this]() { + auto request = std::make_shared(); requestEnableAutowareControl(request); }); } auto FieldOperatorApplicationFor::disableAutowareControl() -> void { - task_queue.delay([this, autoware_control]() { - auto request = std::make_shared(); + task_queue.delay([this]() { + auto request = std::make_shared(); requestDisableAutowareControl(request); }); } From 4f8a038e8a2eb60ab3a0b0006d364a128743427f Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Mon, 1 Jul 2024 19:02:39 +0900 Subject: [PATCH 09/24] refactor(concealer): add service server for /control/control_mode_request --- .../concealer/include/concealer/autoware.hpp | 8 ++--- .../include/concealer/autoware_universe.hpp | 8 +++-- external/concealer/src/autoware_universe.cpp | 35 ++++++++++++------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/external/concealer/include/concealer/autoware.hpp b/external/concealer/include/concealer/autoware.hpp index 185b0603958..9e8c91fb3d1 100644 --- a/external/concealer/include/concealer/autoware.hpp +++ b/external/concealer/include/concealer/autoware.hpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -66,6 +67,9 @@ class Autoware : public rclcpp::Node, public ContinuousTransformBroadcaster std::vector = 0; + virtual auto getControlModeReport() const + -> autoware_auto_vehicle_msgs::msg::ControlModeReport = 0; + auto set(const geometry_msgs::msg::Accel &) -> void; auto set(const geometry_msgs::msg::Twist &) -> void; @@ -73,10 +77,6 @@ class Autoware : public rclcpp::Node, public ContinuousTransformBroadcaster void; virtual auto rethrow() -> void; - - virtual auto setManualMode() -> void = 0; - - virtual auto setAutonomousMode() -> void = 0; }; } // namespace concealer diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index e4a4b608c51..e62fc0f5aac 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,9 @@ class AutowareUniverse : public Autoware PublisherWrapper setTurnIndicatorsReport; // clang-format on + rclcpp::Service::SharedPtr + controlModeRequestService; + const rclcpp::TimerBase::SharedPtr localization_update_timer; const rclcpp::TimerBase::SharedPtr vehicle_state_update_timer; @@ -95,9 +99,7 @@ class AutowareUniverse : public Autoware auto getRouteLanelets() const -> std::vector; - auto setManualMode() -> void override; - - auto setAutonomousMode() -> void override; + auto getControlModeReport() const -> autoware_auto_vehicle_msgs::msg::ControlModeReport override; }; } // namespace concealer diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index e97771dfa0c..0780d4e9b23 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -16,6 +16,7 @@ namespace concealer { +using autoware_auto_vehicle_msgs::srv::ControlModeCommand; AutowareUniverse::AutowareUniverse() : getAckermannControlCommand("/control/command/control_cmd", *this), getGearCommandImpl("/control/command/gear_cmd", *this), @@ -29,6 +30,22 @@ AutowareUniverse::AutowareUniverse() setControlModeReport("/vehicle/status/control_mode", *this), setVelocityReport("/vehicle/status/velocity_status", *this), setTurnIndicatorsReport("/vehicle/status/turn_indicators_status", *this), + controlModeRequestService(create_service( + "/control/control_mode_request", + [this]( + const ControlModeCommand::Request::SharedPtr request, + ControlModeCommand::Response::SharedPtr response) { + using autoware_auto_vehicle_msgs::msg::ControlModeReport; + if (request->mode == ControlModeCommand::Request::AUTONOMOUS) { + current_control_mode.store(ControlModeReport::AUTONOMOUS); + response->success = true; + } else if (request->mode == ControlModeCommand::Request::MANUAL) { + current_control_mode.store(ControlModeReport::MANUAL); + response->success = true; + } else { + response->success = false; + } + })), // Autoware.Universe requires localization topics to send data at 50Hz localization_update_timer(rclcpp::create_timer( this, get_clock(), std::chrono::milliseconds(20), [this]() { updateLocalization(); })), @@ -109,11 +126,7 @@ auto AutowareUniverse::updateLocalization() -> void auto AutowareUniverse::updateVehicleState() -> void { - setControlModeReport([this]() { - autoware_auto_vehicle_msgs::msg::ControlModeReport message; - message.mode = current_control_mode.load(); - return message; - }()); + setControlModeReport(getControlModeReport()); setGearReport([this]() { autoware_auto_vehicle_msgs::msg::GearReport message; @@ -180,13 +193,11 @@ auto AutowareUniverse::getRouteLanelets() const -> std::vector return ids; } -auto AutowareUniverse::setManualMode() -> void -{ - current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL); -} - -auto AutowareUniverse::setAutonomousMode() -> void +auto AutowareUniverse::getControlModeReport() const + -> autoware_auto_vehicle_msgs::msg::ControlModeReport { - current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS); + autoware_auto_vehicle_msgs::msg::ControlModeReport message; + message.mode = current_control_mode.load(); + return message; } } // namespace concealer From 4e49bb3690b8a40ce33c06a24536025c605dfe5f Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Mon, 1 Jul 2024 19:20:01 +0900 Subject: [PATCH 10/24] refactor(concealer): switch ego overriding by vehicle status --- .../src/simple_sensor_simulator.cpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp index ee709032ce4..0a9e1e2d3d9 100644 --- a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp +++ b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp @@ -156,17 +156,20 @@ auto ScenarioSimulator::updateEntityStatus( try { if (isEgo(status.name())) { assert(ego_entity_simulation_ && "Ego is spawned but ego_entity_simulation_ is nullptr!"); - if (req.overwrite_ego_status()) { - ego_entity_simulation_->autoware->setManualMode(); - traffic_simulator_msgs::msg::EntityStatus ego_status_msg; - simulation_interface::toMsg(status, ego_status_msg); - ego_entity_simulation_->overwrite( - ego_status_msg, current_scenario_time_ + step_time_, step_time_, - req.npc_logic_started()); - } else { - ego_entity_simulation_->autoware->setAutonomousMode(); + if (ego_entity_simulation_->autoware->getControlModeReport().mode == autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL){ + traffic_simulator_msgs::msg::EntityStatus ego_status_msg; + simulation_interface::toMsg(status, ego_status_msg); + ego_entity_simulation_->overwrite( + ego_status_msg, current_scenario_time_ + step_time_, step_time_, + req.npc_logic_started()); + } else if(ego_entity_simulation_->autoware->getControlModeReport().mode == autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS){ ego_entity_simulation_->update( current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); + }else{ + std::stringstream what; + what << "Unexpected autoware control mode for simple_sensor_simulator is given: " << ego_entity_simulation_->autoware->getControlModeReport().mode; + what << ". Expected: " << autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL << " or " << autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS << "."; + throw common::Error(what.str()); } simulation_api_schema::EntityStatus ego_status; simulation_interface::toProto(ego_entity_simulation_->getStatus(), ego_status); From 0c5f68e3ced355cc25b7ddcecdd0088aa8534023 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 3 Jul 2024 09:30:16 +0900 Subject: [PATCH 11/24] feat(concealer): add way to set autoware control mode in Autoware class --- external/concealer/include/concealer/autoware.hpp | 4 ++++ .../concealer/include/concealer/autoware_universe.hpp | 4 ++++ external/concealer/src/autoware_universe.cpp | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/external/concealer/include/concealer/autoware.hpp b/external/concealer/include/concealer/autoware.hpp index 9e8c91fb3d1..6f32ddeb33c 100644 --- a/external/concealer/include/concealer/autoware.hpp +++ b/external/concealer/include/concealer/autoware.hpp @@ -76,6 +76,10 @@ class Autoware : public rclcpp::Node, public ContinuousTransformBroadcaster void; + virtual auto setAutonomousMode() -> void = 0; + + virtual auto setManualMode() -> void = 0; + virtual auto rethrow() -> void; }; } // namespace concealer diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index e62fc0f5aac..b2f50408145 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -100,6 +100,10 @@ class AutowareUniverse : public Autoware auto getRouteLanelets() const -> std::vector; auto getControlModeReport() const -> autoware_auto_vehicle_msgs::msg::ControlModeReport override; + + auto setAutonomousMode() -> void override; + + auto setManualMode() -> void override; }; } // namespace concealer diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index 0780d4e9b23..75e72e4d9bd 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -200,4 +200,14 @@ auto AutowareUniverse::getControlModeReport() const message.mode = current_control_mode.load(); return message; } + +auto AutowareUniverse::setAutonomousMode() -> void +{ + current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS); +} + +auto AutowareUniverse::setManualMode() -> void +{ + current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL); +} } // namespace concealer From 367badf2c90bbcb4abf6b8766a32aff2eaf2c383 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 3 Jul 2024 09:32:11 +0900 Subject: [PATCH 12/24] fix(concealer): delete MANUAL control trigger via API --- external/concealer/src/autoware_universe.cpp | 8 ++++++-- simulation/traffic_simulator/src/entity/ego_entity.cpp | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index 75e72e4d9bd..df7aa57d2e9 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -40,8 +40,12 @@ AutowareUniverse::AutowareUniverse() current_control_mode.store(ControlModeReport::AUTONOMOUS); response->success = true; } else if (request->mode == ControlModeCommand::Request::MANUAL) { - current_control_mode.store(ControlModeReport::MANUAL); - response->success = true; + /* + NOTE: + This will be used when a remote override is triggered. + But scenario_simulator_v2 don't support a remote override for now. + */ + response->success = false; } else { response->success = false; } diff --git a/simulation/traffic_simulator/src/entity/ego_entity.cpp b/simulation/traffic_simulator/src/entity/ego_entity.cpp index 45faaebff30..5e0a0df1be6 100644 --- a/simulation/traffic_simulator/src/entity/ego_entity.cpp +++ b/simulation/traffic_simulator/src/entity/ego_entity.cpp @@ -216,7 +216,6 @@ auto EgoEntity::requestFollowTrajectory( { polyline_trajectory_ = parameter; VehicleEntity::requestFollowTrajectory(parameter); - field_operator_application->disableAutowareControl(); is_controlled_by_simulator_ = true; } From 9baf4b93a63f6ea46628fb37a6ff453930e57f24 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 3 Jul 2024 09:32:58 +0900 Subject: [PATCH 13/24] fix(concealer): simulate hardware override --- .../src/simple_sensor_simulator.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp index 0a9e1e2d3d9..95110509a6e 100644 --- a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp +++ b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp @@ -156,20 +156,15 @@ auto ScenarioSimulator::updateEntityStatus( try { if (isEgo(status.name())) { assert(ego_entity_simulation_ && "Ego is spawned but ego_entity_simulation_ is nullptr!"); - if (ego_entity_simulation_->autoware->getControlModeReport().mode == autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL){ - traffic_simulator_msgs::msg::EntityStatus ego_status_msg; - simulation_interface::toMsg(status, ego_status_msg); - ego_entity_simulation_->overwrite( - ego_status_msg, current_scenario_time_ + step_time_, step_time_, - req.npc_logic_started()); - } else if(ego_entity_simulation_->autoware->getControlModeReport().mode == autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS){ + if (req.overwrite_ego_status()) { + traffic_simulator_msgs::msg::EntityStatus ego_status_msg; + simulation_interface::toMsg(status, ego_status_msg); + ego_entity_simulation_->overwrite( + ego_status_msg, current_scenario_time_ + step_time_, step_time_, + req.npc_logic_started()); + } else { ego_entity_simulation_->update( current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); - }else{ - std::stringstream what; - what << "Unexpected autoware control mode for simple_sensor_simulator is given: " << ego_entity_simulation_->autoware->getControlModeReport().mode; - what << ". Expected: " << autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL << " or " << autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS << "."; - throw common::Error(what.str()); } simulation_api_schema::EntityStatus ego_status; simulation_interface::toProto(ego_entity_simulation_->getStatus(), ego_status); From cec04eb88876e2c79b06fac02694ab6b6ce061aa Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 3 Jul 2024 09:37:39 +0900 Subject: [PATCH 14/24] doc: add manual override simulation document --- docs/developer_guide/.pages | 1 + docs/user_guide/ManualOverridingAutoware.md | 38 +++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 docs/user_guide/ManualOverridingAutoware.md diff --git a/docs/developer_guide/.pages b/docs/developer_guide/.pages index 8885c0b362d..3ac1daa720f 100644 --- a/docs/developer_guide/.pages +++ b/docs/developer_guide/.pages @@ -18,3 +18,4 @@ nav: - CONTRIBUTING.md - Communication.md - ConfiguringPerceptionTopics.md + - ManualOverridingAutoware.md diff --git a/docs/user_guide/ManualOverridingAutoware.md b/docs/user_guide/ManualOverridingAutoware.md new file mode 100644 index 00000000000..b9818328633 --- /dev/null +++ b/docs/user_guide/ManualOverridingAutoware.md @@ -0,0 +1,38 @@ +# Manual Override Simulation for Autoware + +`scenario_simulator_v2` simulates the manual overriding of Autoware, with `FollowTrajectoryAction`. +During the executing `FollowTrajectoryAction`, the control of the ego entity is taken over from Autoware to the `FollowTrajectoryAction`. + +## two triggers to override Autoware + +There are 2 triggers to override Autoware. +One is hardware triggers like steering and brake pedal triggered by safety operators physically. + +Another one is software trigger via services, like remote override and override with rviz button. + +These triggers are received by vehicle interface in normal autoware driven autonomous vehicle. + +## override simulation in scenario_simulator_v2 + +vehicle interface simulation is a part of ego vehicle simulation feature in `scenario_simulator_v2`. +`scenario_simulator_v2` simulates hardware override triggered by safety operators physically when a scenario commands overriding the ego vehicle by `FollowTrajectoryAction`. + +## steps scenario_simulator_v2 takes to simulate the overrides + +### 1. triggering the override + +In real vehicle, the override detected in vehicle internally and communicated to vehicle interface node such as `pacmod_interface`. + +In `scenario_simulator_v2`, `openscenario_interpreter` send override flag via zmq interface between `traffic_simulator` and `simple_sensor_simulator` when `FollowTrajectoryAction` is started. + +`simple_sensor_simulator` receives it and set control mode to MANUAL like vehicle interface do when hardware override triggers detected. + +### 2. during the override + +`traffic_simulator` send ego status calculated to follow described in the scenario and `simple_sensor_simulator` overrides Autoware control with overwriting ego status by the received ego status. + +### 3. finishing the override + +When `FollowTrajectoryAction` is finished, `traffic_simulator` call service to enable autoware control and stop sending override flag to `simple_sensor_simulator` via zmq communication. + +This mimics the steps safety operators do in real vehicle via some human interfaces, in API level. From a4a9b0907d716afdca30becfcbb753fc90d4c2fd Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 3 Jul 2024 19:12:02 +0900 Subject: [PATCH 15/24] fix: avoid finishing the override during control mode is MANUAL --- .../src/simple_sensor_simulator.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp index 95110509a6e..ab305c4ade6 100644 --- a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp +++ b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp @@ -156,13 +156,22 @@ auto ScenarioSimulator::updateEntityStatus( try { if (isEgo(status.name())) { assert(ego_entity_simulation_ && "Ego is spawned but ego_entity_simulation_ is nullptr!"); - if (req.overwrite_ego_status()) { + if ( + req.overwrite_ego_status() or + ego_entity_simulation_->autoware->getControlModeReport().mode == + autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL) { + ego_entity_simulation_->autoware->setManualMode(); traffic_simulator_msgs::msg::EntityStatus ego_status_msg; simulation_interface::toMsg(status, ego_status_msg); ego_entity_simulation_->overwrite( ego_status_msg, current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); } else { + /* + NOTE: + Do not set autonomous mode here, + because the recovery from the override is made via an API call from Autoware. + */ ego_entity_simulation_->update( current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); } From a707e7adb741df64d730209cb420a712b5158731 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 3 Jul 2024 19:33:31 +0900 Subject: [PATCH 16/24] doc: fix document place --- docs/{user_guide => developer_guide}/ManualOverridingAutoware.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{user_guide => developer_guide}/ManualOverridingAutoware.md (100%) diff --git a/docs/user_guide/ManualOverridingAutoware.md b/docs/developer_guide/ManualOverridingAutoware.md similarity index 100% rename from docs/user_guide/ManualOverridingAutoware.md rename to docs/developer_guide/ManualOverridingAutoware.md From 60f1153a84e98d0d69171d726b631ed8d7b1e361 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Thu, 4 Jul 2024 14:22:10 +0900 Subject: [PATCH 17/24] doc: nit fix --- docs/developer_guide/.pages | 2 +- ...anualOverrideWithFollowTrajectoryAction.md | 38 +++++++++++++++++++ .../ManualOverridingAutoware.md | 38 ------------------- 3 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md delete mode 100644 docs/developer_guide/ManualOverridingAutoware.md diff --git a/docs/developer_guide/.pages b/docs/developer_guide/.pages index 3ac1daa720f..450f1059bcc 100644 --- a/docs/developer_guide/.pages +++ b/docs/developer_guide/.pages @@ -18,4 +18,4 @@ nav: - CONTRIBUTING.md - Communication.md - ConfiguringPerceptionTopics.md - - ManualOverridingAutoware.md + - ManualOverrideWithFollowTrajectoryAction.md diff --git a/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md b/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md new file mode 100644 index 00000000000..7e4de5652da --- /dev/null +++ b/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md @@ -0,0 +1,38 @@ +# Manual Override Simulation with FollowTrajectoryAction + +`scenario_simulator_v2` simulates the manual override of Autoware, with `FollowTrajectoryAction`. +During the executing `FollowTrajectoryAction`, the control of the ego entity is taken over from Autoware to the `FollowTrajectoryAction`. + +## 2 triggers to override Autoware + +There are 2 triggers to override Autoware. +One is hardware triggers like a steering and a brake pedal, physically triggered by safety operators. + +Another one is a software trigger via ROS 2 services or topics, like a remote override. + +These triggers are received by vehicle interface in autoware driven autonomous vehicles. + +## override simulation in scenario_simulator_v2 + +vehicle interface simulation is a part of the ego vehicle simulation feature in `scenario_simulator_v2`. +`scenario_simulator_v2` simulates a hardware override triggered by safety operators when a scenario commands overriding the ego vehicle by `FollowTrajectoryAction`. + +## 3 steps scenario_simulator_v2 takes to simulate the overrides + +### 1. triggering the override + +In real vehicle, the override detected in vehicle internally and communicated to vehicle interface node such as `pacmod_interface` node. + +In `scenario_simulator_v2`, `openscenario_interpreter` send an override flag via zmq interface between `traffic_simulator` and `simple_sensor_simulator` when `FollowTrajectoryAction` is started. + +`simple_sensor_simulator` receives it and set the control mode to MANUAL like vehicle interface do when hardware override triggers detected. + +### 2. during the override + +`traffic_simulator` send ego status calculated to follow described in the scenario and `simple_sensor_simulator` overrides Autoware control with overwriting ego status by the received ego status. + +### 3. finishing the override + +When `FollowTrajectoryAction` is finished, `traffic_simulator` call service to enable autoware control and stop sending the override flag to `simple_sensor_simulator` via zmq communication. + +This mimics the steps safety operators do in real vehicle via some human interfaces, in API level. diff --git a/docs/developer_guide/ManualOverridingAutoware.md b/docs/developer_guide/ManualOverridingAutoware.md deleted file mode 100644 index b9818328633..00000000000 --- a/docs/developer_guide/ManualOverridingAutoware.md +++ /dev/null @@ -1,38 +0,0 @@ -# Manual Override Simulation for Autoware - -`scenario_simulator_v2` simulates the manual overriding of Autoware, with `FollowTrajectoryAction`. -During the executing `FollowTrajectoryAction`, the control of the ego entity is taken over from Autoware to the `FollowTrajectoryAction`. - -## two triggers to override Autoware - -There are 2 triggers to override Autoware. -One is hardware triggers like steering and brake pedal triggered by safety operators physically. - -Another one is software trigger via services, like remote override and override with rviz button. - -These triggers are received by vehicle interface in normal autoware driven autonomous vehicle. - -## override simulation in scenario_simulator_v2 - -vehicle interface simulation is a part of ego vehicle simulation feature in `scenario_simulator_v2`. -`scenario_simulator_v2` simulates hardware override triggered by safety operators physically when a scenario commands overriding the ego vehicle by `FollowTrajectoryAction`. - -## steps scenario_simulator_v2 takes to simulate the overrides - -### 1. triggering the override - -In real vehicle, the override detected in vehicle internally and communicated to vehicle interface node such as `pacmod_interface`. - -In `scenario_simulator_v2`, `openscenario_interpreter` send override flag via zmq interface between `traffic_simulator` and `simple_sensor_simulator` when `FollowTrajectoryAction` is started. - -`simple_sensor_simulator` receives it and set control mode to MANUAL like vehicle interface do when hardware override triggers detected. - -### 2. during the override - -`traffic_simulator` send ego status calculated to follow described in the scenario and `simple_sensor_simulator` overrides Autoware control with overwriting ego status by the received ego status. - -### 3. finishing the override - -When `FollowTrajectoryAction` is finished, `traffic_simulator` call service to enable autoware control and stop sending override flag to `simple_sensor_simulator` via zmq communication. - -This mimics the steps safety operators do in real vehicle via some human interfaces, in API level. From 5001cfbd2cffd8d9f1ab0697d618e643a447db33 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Thu, 4 Jul 2024 14:46:33 +0900 Subject: [PATCH 18/24] refactor: change some variable name and comment --- external/concealer/include/concealer/autoware_universe.hpp | 2 +- external/concealer/src/autoware_universe.cpp | 4 ++-- .../simple_sensor_simulator/src/simple_sensor_simulator.cpp | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index b2f50408145..fbe52d97233 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -53,7 +53,7 @@ class AutowareUniverse : public Autoware // clang-format on rclcpp::Service::SharedPtr - controlModeRequestService; + control_mode_request_server; const rclcpp::TimerBase::SharedPtr localization_update_timer; diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index df7aa57d2e9..29c364df46f 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -30,7 +30,7 @@ AutowareUniverse::AutowareUniverse() setControlModeReport("/vehicle/status/control_mode", *this), setVelocityReport("/vehicle/status/velocity_status", *this), setTurnIndicatorsReport("/vehicle/status/turn_indicators_status", *this), - controlModeRequestService(create_service( + control_mode_request_server(create_service( "/control/control_mode_request", [this]( const ControlModeCommand::Request::SharedPtr request, @@ -42,7 +42,7 @@ AutowareUniverse::AutowareUniverse() } else if (request->mode == ControlModeCommand::Request::MANUAL) { /* NOTE: - This will be used when a remote override is triggered. + MANUAL request will come when a remote override is triggered. But scenario_simulator_v2 don't support a remote override for now. */ response->success = false; diff --git a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp index ab305c4ade6..7caded7b97e 100644 --- a/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp +++ b/simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp @@ -167,11 +167,6 @@ auto ScenarioSimulator::updateEntityStatus( ego_status_msg, current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); } else { - /* - NOTE: - Do not set autonomous mode here, - because the recovery from the override is made via an API call from Autoware. - */ ego_entity_simulation_->update( current_scenario_time_ + step_time_, step_time_, req.npc_logic_started()); } From 405aeb947ab409afe830a06025142d6038e3d065 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 28 Aug 2024 16:17:17 +0900 Subject: [PATCH 19/24] fix: TaskQueue::exhausted returns true during last task is executing --- external/concealer/include/concealer/task_queue.hpp | 2 ++ external/concealer/src/task_queue.cpp | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/external/concealer/include/concealer/task_queue.hpp b/external/concealer/include/concealer/task_queue.hpp index 9227f05902c..8f1b84f0f0f 100644 --- a/external/concealer/include/concealer/task_queue.hpp +++ b/external/concealer/include/concealer/task_queue.hpp @@ -40,6 +40,8 @@ class TaskQueue std::exception_ptr thrown; + std::atomic is_exhausted = true; + public: explicit TaskQueue(); diff --git a/external/concealer/src/task_queue.cpp b/external/concealer/src/task_queue.cpp index 481ecdcca1e..32c7b003cc8 100644 --- a/external/concealer/src/task_queue.cpp +++ b/external/concealer/src/task_queue.cpp @@ -23,9 +23,8 @@ TaskQueue::TaskQueue() : dispatcher([this] { try { while (rclcpp::ok() and not is_stop_requested.load(std::memory_order_acquire)) { - if (auto lock = std::unique_lock(thunks_mutex); not thunks.empty()) { - // NOTE: To ensure that the task to be queued is completed as expected is the - // responsibility of the side to create a task. + is_exhausted.store(thunks.empty()); + if (auto lock = std::unique_lock(thunks_mutex); not is_exhausted.load()) { auto thunk = std::move(thunks.front()); thunks.pop(); lock.unlock(); @@ -53,7 +52,7 @@ void TaskQueue::stopAndJoin() TaskQueue::~TaskQueue() { stopAndJoin(); } -bool TaskQueue::exhausted() const noexcept { return thunks.empty(); } +bool TaskQueue::exhausted() const noexcept { return is_exhausted.load(); } void TaskQueue::rethrow() const { From d3c45d55fbdd0d3f7a76a399ad1c654f114e45a5 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 28 Aug 2024 16:32:33 +0900 Subject: [PATCH 20/24] doc: update ManualOverrideWithFollowTrajectoryAction.md --- .../ManualOverrideWithFollowTrajectoryAction.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md b/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md index 7e4de5652da..e0e4443fb1a 100644 --- a/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md +++ b/docs/developer_guide/ManualOverrideWithFollowTrajectoryAction.md @@ -3,19 +3,21 @@ `scenario_simulator_v2` simulates the manual override of Autoware, with `FollowTrajectoryAction`. During the executing `FollowTrajectoryAction`, the control of the ego entity is taken over from Autoware to the `FollowTrajectoryAction`. -## 2 triggers to override Autoware +## 3 types of override for Autoware -There are 2 triggers to override Autoware. -One is hardware triggers like a steering and a brake pedal, physically triggered by safety operators. +There are 3 types of override for Autoware. -Another one is a software trigger via ROS 2 services or topics, like a remote override. - -These triggers are received by vehicle interface in autoware driven autonomous vehicles. +- Local: Manually control the vehicle from nearby with some device such as a joystick. + - This is one of operation modes. +- Remote: Manually control the vehicle from a web application on the cloud. + - This is one of operation modes. +- Direct: Manually control the vehicle from handle, brake and/or accel directly. + - Please note that this is not a operation mode but a control mode of vehicle interface. ## override simulation in scenario_simulator_v2 vehicle interface simulation is a part of the ego vehicle simulation feature in `scenario_simulator_v2`. -`scenario_simulator_v2` simulates a hardware override triggered by safety operators when a scenario commands overriding the ego vehicle by `FollowTrajectoryAction`. +`scenario_simulator_v2` simulates a `Direct` override triggered by safety operators when a scenario commands overriding the ego vehicle by `FollowTrajectoryAction`. ## 3 steps scenario_simulator_v2 takes to simulate the overrides From d47b6d7f8f803d4d56ba2c6c57f3fe733b7e1c0a Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 28 Aug 2024 16:58:00 +0900 Subject: [PATCH 21/24] refactor: use std::uint8_t instead of uint8_t --- external/concealer/include/concealer/autoware_universe.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index fbe52d97233..500dc7019b0 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -63,7 +63,7 @@ class AutowareUniverse : public Autoware std::atomic is_stop_requested = false; - std::atomic current_control_mode = + std::atomic current_control_mode = autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS; std::atomic is_thrown = false; From 928c6f1e0f0199aee021494fe134335b6b4b0081 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Wed, 28 Aug 2024 17:38:59 +0900 Subject: [PATCH 22/24] refactor: use aliases for message types in AutowareUniverse class --- .../include/concealer/autoware_universe.hpp | 50 +++++++++++-------- external/concealer/src/autoware_universe.cpp | 31 ++++-------- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index 500dc7019b0..03d1bc789ae 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -38,22 +38,33 @@ namespace concealer class AutowareUniverse : public Autoware { // clang-format off - SubscriberWrapper getAckermannControlCommand; - SubscriberWrapper getGearCommandImpl; - SubscriberWrapper getTurnIndicatorsCommand; - SubscriberWrapper getPathWithLaneId; - - PublisherWrapper setAcceleration; - PublisherWrapper setOdometry; - PublisherWrapper setSteeringReport; - PublisherWrapper setGearReport; - PublisherWrapper setControlModeReport; - PublisherWrapper setVelocityReport; - PublisherWrapper setTurnIndicatorsReport; + using ControlModeCommand = autoware_auto_vehicle_msgs::srv::ControlModeCommand; + using ControlModeReport = autoware_auto_vehicle_msgs::msg::ControlModeReport; + using GearCommand = autoware_auto_vehicle_msgs::msg::GearCommand; + using GearReport = autoware_auto_vehicle_msgs::msg::GearReport; + using TurnIndicatorsCommand = autoware_auto_vehicle_msgs::msg::TurnIndicatorsCommand; + using PathWithLaneId = autoware_auto_planning_msgs::msg::PathWithLaneId; + using SteeringReport = autoware_auto_vehicle_msgs::msg::SteeringReport; + using VelocityReport = autoware_auto_vehicle_msgs::msg::VelocityReport; + using TurnIndicatorsReport = autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport; + using AckermannControlCommand = autoware_auto_control_msgs::msg::AckermannControlCommand; + using AccelWithCovarianceStamped = geometry_msgs::msg::AccelWithCovarianceStamped; + + SubscriberWrapper getAckermannControlCommand; + SubscriberWrapper getGearCommandImpl; + SubscriberWrapper getTurnIndicatorsCommand; + SubscriberWrapper getPathWithLaneId; + + PublisherWrapper setAcceleration; + PublisherWrapper setOdometry; + PublisherWrapper setSteeringReport; + PublisherWrapper setGearReport; + PublisherWrapper setControlModeReport; + PublisherWrapper setVelocityReport; + PublisherWrapper setTurnIndicatorsReport; // clang-format on - rclcpp::Service::SharedPtr - control_mode_request_server; + rclcpp::Service::SharedPtr control_mode_request_server; const rclcpp::TimerBase::SharedPtr localization_update_timer; @@ -63,8 +74,7 @@ class AutowareUniverse : public Autoware std::atomic is_stop_requested = false; - std::atomic current_control_mode = - autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS; + std::atomic current_control_mode = ControlModeReport::AUTONOMOUS; std::atomic is_thrown = false; @@ -89,17 +99,15 @@ class AutowareUniverse : public Autoware auto updateVehicleState() -> void; - auto getGearCommand() const -> autoware_auto_vehicle_msgs::msg::GearCommand override; + auto getGearCommand() const -> GearCommand override; auto getGearSign() const -> double override; - auto getVehicleCommand() const -> std::tuple< - autoware_auto_control_msgs::msg::AckermannControlCommand, - autoware_auto_vehicle_msgs::msg::GearCommand> override; + auto getVehicleCommand() const -> std::tuple override; auto getRouteLanelets() const -> std::vector; - auto getControlModeReport() const -> autoware_auto_vehicle_msgs::msg::ControlModeReport override; + auto getControlModeReport() const -> ControlModeReport override; auto setAutonomousMode() -> void override; diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index 48628041072..ba3cee84b49 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -16,7 +16,6 @@ namespace concealer { -using autoware_auto_vehicle_msgs::srv::ControlModeCommand; AutowareUniverse::AutowareUniverse() : getAckermannControlCommand("/control/command/control_cmd", rclcpp::QoS(1), *this), getGearCommandImpl("/control/command/gear_cmd", rclcpp::QoS(1), *this), @@ -36,7 +35,6 @@ AutowareUniverse::AutowareUniverse() [this]( const ControlModeCommand::Request::SharedPtr request, ControlModeCommand::Response::SharedPtr response) { - using autoware_auto_vehicle_msgs::msg::ControlModeReport; if (request->mode == ControlModeCommand::Request::AUTONOMOUS) { current_control_mode.store(ControlModeReport::AUTONOMOUS); response->success = true; @@ -103,7 +101,7 @@ auto AutowareUniverse::getSteeringAngle() const -> double auto AutowareUniverse::updateLocalization() -> void { setAcceleration([this]() { - geometry_msgs::msg::AccelWithCovarianceStamped message; + AccelWithCovarianceStamped message; message.header.stamp = get_clock()->now(); message.header.frame_id = "/base_link"; message.accel.accel = current_acceleration.load(); @@ -134,14 +132,14 @@ auto AutowareUniverse::updateVehicleState() -> void setControlModeReport(getControlModeReport()); setGearReport([this]() { - autoware_auto_vehicle_msgs::msg::GearReport message; + GearReport message; message.stamp = get_clock()->now(); message.report = getGearCommand().command; return message; }()); setSteeringReport([this]() { - autoware_auto_vehicle_msgs::msg::SteeringReport message; + SteeringReport message; message.stamp = get_clock()->now(); message.steering_tire_angle = getSteeringAngle(); return message; @@ -149,7 +147,7 @@ auto AutowareUniverse::updateVehicleState() -> void setVelocityReport([this]() { const auto twist = current_twist.load(); - autoware_auto_vehicle_msgs::msg::VelocityReport message; + VelocityReport message; message.header.stamp = get_clock()->now(); message.header.frame_id = "base_link"; message.longitudinal_velocity = twist.linear.x; @@ -159,21 +157,17 @@ auto AutowareUniverse::updateVehicleState() -> void }()); setTurnIndicatorsReport([this]() { - autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport message; + TurnIndicatorsReport message; message.stamp = get_clock()->now(); message.report = getTurnIndicatorsCommand().command; return message; }()); } -auto AutowareUniverse::getGearCommand() const -> autoware_auto_vehicle_msgs::msg::GearCommand -{ - return getGearCommandImpl(); -} +auto AutowareUniverse::getGearCommand() const -> GearCommand { return getGearCommandImpl(); } auto AutowareUniverse::getGearSign() const -> double { - using autoware_auto_vehicle_msgs::msg::GearCommand; /// @todo Add support for GearCommand::NONE to return 0.0 /// @sa https://github.com/autowarefoundation/autoware.universe/blob/main/simulator/simple_planning_simulator/src/simple_planning_simulator/simple_planning_simulator_core.cpp#L475 return getGearCommand().command == GearCommand::REVERSE or @@ -182,9 +176,7 @@ auto AutowareUniverse::getGearSign() const -> double : 1.0; } -auto AutowareUniverse::getVehicleCommand() const -> std::tuple< - autoware_auto_control_msgs::msg::AckermannControlCommand, - autoware_auto_vehicle_msgs::msg::GearCommand> +auto AutowareUniverse::getVehicleCommand() const -> std::tuple { return std::make_tuple(getAckermannControlCommand(), getGearCommand()); } @@ -198,21 +190,20 @@ auto AutowareUniverse::getRouteLanelets() const -> std::vector return ids; } -auto AutowareUniverse::getControlModeReport() const - -> autoware_auto_vehicle_msgs::msg::ControlModeReport +auto AutowareUniverse::getControlModeReport() const -> ControlModeReport { - autoware_auto_vehicle_msgs::msg::ControlModeReport message; + ControlModeReport message; message.mode = current_control_mode.load(); return message; } auto AutowareUniverse::setAutonomousMode() -> void { - current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::AUTONOMOUS); + current_control_mode.store(ControlModeReport::AUTONOMOUS); } auto AutowareUniverse::setManualMode() -> void { - current_control_mode.store(autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL); + current_control_mode.store(ControlModeReport::MANUAL); } } // namespace concealer From b9551ddaa1b7bd74a82db5340501ea622f174049 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Mon, 18 Nov 2024 11:35:41 +0900 Subject: [PATCH 23/24] refactor: delete unused code --- external/concealer/include/concealer/autoware.hpp | 2 -- .../concealer/include/concealer/autoware_universe.hpp | 2 -- .../include/concealer/field_operator_application.hpp | 2 -- .../field_operator_application_for_autoware_universe.hpp | 4 ---- external/concealer/src/autoware_universe.cpp | 5 ----- .../field_operator_application_for_autoware_universe.cpp | 8 -------- 6 files changed, 23 deletions(-) diff --git a/external/concealer/include/concealer/autoware.hpp b/external/concealer/include/concealer/autoware.hpp index 6f32ddeb33c..12a50710a92 100644 --- a/external/concealer/include/concealer/autoware.hpp +++ b/external/concealer/include/concealer/autoware.hpp @@ -76,8 +76,6 @@ class Autoware : public rclcpp::Node, public ContinuousTransformBroadcaster void; - virtual auto setAutonomousMode() -> void = 0; - virtual auto setManualMode() -> void = 0; virtual auto rethrow() -> void; diff --git a/external/concealer/include/concealer/autoware_universe.hpp b/external/concealer/include/concealer/autoware_universe.hpp index 7ad86b6402c..8e96c0f4abf 100644 --- a/external/concealer/include/concealer/autoware_universe.hpp +++ b/external/concealer/include/concealer/autoware_universe.hpp @@ -109,8 +109,6 @@ class AutowareUniverse : public Autoware auto getControlModeReport() const -> ControlModeReport override; - auto setAutonomousMode() -> void override; - auto setManualMode() -> void override; }; diff --git a/external/concealer/include/concealer/field_operator_application.hpp b/external/concealer/include/concealer/field_operator_application.hpp index b3aa58e2338..57b7e0b4776 100644 --- a/external/concealer/include/concealer/field_operator_application.hpp +++ b/external/concealer/include/concealer/field_operator_application.hpp @@ -156,8 +156,6 @@ class FieldOperatorApplication : public rclcpp::Node virtual auto setVelocityLimit(double) -> void = 0; virtual auto enableAutowareControl() -> void = 0; - - virtual auto disableAutowareControl() -> void = 0; }; } // namespace concealer diff --git a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp index 853c7708b38..481a33b87c0 100644 --- a/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp +++ b/external/concealer/include/concealer/field_operator_application_for_autoware_universe.hpp @@ -86,7 +86,6 @@ class FieldOperatorApplicationFor ServiceWithValidation requestSetRtcAutoMode; ServiceWithValidation requestSetVelocityLimit; ServiceWithValidation requestEnableAutowareControl; - ServiceWithValidation requestDisableAutowareControl; // clang-format on tier4_rtc_msgs::msg::CooperateStatusArray latest_cooperate_status_array; @@ -192,7 +191,6 @@ class FieldOperatorApplicationFor requestSetRtcAutoMode("/api/external/set/rtc_auto_mode", *this), requestSetVelocityLimit("/api/autoware/set/velocity_limit", *this), requestEnableAutowareControl("/api/operation_mode/enable_autoware_control", *this), - requestDisableAutowareControl("/api/operation_mode/disable_autoware_control", *this), getPathWithLaneId("/planning/scenario_planning/lane_driving/behavior_planning/path_with_lane_id", rclcpp::QoS(1), *this) // clang-format on { @@ -234,8 +232,6 @@ class FieldOperatorApplicationFor auto setVelocityLimit(double) -> void override; auto enableAutowareControl() -> void override; - - auto disableAutowareControl() -> void override; }; } // namespace concealer diff --git a/external/concealer/src/autoware_universe.cpp b/external/concealer/src/autoware_universe.cpp index ba3cee84b49..78395952151 100644 --- a/external/concealer/src/autoware_universe.cpp +++ b/external/concealer/src/autoware_universe.cpp @@ -197,11 +197,6 @@ auto AutowareUniverse::getControlModeReport() const -> ControlModeReport return message; } -auto AutowareUniverse::setAutonomousMode() -> void -{ - current_control_mode.store(ControlModeReport::AUTONOMOUS); -} - auto AutowareUniverse::setManualMode() -> void { current_control_mode.store(ControlModeReport::MANUAL); diff --git a/external/concealer/src/field_operator_application_for_autoware_universe.cpp b/external/concealer/src/field_operator_application_for_autoware_universe.cpp index 3797d29f689..072a42b628f 100644 --- a/external/concealer/src/field_operator_application_for_autoware_universe.cpp +++ b/external/concealer/src/field_operator_application_for_autoware_universe.cpp @@ -479,14 +479,6 @@ auto FieldOperatorApplicationFor::enableAutowareControl() -> v }); } -auto FieldOperatorApplicationFor::disableAutowareControl() -> void -{ - task_queue.delay([this]() { - auto request = std::make_shared(); - requestDisableAutowareControl(request); - }); -} - auto FieldOperatorApplicationFor::receiveEmergencyState( const tier4_external_api_msgs::msg::Emergency & message) -> void { From 949b828e6aaa3c24babdbd57096018668e8ec96c Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Mon, 18 Nov 2024 11:56:27 +0900 Subject: [PATCH 24/24] docs: add interfaces for manual overriding --- docs/developer_guide/Communication.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/developer_guide/Communication.md b/docs/developer_guide/Communication.md index c5b5ef0115e..17c3880e8b9 100644 --- a/docs/developer_guide/Communication.md +++ b/docs/developer_guide/Communication.md @@ -48,14 +48,19 @@ ### Service Clients -| service name | type | note | -|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -| `/api/autoware/set/velocity_limit` | [`tier4_external_api_msgs/srv/SetVelocityLimit`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_external_api_msgs/srv/SetVelocityLimit.srv) | | -| `/api/external/set/engage` | [`tier4_external_api_msgs/srv/Engage`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_external_api_msgs/srv/Engage.srv) | | -| `/api/external/set/rtc_commands` | [`tier4_rtc_msgs/srv/CooperateCommands`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_rtc_msgs/srv/CooperateCommands.srv) | | -| `/api/external/set/rtc_auto_mode` | [`tier4_rtc_msgs/srv/AutoModeWithModule`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_rtc_msgs/srv/AutoModeWithModule.srv) | | - - +| service name | type | note | +|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| `/api/autoware/set/velocity_limit` | [`tier4_external_api_msgs/srv/SetVelocityLimit`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_external_api_msgs/srv/SetVelocityLimit.srv) | | +| `/api/external/set/engage` | [`tier4_external_api_msgs/srv/Engage`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_external_api_msgs/srv/Engage.srv) | | +| `/api/external/set/rtc_commands` | [`tier4_rtc_msgs/srv/CooperateCommands`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_rtc_msgs/srv/CooperateCommands.srv) | | +| `/api/external/set/rtc_auto_mode` | [`tier4_rtc_msgs/srv/AutoModeWithModule`](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_rtc_msgs/srv/AutoModeWithModule.srv) | | +| `/api/operation_mode/enable_autoware_control` | [`autoware_adapi_v1_msgs/srv/ChangeOperationMode`](https://github.com/autowarefoundation/autoware_adapi_msgs/blob/main/autoware_adapi_v1_msgs/operation_mode/srv/ChangeOperationMode.srv) | | + +### Service Servers + +| service name | type | note | +|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| +| `/control/control_mode_request` | [`autoware_auto_vehicle_msgs/srv/ControlModeCommand`](https://github.com/tier4/autoware_auto_msgs/blob/tier4/main/autoware_auto_vehicle_msgs/srv/ControlModeCommand.srv) | Simulated by `simple_sensor_simulator` for a manual override | [//]: # (/simulation/openscenario_visualizer)