35 #include <eigen3/Eigen/Eigen>
40 #include "../../auterion.hpp"
43 namespace multicopter {
55 float max_horizontal_speed_m_s = 5.f;
56 float max_vertical_speed_m_s = 2.f;
57 float max_heading_rate_rad_s = 1.f;
61 GotoControlLimits(
const float max_horizontal_speed_m_s_,
const float max_vertical_speed_m_s_,
62 const float max_heading_rate_rad_s_)
63 : max_horizontal_speed_m_s(max_horizontal_speed_m_s_),
64 max_vertical_speed_m_s(max_vertical_speed_m_s_),
65 max_heading_rate_rad_s(max_heading_rate_rad_s_) {}
67 GotoControlLimits& withMaxHorizontalSpeed(
const float max_horizontal_speed_m_s_) {
68 this->max_horizontal_speed_m_s = max_horizontal_speed_m_s_;
73 this->max_vertical_speed_m_s = max_vertical_speed_m_s_;
78 this->max_heading_rate_rad_s = max_heading_rate_rad_s_;
90 Eigen::Vector3f _local_position_enu = {NAN, NAN, NAN};
91 float _heading_rad = NAN;
111 : _local_position_enu(local_position_enu), _heading_rad(heading_rad) {}
114 : _local_position_enu({local_position_en.x(), local_position_en.y(), NAN}),
115 _heading_rad(heading_rad) {}
117 inline Eigen::Vector3f getPosition()
const {
return _local_position_enu; }
119 inline float getHeading()
const {
return _heading_rad; }
121 inline GotoControlLimits getLimits()
const {
return _limits; }
123 LocalFrameGotoSetpoint& withPosition(
const Eigen::Vector3f& local_position_enu) {
124 _local_position_enu = local_position_enu;
128 LocalFrameGotoSetpoint& withPosition(
const Eigen::Vector2f& local_position_en) {
129 _local_position_enu.x() = local_position_en.x();
130 _local_position_enu.y() = local_position_en.y();
134 LocalFrameGotoSetpoint& withHeading(
const float heading_rad) {
135 _heading_rad = heading_rad;
139 LocalFrameGotoSetpoint& withAltitude(
const float z) {
140 _local_position_enu.z() = z;
144 LocalFrameGotoSetpoint& withSpeedControlLimit(
const GotoControlLimits& limits) {
149 LocalFrameGotoSetpoint& withMaxHorizontalSpeed(
const float max_horizontal_speed_m_s_) {
150 _limits.withMaxHorizontalSpeed(max_horizontal_speed_m_s_);
154 LocalFrameGotoSetpoint& withMaxVerticalSpeed(
const float max_vertical_speed_m_s_) {
155 _limits.withMaxVerticalSpeed(max_vertical_speed_m_s_);
159 LocalFrameGotoSetpoint& withMaxHeadingRate(
const float max_heading_rate_rad_s_) {
160 _limits.withMaxHeadingRate(max_heading_rate_rad_s_);
Sets controller's default speed limits for local goto setpoint.
Definition: local_frame_goto_control.hpp:98
Represents a setpoint for controlling the local frame position and heading.
Definition: local_frame_goto_control.hpp:88
Represents the desired speed limit of the vehicle when controlled with a goto setpoint.
Definition: local_frame_goto_control.hpp:53