PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <ManualVelocitySmoothingZ.hpp>
Public Member Functions | |
ManualVelocitySmoothingZ ()=default | |
~ManualVelocitySmoothingZ ()=default | |
void | reset (float accel, float vel, float pos) |
void | update (float dt, float velocity_target) |
void | setVelSpFeedback (const float fb) |
void | setMaxJerk (const float max_jerk) |
void | setMaxAccelUp (const float max_accel_up) |
void | setMaxAccelDown (const float max_accel_down) |
void | setMaxVelUp (const float max_vel_up) |
void | setMaxVelDown (const float max_vel_down) |
float | getCurrentJerk () const |
float | getCurrentAcceleration () const |
void | setCurrentVelocity (const float vel) |
float | getCurrentVelocity () const |
void | setCurrentPosition (const float pos) |
float | getCurrentPosition () const |
void | setCurrentPositionEstimate (float pos) |
Private Member Functions | |
void | resetPositionLock () |
void | updateTrajectories (float dt) |
void | updateTrajConstraints (float vel_target) |
void | checkPositionLock (float velocity_target) |
void | updateTrajDurations (float velocity_target) |
Private Attributes | |
VelocitySmoothing | _trajectory |
Trajectory in z direction. More... | |
bool | _position_lock_active {false} |
float | _position_setpoint_locked |
float | _velocity_setpoint_feedback |
float | _position_estimate |
struct { | |
float j | |
float a | |
float v | |
float x | |
} | _state |
float | _max_accel_up {0.f} |
float | _max_accel_down {0.f} |
float | _max_vel_up {0.f} |
float | _max_vel_down {0.f} |
Definition at line 43 of file ManualVelocitySmoothingZ.hpp.
|
default |
|
default |
|
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 ManualVelocitySmoothingZ.cpp.
References _position_estimate, _position_lock_active, _position_setpoint_locked, _state, _trajectory, _velocity_setpoint_feedback, FLT_EPSILON, resetPositionLock(), VelocitySmoothing::setCurrentPosition(), and VelocitySmoothing::setCurrentVelocity().
Referenced by setCurrentPositionEstimate(), and update().
|
inline |
Definition at line 76 of file ManualVelocitySmoothingZ.hpp.
References _state.
|
inline |
Definition at line 75 of file ManualVelocitySmoothingZ.hpp.
References _state.
|
inline |
Definition at line 88 of file ManualVelocitySmoothingZ.hpp.
References _position_setpoint_locked.
|
inline |
Definition at line 82 of file ManualVelocitySmoothingZ.hpp.
References _state.
void ManualVelocitySmoothingZ::reset | ( | float | accel, |
float | vel, | ||
float | pos | ||
) |
Definition at line 39 of file ManualVelocitySmoothingZ.cpp.
References _trajectory, VelocitySmoothing::reset(), and resetPositionLock().
|
private |
Definition at line 46 of file ManualVelocitySmoothingZ.cpp.
References _position_lock_active, and _position_setpoint_locked.
Referenced by checkPositionLock(), reset(), and setCurrentPositionEstimate().
|
inline |
Definition at line 83 of file ManualVelocitySmoothingZ.hpp.
References _state, _trajectory, and VelocitySmoothing::setCurrentPosition().
|
inline |
Definition at line 89 of file ManualVelocitySmoothingZ.hpp.
References _position_estimate, checkPositionLock(), resetPositionLock(), updateTrajConstraints(), updateTrajDurations(), and updateTrajectories().
|
inline |
Definition at line 77 of file ManualVelocitySmoothingZ.hpp.
References _state, _trajectory, and VelocitySmoothing::setCurrentVelocity().
|
inline |
Definition at line 62 of file ManualVelocitySmoothingZ.hpp.
References _max_accel_down.
|
inline |
Definition at line 58 of file ManualVelocitySmoothingZ.hpp.
References _max_accel_up.
|
inline |
Definition at line 54 of file ManualVelocitySmoothingZ.hpp.
References _trajectory, and VelocitySmoothing::setMaxJerk().
|
inline |
Definition at line 70 of file ManualVelocitySmoothingZ.hpp.
References _max_vel_down.
|
inline |
Definition at line 66 of file ManualVelocitySmoothingZ.hpp.
References _max_vel_up.
|
inline |
Definition at line 52 of file ManualVelocitySmoothingZ.hpp.
References _velocity_setpoint_feedback.
void ManualVelocitySmoothingZ::update | ( | float | dt, |
float | velocity_target | ||
) |
Definition at line 52 of file ManualVelocitySmoothingZ.cpp.
References _trajectory, checkPositionLock(), VelocitySmoothing::updateDurations(), updateTrajConstraints(), and updateTrajectories().
|
private |
Definition at line 79 of file ManualVelocitySmoothingZ.cpp.
References _max_accel_down, _max_accel_up, _max_vel_down, _max_vel_up, _trajectory, f(), VelocitySmoothing::setMaxAccel(), and VelocitySmoothing::setMaxVel().
Referenced by setCurrentPositionEstimate(), and update().
|
private |
|
private |
Definition at line 69 of file ManualVelocitySmoothingZ.cpp.
References _state, _trajectory, VelocitySmoothing::getCurrentAcceleration(), VelocitySmoothing::getCurrentJerk(), VelocitySmoothing::getCurrentPosition(), VelocitySmoothing::getCurrentVelocity(), and VelocitySmoothing::updateTraj().
Referenced by setCurrentPositionEstimate(), and update().
|
private |
Definition at line 115 of file ManualVelocitySmoothingZ.hpp.
Referenced by setMaxAccelDown(), and updateTrajConstraints().
|
private |
Definition at line 114 of file ManualVelocitySmoothingZ.hpp.
Referenced by setMaxAccelUp(), and updateTrajConstraints().
|
private |
Definition at line 117 of file ManualVelocitySmoothingZ.hpp.
Referenced by setMaxVelDown(), and updateTrajConstraints().
|
private |
Definition at line 116 of file ManualVelocitySmoothingZ.hpp.
Referenced by setMaxVelUp(), and updateTrajConstraints().
|
private |
Definition at line 105 of file ManualVelocitySmoothingZ.hpp.
Referenced by checkPositionLock(), and setCurrentPositionEstimate().
|
private |
Definition at line 100 of file ManualVelocitySmoothingZ.hpp.
Referenced by checkPositionLock(), and resetPositionLock().
|
private |
Definition at line 102 of file ManualVelocitySmoothingZ.hpp.
Referenced by checkPositionLock(), getCurrentPosition(), and resetPositionLock().
struct { ... } ManualVelocitySmoothingZ::_state |
|
private |
Trajectory in z direction.
Definition at line 98 of file ManualVelocitySmoothingZ.hpp.
Referenced by checkPositionLock(), reset(), setCurrentPosition(), setCurrentVelocity(), setMaxJerk(), update(), updateTrajConstraints(), and updateTrajectories().
|
private |
Definition at line 104 of file ManualVelocitySmoothingZ.hpp.
Referenced by checkPositionLock(), and setVelSpFeedback().
float ManualVelocitySmoothingZ::a |
Definition at line 109 of file ManualVelocitySmoothingZ.hpp.
float ManualVelocitySmoothingZ::j |
Definition at line 108 of file ManualVelocitySmoothingZ.hpp.
float ManualVelocitySmoothingZ::v |
Definition at line 110 of file ManualVelocitySmoothingZ.hpp.
float ManualVelocitySmoothingZ::x |
Definition at line 111 of file ManualVelocitySmoothingZ.hpp.