Go to the documentation of this file.
14 #ifndef CONTROLLER_COMMON__CONTROLLER_BASE_HPP_
15 #define CONTROLLER_COMMON__CONTROLLER_BASE_HPP_
24 #define CONTROLLER_COMMON_COPY_MOVE_ASSIGNABLE(Class) \
25 Class(const Class &) = default; \
26 Class(Class &&) = default; \
27 Class & operator=(const Class &) = default; \
28 Class & operator=(Class &&) = default; \
35 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;
156 bool use_temporal_reference,
162 #endif // CONTROLLER_COMMON__CONTROLLER_BASE_HPP_
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:287
decltype(autoware_auto_planning_msgs::msg::TrajectoryPoint::longitudinal_velocity_mps) Real
Definition: motion_common.hpp:37
#define CONTROLLER_COMMON_COPY_MOVE_ASSIGNABLE(Class)
Definition: controller_base.hpp:24
autoware_auto_vehicle_msgs::msg::VehicleControlCommand Command
Definition: motion_common.hpp:38
ControlReference
Definition: controller_base.hpp:46
autoware_auto_vehicle_msgs::msg::VehicleKinematicState State
Definition: motion_common.hpp:40
name
Definition: setup.py:6
decltype(Trajectory::points)::value_type Point
Definition: motion_common.hpp:45
autoware_auto_system_msgs::msg::ControlDiagnostic Diagnostic
Definition: motion_common.hpp:39
decltype(Trajectory::points)::size_type Index
Definition: motion_common.hpp:44
Definition: controller_base.hpp:76
Definition: controller_base.hpp:31
Specifies the behavior of the controller.
Definition: controller_base.hpp:53
autoware_auto_planning_msgs::msg::Trajectory Trajectory
Definition: motion_common.hpp:41
geometry_msgs::msg::Point32 Point
Definition: cluster2d.cpp:28
A generic differential motion model. This class only exists to be specialized for specific motion mod...
Definition: differential_drive_motion_model.hpp:35
std::size_t Index
Index type for identifying bins of the hash/lattice.
Definition: spatial_hash_config.hpp:49