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

Drive to a position given as latitude and longitude. More...

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

Inheritance diagram for auterion::surface_vehicle::GlobalFramePositionSetpoint:
auterion::surface_vehicle::detail::PositionSetpointSpeedsBase< GlobalFramePositionSetpoint >

Classes

class  Config
 Mode-wide defaults for GlobalFramePositionSetpoint. More...
 

Public Member Functions

 GlobalFramePositionSetpoint (const Eigen::Vector2d &position_lat_lon_deg)
 
GlobalFramePositionSetpoint & withPosition (const Eigen::Vector2d &position_lat_lon_deg)
 Sets the target latitude and longitude [deg].
 
GlobalFramePositionSetpoint & withPosition (const Eigen::Vector3d &position_lat_lon_alt)
 Sets the target from latitude [deg], longitude [deg] and altitude [m]. The altitude is ignored, so you can pass auterion::GlobalPosition::toEigenVector() directly.
 
GlobalFramePositionSetpoint & withStartPosition (const Eigen::Vector2d &start_position_lat_lon_deg)
 Sets the start of the line that the vehicle follows to the target, as latitude and longitude [deg].
 
Eigen::Vector2d getPosition () const
 
std::optional< Eigen::Vector2d > getStartPosition () const
 
- Public Member Functions inherited from auterion::surface_vehicle::detail::PositionSetpointSpeedsBase< GlobalFramePositionSetpoint >
GlobalFramePositionSetpoint & withCruisingSpeed (float cruising_speed_m_s)
 Sets the speed to drive at on the way to the target [m/s].
 
GlobalFramePositionSetpoint & withArrivalSpeed (float arrival_speed_m_s)
 Sets the speed the vehicle has when it reaches the target [m/s].
 
std::optional< float > getCruisingSpeed () const
 
std::optional< float > getArrivalSpeed () const
 

Detailed Description

Drive to a position given as latitude and longitude.

Same behavior as LocalFramePositionSetpoint, with the target (and optional start) given in global coordinates. The SDK converts them to the local frame using the reference point of the vehicle's local position estimate, and follows changes of that reference point.

Frames and units:

  • Positions are latitude and longitude [deg] (WGS84), the same as auterion::GlobalPosition. Altitude is not used.
  • Speeds are in [m/s] along the path. A negative cruising speed drives to the target in reverse.

Defaults: the same as LocalFramePositionSetpoint. If the vehicle has no local position reference yet, no setpoint is sent and an error is logged.

The target position is required. Returning a setpoint without a finite target position from auterion::Mode::onUpdateSetpoint throws std::invalid_argument.

Example:

auterion::Mode mode(sdk, "Go to dock",
mode.onUpdateSetpoint([](float dt_s) -> auterion::Setpoint {
.withPosition(Eigen::Vector2d{47.3977, 8.5456})
});
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 defaults for GlobalFramePositionSetpoint.
Definition global_frame_position_control.hpp:91
Drive to a position given as latitude and longitude.
Definition global_frame_position_control.hpp:80
GlobalFramePositionSetpoint & withPosition(const Eigen::Vector2d &position_lat_lon_deg)
Sets the target latitude and longitude [deg].
Definition global_frame_position_control.hpp:104
Derived & withDefaultCruisingSpeed(float cruising_speed_m_s)
Sets the default cruising speed [m/s]. Negative drives to the target in reverse. Unset means the vehi...
Definition position_setpoint_common.hpp:54
GlobalFramePositionSetpoint & withArrivalSpeed(float arrival_speed_m_s)
Sets the speed the vehicle has when it reaches the target [m/s].
Definition position_setpoint_common.hpp:100
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

◆ GlobalFramePositionSetpoint()

auterion::surface_vehicle::GlobalFramePositionSetpoint::GlobalFramePositionSetpoint ( const Eigen::Vector2d &  position_lat_lon_deg)
inlineexplicit
Parameters
position_lat_lon_degTarget latitude and longitude [deg].

Member Function Documentation

◆ withStartPosition()

GlobalFramePositionSetpoint & auterion::surface_vehicle::GlobalFramePositionSetpoint::withStartPosition ( const Eigen::Vector2d &  start_position_lat_lon_deg)
inline

Sets the start of the line that the vehicle follows to the target, as latitude and longitude [deg].

Use this to follow an exact track, e.g. a survey line, instead of the line from the current position. If not set, the line starts at the vehicle's current position.


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