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

Drive at a given forward speed while turning at a given rate. More...

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

Classes

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

Public Member Functions

 SpeedRateSetpoint (float speed_m_s, float heading_rate_rad_s)
 
SpeedRateSetpoint & withSpeed (float speed_m_s)
 Sets the speed along the body x axis [m/s]. Negative drives in reverse.
 
SpeedRateSetpoint & withHeadingRate (float heading_rate_rad_s)
 Sets the yaw rate [rad/s]. Positive turns left (counter-clockwise seen from above).
 
float getSpeed () const
 
float getHeadingRate () const
 

Detailed Description

Drive at a given forward speed while turning at a given rate.

The flight controller handles speed and turn rate control. Use it for joystick-like control, or when your own controller produces a turn rate from its own heading control.

Frames and units:

  • Speed is the speed along the body x axis (forward) [m/s]. Negative values drive in reverse.
  • Heading rate is the yaw rate about the up axis [rad/s]. Positive turns left (counter-clockwise seen from above). This is the same convention as the rest of the SDK.

Defaults:

  • Speed and heading rate default to 0, so an empty setpoint stops the vehicle without turning.

Example:

.withMaxHeadingRate(0.5f)});
mode.onUpdateSetpoint([&mode](float dt_s) -> auterion::Setpoint {
const auto input = mode.lastManualControlInput();
.withSpeed(2.f * input.throttle_input_normalized)
.withHeadingRate(-0.5f * input.yaw_input_normalized);
});
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 SpeedRateSetpoint.
Definition speed_rate_control.hpp:86
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_rate_control.hpp:94
Drive at a given forward speed while turning at a given rate.
Definition speed_rate_control.hpp:74
SpeedRateSetpoint & withHeadingRate(float heading_rate_rad_s)
Sets the yaw rate [rad/s]. Positive turns left (counter-clockwise seen from above).
Definition speed_rate_control.hpp:136
SpeedRateSetpoint & withSpeed(float speed_m_s)
Sets the speed along the body x axis [m/s]. Negative drives in reverse.
Definition speed_rate_control.hpp:128
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

◆ SpeedRateSetpoint()

auterion::surface_vehicle::SpeedRateSetpoint::SpeedRateSetpoint ( float  speed_m_s,
float  heading_rate_rad_s 
)
inline
Parameters
speed_m_sSpeed along the body x axis [m/s]. Negative drives in reverse.
heading_rate_rad_sYaw rate [rad/s]. Positive turns left.

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