15 #ifndef CONCEALER__AUTOWARE_UNIVERSE_USER_HPP_
16 #define CONCEALER__AUTOWARE_UNIVERSE_USER_HPP_
18 #if __has_include(<autoware_adapi_v1_msgs/msg/localization_initialization_state.hpp>)
19 #include <autoware_adapi_v1_msgs/msg/localization_initialization_state.hpp>
22 #if __has_include(<autoware_system_msgs/msg/autoware_state.hpp>)
23 #include <autoware_system_msgs/msg/autoware_state.hpp>
26 #if __has_include(<autoware_auto_system_msgs/msg/autoware_state.hpp>)
27 #include <autoware_auto_system_msgs/msg/autoware_state.hpp>
30 #include <autoware_adapi_v1_msgs/msg/mrm_state.hpp>
31 #include <autoware_adapi_v1_msgs/srv/clear_route.hpp>
32 #include <autoware_adapi_v1_msgs/srv/initialize_localization.hpp>
33 #include <autoware_adapi_v1_msgs/srv/set_route_points.hpp>
34 #include <autoware_auto_control_msgs/msg/ackermann_control_command.hpp>
35 #include <autoware_auto_perception_msgs/msg/traffic_signal_array.hpp>
36 #include <autoware_auto_planning_msgs/msg/path_with_lane_id.hpp>
37 #include <autoware_auto_system_msgs/msg/emergency_state.hpp>
38 #include <autoware_auto_vehicle_msgs/msg/gear_command.hpp>
45 #include <geometry_msgs/msg/pose_with_covariance_stamped.hpp>
46 #include <tier4_external_api_msgs/msg/emergency.hpp>
47 #include <tier4_external_api_msgs/srv/engage.hpp>
48 #include <tier4_external_api_msgs/srv/set_velocity_limit.hpp>
49 #include <tier4_planning_msgs/msg/trajectory.hpp>
50 #include <tier4_rtc_msgs/msg/cooperate_status_array.hpp>
51 #include <tier4_rtc_msgs/srv/auto_mode_with_module.hpp>
52 #include <tier4_rtc_msgs/srv/cooperate_commands.hpp>
65 #if __has_include(<autoware_system_msgs/msg/autoware_state.hpp>)
68 #if __has_include(<autoware_auto_system_msgs/msg/autoware_state.hpp>)
73 #if __has_include(<autoware_adapi_v1_msgs/msg/localization_initialization_state.hpp>)
89 tier4_rtc_msgs::msg::CooperateStatusArray latest_cooperate_status_array;
97 auto receiveMrmState(
const autoware_adapi_v1_msgs::msg::MrmState & msg) -> void;
99 auto receiveEmergencyState(
const tier4_external_api_msgs::msg::Emergency & msg) -> void;
106 #define DEFINE_STATE_PREDICATE(NAME, VALUE) \
107 auto is##NAME() const noexcept { return autoware_state == #VALUE; } \
108 static_assert(true, "")
118 #undef DEFINE_STATE_PREDICATE
121 template <
typename T>
124 #define CASE(IDENTIFIER) \
125 case T::IDENTIFIER: \
130 CASE(WAITING_FOR_ROUTE);
132 CASE(WAITING_FOR_ENGAGE);
143 auto sendSIGINT() ->
void override;
149 template <
typename... Ts>
153 getAckermannControlCommand(
"/control/command/control_cmd", rclcpp::QoS(1), *this),
154 #if __has_include(<autoware_system_msgs/msg/autoware_state.hpp>)
155 getAutowareState(
"/autoware/state", rclcpp::QoS(1), *this, [this](const auto & v) {
162 autoware_state = getAutowareStateString<autoware_system_msgs::msg::AutowareState>(v.state); }),
164 #
if __has_include(<autoware_auto_system_msgs/msg/autoware_state.hpp>)
165 getAutowareAutoState("/autoware/state", rclcpp::QoS(1), *this, [this](const auto & v) {
172 autoware_state = getAutowareStateString<autoware_auto_system_msgs::msg::AutowareState>(v.state);
175 getCooperateStatusArray(
"/api/external/get/rtc_status", rclcpp::QoS(1), *
this, [
this](
const auto & v) { latest_cooperate_status_array = v; }),
176 getEmergencyState(
"/api/external/get/emergency", rclcpp::QoS(1), *
this, [
this](
const auto & v) { receiveEmergencyState(v); }),
177 #
if __has_include(<autoware_adapi_v1_msgs/msg/localization_initialization_state.hpp>)
178 getLocalizationState("/api/localization/initialization_state", rclcpp::QoS(1).transient_local(), *this),
180 getMrmState(
"/api/fail_safe/mrm_state", rclcpp::QoS(1), *
this, [
this](
const auto & v) { receiveMrmState(v); }),
181 getTrajectory(
"/api/iv_msgs/planning/scenario_planning/trajectory", rclcpp::QoS(1), *
this),
182 getTurnIndicatorsCommandImpl(
"/control/command/turn_indicators_cmd", rclcpp::QoS(1), *
this),
183 requestClearRoute(
"/api/routing/clear_route", *
this),
184 requestCooperateCommands(
"/api/external/set/rtc_commands", *
this),
185 requestEngage(
"/api/external/set/engage", *
this),
186 requestInitialPose(
"/api/localization/initialize", *
this),
188 requestSetRoutePoints(
"/api/routing/set_route_points", *
this, std::chrono::seconds(10)),
189 requestSetRtcAutoMode(
"/api/external/set/rtc_auto_mode", *
this),
190 requestSetVelocityLimit(
"/api/autoware/set/velocity_limit", *
this),
191 getPathWithLaneId(
"/planning/scenario_planning/lane_driving/behavior_planning/path_with_lane_id", rclcpp::QoS(1), *
this)
196 ~FieldOperatorApplicationFor()
override;
198 auto engage() ->
void override;
200 auto engageable() const ->
bool override;
202 auto engaged() const ->
bool override;
204 auto getAutowareStateName() const ->
std::
string override;
206 auto getWaypoints() const -> traffic_simulator_msgs::msg::WaypointsArray override;
208 auto getTurnIndicatorsCommand() const
211 auto getEmergencyStateName() const ->
std::
string override;
213 auto getMinimumRiskManeuverBehaviorName() const ->
std::
string override;
215 auto getMinimumRiskManeuverStateName() const ->
std::
string override;
217 auto initialize(const geometry_msgs::msg::Pose &) ->
void override;
219 auto plan(const
std::vector<geometry_msgs::msg::PoseStamped> &) ->
void override;
221 auto clearRoute() ->
void override;
223 auto requestAutoModeForCooperation(const
std::
string &,
bool) ->
void override;
225 auto restrictTargetSpeed(
double) const ->
double override;
227 auto sendCooperateCommand(const
std::
string &, const
std::
string &) ->
void override;
229 auto setVelocityLimit(
double) ->
void override;
Definition: autoware_universe.hpp:38
SubscriberWrapper< autoware_auto_planning_msgs::msg::PathWithLaneId > getPathWithLaneId
Definition: field_operator_application_for_autoware_universe.hpp:146
auto getAutowareStateString(std::uint8_t state) const -> char const *
Definition: field_operator_application_for_autoware_universe.hpp:122
CONCEALER_PUBLIC FieldOperatorApplicationFor(Ts &&... xs)
Definition: field_operator_application_for_autoware_universe.hpp:150
Definition: field_operator_application.hpp:44
Definition: field_operator_application.hpp:60
#define CONCEALER_PUBLIC
Definition: visibility.hpp:49
#define DEFINE_STATE_PREDICATE(NAME, VALUE)
Definition: field_operator_application_for_autoware_universe.hpp:106
Definition: field_operator_application.hpp:161
Definition: autoware.hpp:30
Definition: junit5.hpp:25
std::string string
Definition: junit5.hpp:26
Definition: transition_assertion.hpp:27