14 #ifndef CONTROLLER_COMMON__CONTROLLER_BASE_HPP_ 15 #define CONTROLLER_COMMON__CONTROLLER_BASE_HPP_ 23 #define CONTROLLER_COMMON_COPY_MOVE_ASSIGNABLE(Class) \ 24 Class(const Class &) = default; \ 25 Class(Class &&) = default; \ 26 Class & operator=(const Class &) = default; \ 27 Class & operator=(Class &&) = default; \ 34 namespace controller_common
58 Real safe_deceleration_rate_mps2,
59 std::chrono::nanoseconds time_step,
63 Real safe_deceleration_rate()
const noexcept;
64 std::chrono::nanoseconds time_step()
const noexcept;
65 bool is_spatial_reference()
const noexcept;
66 bool is_temporal_reference()
const noexcept;
69 Real m_safe_deceleration_rate_mps2;
70 std::chrono::nanoseconds m_time_step;
71 bool m_is_spatial_reference;
89 void set_trajectory(
const Trajectory & trajectory);
91 const Trajectory & get_reference_trajectory()
const noexcept;
99 Command compute_stop_command(
const State & state)
const noexcept;
105 Index get_current_state_spatial_index()
const;
110 Index get_current_state_temporal_index()
const;
113 virtual std::string name()
const;
116 virtual Index get_compute_iterations()
const;
123 virtual bool check_new_trajectory(
const Trajectory & trajectory)
const;
128 virtual Command compute_command_impl(
const State & state) = 0;
130 Point predict(
const Point & point, std::chrono::nanoseconds dt) noexcept;
136 CONTROLLER_COMMON_LOCAL
bool is_state_ok(
const State & state)
const noexcept;
138 CONTROLLER_COMMON_LOCAL
void update_reference_indices(
const State & new_state) noexcept;
140 CONTROLLER_COMMON_LOCAL
bool is_past_trajectory(
const State & state)
const noexcept;
142 CONTROLLER_COMMON_LOCAL
void set_trajectory_impl();
146 std::chrono::system_clock::time_point m_latest_reference;
147 Index m_reference_spatial_index;
148 Index m_reference_temporal_index;
155 bool use_temporal_reference,
161 #endif // CONTROLLER_COMMON__CONTROLLER_BASE_HPP_ decltype(autoware_auto_msgs::msg::TrajectoryPoint::x) Real
Definition: motion_common.hpp:33
autoware_auto_msgs::msg::ControlDiagnostic Diagnostic
Definition: motion_common.hpp:35
decltype(Trajectory::points)::value_type Point
Definition: motion_common.hpp:40
autoware_auto_msgs::msg::Trajectory Trajectory
Definition: motion_common.hpp:37
decltype(Trajectory::points)::size_type Index
Definition: motion_common.hpp:39
#define CONTROLLER_COMMON_COPY_MOVE_ASSIGNABLE(Class)
Definition: controller_base.hpp:23
geometry_msgs::msg::Point32 Point
Definition: intersection.hpp:52
Definition: controller_base.hpp:76
Specifies the behavior of the controller.
Definition: controller_base.hpp:53
Definition: controller_base.hpp:30
std::size_t Index
Index type for identifying bins of the hash/lattice.
Definition: spatial_hash_config.hpp:49
autoware_auto_msgs::msg::VehicleKinematicState State
Definition: motion_common.hpp:36
autoware_auto_msgs::msg::VehicleControlCommand Command
Definition: motion_common.hpp:34
ControlReference
Definition: controller_base.hpp:46
decltype(decltype(State::state)::heading) Heading
Definition: motion_common.hpp:38
CONTROLLER_COMMON_PUBLIC void compute_diagnostic(const ControllerBase &ctrl, const State &state, bool use_temporal_reference, Diagnostic &out)
Fill out a controller diagnostic message.
Definition: controller_base.cpp:291