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::ThrustAttitudeSetpoint Class Reference

Drive with a given forward thrust while holding a heading. More...

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

Classes

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

Public Member Functions

 ThrustAttitudeSetpoint (float thrust, float heading_rad)
 
ThrustAttitudeSetpoint & withThrust (float thrust)
 Sets the normalized thrust along the body x axis [-], in [-1, 1]. Negative drives in reverse.
 
ThrustAttitudeSetpoint & withHeading (float heading_rad)
 Sets the heading in the local ENU frame [rad]. 0 is East, positive is counter-clockwise.
 
float getThrust () const
 
std::optional< float > getHeading () const
 

Detailed Description

Drive with a given forward thrust while holding a heading.

The flight controller handles heading control, the thrust is passed through without speed control. Use this if your own controller handles the speed, or for open-loop thrust commands, e.g. when no velocity estimate is available.

Frames and units:

  • Thrust is the normalized thrust along the body x axis (forward) [-]. It takes values in [-1, 1], negative values drive in reverse. Values outside this range are clamped.
  • 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:

  • Thrust defaults to 0.
  • 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 thrust drives the vehicle straight ahead.

Example:

auterion::Mode mode(sdk, "Follow line",
.withMaxThrust(0.6f)});
mode.onUpdateSetpoint([this](float dt_s) -> auterion::Setpoint {
.withThrust(computeThrust())
.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 ThrustAttitudeSetpoint.
Definition thrust_attitude_control.hpp:90
Config & withMaxThrust(float max_thrust)
Limits the absolute forward and reverse thrust [-], in [0, 1]. Unset means a limit of 1 (full thrust)...
Definition thrust_attitude_control.hpp:98
Drive with a given forward thrust while holding a heading.
Definition thrust_attitude_control.hpp:78
ThrustAttitudeSetpoint & withThrust(float thrust)
Sets the normalized thrust along the body x axis [-], in [-1, 1]. Negative drives in reverse.
Definition thrust_attitude_control.hpp:124
ThrustAttitudeSetpoint & withHeading(float heading_rad)
Sets the heading in the local ENU frame [rad]. 0 is East, positive is counter-clockwise.
Definition thrust_attitude_control.hpp:133
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

◆ ThrustAttitudeSetpoint()

auterion::surface_vehicle::ThrustAttitudeSetpoint::ThrustAttitudeSetpoint ( float  thrust,
float  heading_rad 
)
inline
Parameters
thrustNormalized thrust along the body x axis [-], in [-1, 1]. 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: