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

Drive to a 2D position in the local frame. More...

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

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

Classes

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

Public Member Functions

 LocalFramePositionSetpoint (const Eigen::Vector2f &position_en_m)
 
LocalFramePositionSetpoint & withPosition (const Eigen::Vector2f &position_en_m)
 Sets the target position (East, North) in the local frame [m].
 
LocalFramePositionSetpoint & withPosition (const Eigen::Vector3f &position_enu_m)
 Sets the target position from a 3D local ENU position [m]. The height (z) is ignored, so you can pass auterion::LocalPosition::position_enu_m directly.
 
LocalFramePositionSetpoint & withStartPosition (const Eigen::Vector2f &start_position_en_m)
 Sets the start of the line that the vehicle follows to the target (East, North) [m].
 
Eigen::Vector2f getPosition () const
 
std::optional< Eigen::Vector2f > getStartPosition () const
 
- Public Member Functions inherited from auterion::surface_vehicle::detail::PositionSetpointSpeedsBase< LocalFramePositionSetpoint >
LocalFramePositionSetpoint & withCruisingSpeed (float cruising_speed_m_s)
 Sets the speed to drive at on the way to the target [m/s].
 
LocalFramePositionSetpoint & 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 2D position in the local frame.

The vehicle turns towards the target and drives a straight line to it. The flight controller handles path tracking, speed and stopping. This is the easiest way to make a boat go somewhere. For targets given as latitude and longitude, use GlobalFramePositionSetpoint.

Frames and units:

  • Positions are in the local ENU frame [m], the same frame as auterion::LocalPosition::position_enu_m. Only x (East) and y (North) are used.
  • Speeds are in [m/s] along the path. A negative cruising speed drives to the target in reverse.

Defaults:

  • If no start position is set, the line starts at the vehicle's current position.
  • If no cruising speed is set, the value from Config is used. If that is not set either, the vehicle's maximum speed (PX4 parameter) is used.
  • If no arrival speed is set, the value from Config is used (0 m/s by default: stop at the target and hold position there).

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 buoy",
mode.onUpdateSetpoint([](float dt_s) -> auterion::Setpoint {
.withPosition(Eigen::Vector2f{50.f, 20.f})
});
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 LocalFramePositionSetpoint.
Definition local_frame_position_control.hpp:95
Drive to a 2D position in the local frame.
Definition local_frame_position_control.hpp:84
LocalFramePositionSetpoint & withPosition(const Eigen::Vector2f &position_en_m)
Sets the target position (East, North) in the local frame [m].
Definition local_frame_position_control.hpp:108
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
LocalFramePositionSetpoint & withCruisingSpeed(float cruising_speed_m_s)
Sets the speed to drive at on the way to the target [m/s].
Definition position_setpoint_common.hpp:89
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

◆ LocalFramePositionSetpoint()

auterion::surface_vehicle::LocalFramePositionSetpoint::LocalFramePositionSetpoint ( const Eigen::Vector2f &  position_en_m)
inlineexplicit
Parameters
position_en_mTarget position (East, North) in the local frame [m].

Member Function Documentation

◆ withStartPosition()

LocalFramePositionSetpoint & auterion::surface_vehicle::LocalFramePositionSetpoint::withStartPosition ( const Eigen::Vector2f &  start_position_en_m)
inline

Sets the start of the line that the vehicle follows to the target (East, North) [m].

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: