PX4 Firmware
PX4 Autopilot Software http://px4.io
ManualVelocitySmoothingXY Class Referencefinal

#include <ManualVelocitySmoothingXY.hpp>

Collaboration diagram for ManualVelocitySmoothingXY:

Public Member Functions

 ManualVelocitySmoothingXY ()=default
 
 ~ManualVelocitySmoothingXY ()=default
 
void reset (const Vector2f &accel, const Vector2f &vel, const Vector2f &pos)
 
void update (float dt, const Vector2f &velocity_target)
 
void setVelSpFeedback (const Vector2f &fb)
 
void setMaxJerk (const float max_jerk)
 
float getMaxJerk () const
 
void setMaxAccel (const float max_accel)
 
float getMaxAccel () const
 
void setMaxVel (const float max_vel)
 
float getMaxVel () const
 
Vector2f getCurrentJerk () const
 
Vector2f getCurrentAcceleration () const
 
void setCurrentVelocity (const Vector2f &vel)
 
Vector2f getCurrentVelocity () const
 
void setCurrentPosition (const Vector2f &pos)
 
Vector2f getCurrentPosition () const
 
void setCurrentPositionEstimate (const Vector2f &pos)
 

Private Member Functions

void resetPositionLock ()
 
void updateTrajectories (float dt)
 
void checkPositionLock (const Vector2f &velocity_target)
 
void updateTrajDurations (const Vector2f &velocity_target)
 

Private Attributes

VelocitySmoothing _trajectory [2]
 Trajectory in x and y directions. More...
 
bool _position_lock_active {false}
 
Vector2f _position_setpoint_locked
 
Vector2f _velocity_setpoint_feedback
 
Vector2f _position_estimate
 
struct {
   Vector2f   j
 
   Vector2f   a
 
   Vector2f   v
 
   Vector2f   x
 
_state
 

Detailed Description

Definition at line 47 of file ManualVelocitySmoothingXY.hpp.

Constructor & Destructor Documentation

◆ ManualVelocitySmoothingXY()

ManualVelocitySmoothingXY::ManualVelocitySmoothingXY ( )
default

◆ ~ManualVelocitySmoothingXY()

ManualVelocitySmoothingXY::~ManualVelocitySmoothingXY ( )
default

Member Function Documentation

◆ checkPositionLock()

void ManualVelocitySmoothingXY::checkPositionLock ( const Vector2f velocity_target)
private

During a position lock -> position unlock transition, we have to make sure that the velocity setpoint is continuous. We know that the output of the position loop (part of the velocity setpoint) will suddenly become null and only the feedforward (generated by this flight task) will remain. This is why the previous input of the velocity controller is used to set current velocity of the trajectory.

Definition at line 91 of file ManualVelocitySmoothingXY.cpp.

References FLT_EPSILON, and matrix::Vector< Type, M >::length().

Referenced by setCurrentPositionEstimate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentAcceleration()

Vector2f ManualVelocitySmoothingXY::getCurrentAcceleration ( ) const
inline

Definition at line 80 of file ManualVelocitySmoothingXY.hpp.

References _state.

◆ getCurrentJerk()

Vector2f ManualVelocitySmoothingXY::getCurrentJerk ( ) const
inline

Definition at line 79 of file ManualVelocitySmoothingXY.hpp.

References _state.

◆ getCurrentPosition()

Vector2f ManualVelocitySmoothingXY::getCurrentPosition ( ) const
inline

Definition at line 97 of file ManualVelocitySmoothingXY.hpp.

References _position_setpoint_locked.

◆ getCurrentVelocity()

Vector2f ManualVelocitySmoothingXY::getCurrentVelocity ( ) const
inline

Definition at line 88 of file ManualVelocitySmoothingXY.hpp.

References _state.

◆ getMaxAccel()

float ManualVelocitySmoothingXY::getMaxAccel ( ) const
inline

Definition at line 70 of file ManualVelocitySmoothingXY.hpp.

References _trajectory, and VelocitySmoothing::getMaxAccel().

Here is the call graph for this function:

◆ getMaxJerk()

float ManualVelocitySmoothingXY::getMaxJerk ( ) const
inline

Definition at line 63 of file ManualVelocitySmoothingXY.hpp.

References _trajectory, and VelocitySmoothing::getMaxJerk().

Here is the call graph for this function:

◆ getMaxVel()

float ManualVelocitySmoothingXY::getMaxVel ( ) const
inline

Definition at line 77 of file ManualVelocitySmoothingXY.hpp.

References _trajectory, and VelocitySmoothing::getMaxVel().

Here is the call graph for this function:

◆ reset()

void ManualVelocitySmoothingXY::reset ( const Vector2f accel,
const Vector2f vel,
const Vector2f pos 
)

Definition at line 41 of file ManualVelocitySmoothingXY.cpp.

◆ resetPositionLock()

void ManualVelocitySmoothingXY::resetPositionLock ( )
private

Definition at line 50 of file ManualVelocitySmoothingXY.cpp.

Referenced by setCurrentPositionEstimate().

Here is the caller graph for this function:

◆ setCurrentPosition()

void ManualVelocitySmoothingXY::setCurrentPosition ( const Vector2f &  pos)
inline

Definition at line 90 of file ManualVelocitySmoothingXY.hpp.

References _state, _trajectory, and VelocitySmoothing::setCurrentPosition().

Here is the call graph for this function:

◆ setCurrentPositionEstimate()

void ManualVelocitySmoothingXY::setCurrentPositionEstimate ( const Vector2f &  pos)
inline

Definition at line 99 of file ManualVelocitySmoothingXY.hpp.

References _position_estimate, checkPositionLock(), resetPositionLock(), updateTrajDurations(), and updateTrajectories().

Here is the call graph for this function:

◆ setCurrentVelocity()

void ManualVelocitySmoothingXY::setCurrentVelocity ( const Vector2f &  vel)
inline

Definition at line 82 of file ManualVelocitySmoothingXY.hpp.

References _state, _trajectory, and VelocitySmoothing::setCurrentVelocity().

Here is the call graph for this function:

◆ setMaxAccel()

void ManualVelocitySmoothingXY::setMaxAccel ( const float  max_accel)
inline

Definition at line 65 of file ManualVelocitySmoothingXY.hpp.

References _trajectory, and VelocitySmoothing::setMaxAccel().

Here is the call graph for this function:

◆ setMaxJerk()

void ManualVelocitySmoothingXY::setMaxJerk ( const float  max_jerk)
inline

Definition at line 58 of file ManualVelocitySmoothingXY.hpp.

References _trajectory, and VelocitySmoothing::setMaxJerk().

Here is the call graph for this function:

◆ setMaxVel()

void ManualVelocitySmoothingXY::setMaxVel ( const float  max_vel)
inline

Definition at line 72 of file ManualVelocitySmoothingXY.hpp.

References _trajectory, and VelocitySmoothing::setMaxVel().

Here is the call graph for this function:

◆ setVelSpFeedback()

void ManualVelocitySmoothingXY::setVelSpFeedback ( const Vector2f &  fb)
inline

Definition at line 56 of file ManualVelocitySmoothingXY.hpp.

References _velocity_setpoint_feedback.

◆ update()

void ManualVelocitySmoothingXY::update ( float  dt,
const Vector2f velocity_target 
)

Definition at line 57 of file ManualVelocitySmoothingXY.cpp.

◆ updateTrajDurations()

void ManualVelocitySmoothingXY::updateTrajDurations ( const Vector2f velocity_target)
private

Definition at line 82 of file ManualVelocitySmoothingXY.cpp.

References VelocitySmoothing::timeSynchronization().

Referenced by setCurrentPositionEstimate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTrajectories()

void ManualVelocitySmoothingXY::updateTrajectories ( float  dt)
private

Definition at line 70 of file ManualVelocitySmoothingXY.cpp.

Referenced by setCurrentPositionEstimate().

Here is the caller graph for this function:

Member Data Documentation

◆ _position_estimate

Vector2f ManualVelocitySmoothingXY::_position_estimate
private

Definition at line 114 of file ManualVelocitySmoothingXY.hpp.

Referenced by setCurrentPositionEstimate().

◆ _position_lock_active

bool ManualVelocitySmoothingXY::_position_lock_active {false}
private

Definition at line 109 of file ManualVelocitySmoothingXY.hpp.

◆ _position_setpoint_locked

Vector2f ManualVelocitySmoothingXY::_position_setpoint_locked
private

Definition at line 111 of file ManualVelocitySmoothingXY.hpp.

Referenced by getCurrentPosition().

◆ _state

struct { ... } ManualVelocitySmoothingXY::_state

◆ _trajectory

VelocitySmoothing ManualVelocitySmoothingXY::_trajectory[2]
private

◆ _velocity_setpoint_feedback

Vector2f ManualVelocitySmoothingXY::_velocity_setpoint_feedback
private

Definition at line 113 of file ManualVelocitySmoothingXY.hpp.

Referenced by setVelSpFeedback().

◆ a

Vector2f ManualVelocitySmoothingXY::a

Definition at line 118 of file ManualVelocitySmoothingXY.hpp.

◆ j

Vector2f ManualVelocitySmoothingXY::j

Definition at line 117 of file ManualVelocitySmoothingXY.hpp.

◆ v

Vector2f ManualVelocitySmoothingXY::v

Definition at line 119 of file ManualVelocitySmoothingXY.hpp.

◆ x

Vector2f ManualVelocitySmoothingXY::x

Definition at line 120 of file ManualVelocitySmoothingXY.hpp.


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