14 #ifndef PARKING_PLANNER__PARKING_PLANNER_TYPES_HPP_ 15 #define PARKING_PLANNER__PARKING_PLANNER_TYPES_HPP_ 32 namespace parking_planner
49 m_velocity = velocity;
51 m_steering = steering;
57 return std::vector<T>{m_position_x, m_position_y, m_velocity, m_heading, m_steering};
63 if (serialized_states.size() != VehicleState::internal_states_number) {
64 throw std::length_error {
"Need a vector of length " +
65 std::string{VehicleState::internal_states_number}
70 serialized_states[0], serialized_states[1], serialized_states[2],
72 serialized_states[4]);
76 T get_x() const noexcept {
return m_position_x;}
77 T get_y() const noexcept {
return m_position_y;}
90 return internal_states_number;
96 return (this->m_position_x == other.m_position_x) &&
97 (this->m_position_y == other.m_position_y) &&
98 (this->m_velocity == other.m_velocity) &&
99 (this->m_heading == other.m_heading) &&
100 (this->m_steering == other.m_steering);
105 static constexpr std::size_t internal_states_number = 5;
137 m_steering_rate = steering_rate;
138 m_throttle = throttle;
143 {
return std::vector<T>{m_steering_rate, m_throttle};}
148 if (serialized_commands.size() != VehicleCommand::internal_commands_number) {
149 throw std::length_error {
"Need a vector of length " +
150 std::string{VehicleCommand::internal_commands_number}
154 return VehicleCommand(serialized_commands[0], serialized_commands[1]);
164 {
return internal_commands_number;}
168 static constexpr std::size_t internal_commands_number = 2;
207 #endif // PARKING_PLANNER__PARKING_PLANNER_TYPES_HPP_ std::vector< TrajectoryStep< T > > Trajectory
Class to represent a dynamic trajectory.
Definition: parking_planner_types.hpp:200
T
Definition: catr_diff.py:22
VehicleCommand() noexcept
Definition: parking_planner_types.hpp:132
void set_velocity(T velocity) noexcept
Definition: parking_planner_types.hpp:83
Class to represent the state of a vehicle.
Definition: parking_planner_types.hpp:37
TrajectoryStep(const VehicleCommand< T > command, const VehicleState< T > state) noexcept
Definition: parking_planner_types.hpp:184
std::vector< T > serialize(void) const
Turn the object into flat vector of doubles (for use with numerical code)
Definition: parking_planner_types.hpp:142
T get_velocity() const noexcept
Definition: parking_planner_types.hpp:78
static constexpr std::size_t get_serialized_length() noexcept
Get number of scalars a serialized version of this object has.
Definition: parking_planner_types.hpp:163
void set_x(T x) noexcept
Definition: parking_planner_types.hpp:81
T get_heading() const noexcept
Definition: parking_planner_types.hpp:79
void set_y(T y) noexcept
Definition: parking_planner_types.hpp:82
static VehicleState deserialize(std::vector< T > serialized_states)
Definition: parking_planner_types.hpp:61
DifferentialState x
Definition: kinematic_bicycle.snippet.hpp:28
static VehicleCommand deserialize(std::vector< T > serialized_commands)
Turn a previously serialized command vector back into a VehicleCommand object.
Definition: parking_planner_types.hpp:146
void set_throttle(T throttle) noexcept
Definition: parking_planner_types.hpp:160
T get_steering() const noexcept
Definition: parking_planner_types.hpp:80
void set_heading(T heading) noexcept
Definition: parking_planner_types.hpp:84
Definition: controller_base.hpp:30
T get_steering_rate() const noexcept
Definition: parking_planner_types.hpp:157
DifferentialState y
Definition: kinematic_bicycle.snippet.hpp:28
T get_y() const noexcept
Definition: parking_planner_types.hpp:77
VehicleState() noexcept
No-input constructor sets everything to the zero of the template parameter.
Definition: parking_planner_types.hpp:42
Class to represent the inputs of a vehicle.
Definition: parking_planner_types.hpp:127
std::vector< T > serialize(void) const
Turn the object into flat vector of doubles (for use with numerical code)
Definition: parking_planner_types.hpp:55
bool operator==(const VehicleState< T > &other) const noexcept
Equality comparison operator.
Definition: parking_planner_types.hpp:94
Class to represent one timestep in a dynamic trajectory.
Definition: parking_planner_types.hpp:181
VehicleCommand(T steering_rate, T throttle) noexcept
Definition: parking_planner_types.hpp:135
VehicleCommand< T > get_command() const noexcept
Definition: parking_planner_types.hpp:191
void set_steering_rate(T steering_rate) noexcept
Definition: parking_planner_types.hpp:159
void set_steering(T steering) noexcept
Definition: parking_planner_types.hpp:85
static constexpr std::size_t get_serialized_length() noexcept
Get number of scalars a serialized version of this object has.
Definition: parking_planner_types.hpp:88
T get_x() const noexcept
Definition: parking_planner_types.hpp:76
VehicleState(T x, T y, T velocity, T heading, T steering) noexcept
Definition: parking_planner_types.hpp:45
T get_throttle() const noexcept
Definition: parking_planner_types.hpp:158
VehicleState< T > get_state() const noexcept
Definition: parking_planner_types.hpp:190
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24