Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
auterion::surface_vehicle::SpeedAttitudeSetpoint Class Reference

Drive at a given forward speed while holding a heading. More...

#include <auterion_sdk/control/surface_vehicle/speed_attitude_control.hpp>

Classes

class  Config
 Mode-wide limits for SpeedAttitudeSetpoint. More...
 

Public Member Functions

 SpeedAttitudeSetpoint (float speed_m_s, float heading_rad)
 
SpeedAttitudeSetpoint & withSpeed (float speed_m_s)
 Sets the speed along the body x axis [m/s]. Negative drives in reverse.
 
SpeedAttitudeSetpoint & withHeading (float heading_rad)
 Sets the heading in the local ENU frame [rad]. 0 is East, positive is counter-clockwise.
 
float getSpeed () const
 
std::optional< float > getHeading () const
 

Detailed Description

Drive at a given forward speed while holding a heading.

The flight controller handles speed and heading control. Use this for your own guidance, e.g. path following or station keeping: compute the heading to steer and the speed, and send them.

Frames and units:

  • Speed is the speed along the body x axis (forward) [m/s]. Negative values drive in reverse.
  • Heading is the yaw angle in the local ENU frame [rad]: 0 is East, positive is counter-clockwise (pi/2 is North). This is the same convention as the rest of the SDK, e.g. auterion::LocalPosition::heading.

Defaults:

  • Speed defaults to 0 m/s.
  • If no heading is set, the vehicle holds the heading it had when it last received a setpoint without a heading. So a setpoint with only a speed drives the vehicle straight ahead.

Example:

auterion::Mode mode(sdk, "Follow line",
mode.onUpdateSetpoint([this](float dt_s) -> auterion::Setpoint {
.withSpeed(2.5f)
.withHeading(computeHeading());
});
Defines a mode to control the vehicle using a (set) of setpoint types.
Definition mode.hpp:280
void onUpdateSetpoint(const std::function< Setpoint(float)> &callback)
Sets a callback function to be called at periodically at the update frequency of the mode.
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
std::variant< RateSetpoint, AttitudeSetpoint, multicopter::LocalFrameDynamicsSetpoint, multicopter::BodyFrameDynamicsSetpoint, multicopter::LocalFrameGotoSetpoint, multicopter::GlobalFrameGotoSetpoint, fixedwing::DynamicsSetpoint, fixedwing::GuidanceSetpoint, vtol::TransitionSetpoint, multicopter::LocalFrameAccelerationSetpoint, surface_vehicle::LocalFramePositionSetpoint, surface_vehicle::GlobalFramePositionSetpoint, surface_vehicle::SpeedAttitudeSetpoint, surface_vehicle::SpeedRateSetpoint, surface_vehicle::ThrustAttitudeSetpoint, surface_vehicle::ThrustRateSetpoint > Setpoint
Type alias for representing various types of setpoints.
Definition control.hpp:86

Constructor & Destructor Documentation

◆ SpeedAttitudeSetpoint()

auterion::surface_vehicle::SpeedAttitudeSetpoint::SpeedAttitudeSetpoint ( float  speed_m_s,
float  heading_rad 
)
inline
Parameters
speed_m_sSpeed along the body x axis [m/s]. Negative drives in reverse.
heading_radHeading in the local ENU frame [rad]. 0 is East, positive is counter-clockwise.

The documentation for this class was generated from the following file: