39namespace surface_vehicle {
77 float _speed_m_s{0.f};
78 std::optional<float> _heading_rad{};
96 _max_speed_m_s = max_speed_m_s;
100 inline std::optional<float> getMaxSpeed()
const {
return _max_speed_m_s; }
103 std::optional<float> _max_speed_m_s{};
106 SpeedAttitudeSetpoint() =
default;
114 : _speed_m_s(speed_m_s), _heading_rad(heading_rad) {}
120 _speed_m_s = speed_m_s;
129 _heading_rad = heading_rad;
133 inline float getSpeed()
const {
return _speed_m_s; }
134 inline std::optional<float> getHeading()
const {
return _heading_rad; }
Mode-wide limits for SpeedAttitudeSetpoint.
Definition speed_attitude_control.hpp:87
Config & withMaxSpeed(float max_speed_m_s)
Limits the absolute forward and reverse speed [m/s]. Unset means no limit beyond the flight controlle...
Definition speed_attitude_control.hpp:95
Drive at a given forward speed while holding a heading.
Definition speed_attitude_control.hpp:75
SpeedAttitudeSetpoint & withHeading(float heading_rad)
Sets the heading in the local ENU frame [rad]. 0 is East, positive is counter-clockwise.
Definition speed_attitude_control.hpp:128
SpeedAttitudeSetpoint & withSpeed(float speed_m_s)
Sets the speed along the body x axis [m/s]. Negative drives in reverse.
Definition speed_attitude_control.hpp:119
SpeedAttitudeSetpoint(float speed_m_s, float heading_rad)
Definition speed_attitude_control.hpp:113