|
Firmware
|
Core Position-Control for MC. More...
#include <PositionControl.hpp>
Public Member Functions | |
| PositionControl (ModuleParams *parent) | |
| void | overwriteParams () |
| Overwrites certain parameters. More... | |
| void | updateState (const PositionControlStates &states) |
| Update the current vehicle state. More... | |
| bool | updateSetpoint (const vehicle_local_position_setpoint_s &setpoint) |
| Update the desired setpoints. More... | |
| void | updateConstraints (const vehicle_constraints_s &constraints) |
| Set constraints that are stricter than the global limits. More... | |
| void | generateThrustYawSetpoint (const float dt) |
| Apply P-position and PID-velocity controller that updates the member thrust, yaw- and yawspeed-setpoints. More... | |
| void | resetIntegralXY () |
| Set the integral term in xy to 0. More... | |
| void | resetIntegralZ () |
| Set the integral term in z to 0. More... | |
| const matrix::Vector3f & | getThrustSetpoint () |
| Get the. More... | |
| const float & | getYawSetpoint () |
| Get the. More... | |
| const float & | getYawspeedSetpoint () |
| Get the. More... | |
| const matrix::Vector3f | getVelSp () |
| Get the. More... | |
| const matrix::Vector3f | getPosSp () |
| Get the. More... | |
Public Member Functions inherited from ModuleParams | |
| ModuleParams (ModuleParams *parent) | |
| void | setParent (ModuleParams *parent) |
| Sets the parent module. More... | |
| ModuleParams (const ModuleParams &)=delete | |
| ModuleParams & | operator= (const ModuleParams &)=delete |
| ModuleParams (ModuleParams &&)=delete | |
| ModuleParams & | operator= (ModuleParams &&)=delete |
Public Member Functions inherited from ListNode< ModuleParams *> | |
| void | setSibling (ModuleParams * sibling) |
| const ModuleParams * | getSibling () const |
Protected Member Functions | |
| void | updateParams () override |
| Call this method whenever the module gets a parameter change notification. More... | |
Protected Member Functions inherited from ModuleParams | |
| virtual void | updateParamsImpl () |
| The implementation for this is generated with the macro DEFINE_PARAMETERS() | |
Additional Inherited Members | |
Protected Attributes inherited from ListNode< ModuleParams *> | |
| ModuleParams * | _sibling |
Core Position-Control for MC.
This class contains P-controller for position and PID-controller for velocity. Inputs: vehicle position/velocity/yaw desired set-point position/velocity/thrust/yaw/yaw-speed constraints that are stricter than global limits Output thrust vector and a yaw-setpoint
If there is a position and a velocity set-point present, then the velocity set-point is used as feed-forward. If feed-forward is active, then the velocity component of the P-controller output has priority over the feed-forward component.
A setpoint that is NAN is considered as not set. If there is a position/velocity- and thrust-setpoint present, then the thrust-setpoint is ommitted and recomputed from position-velocity-PID-loop.
| void PositionControl::generateThrustYawSetpoint | ( | const float | dt | ) |
Apply P-position and PID-velocity controller that updates the member thrust, yaw- and yawspeed-setpoints.
| dt | the delta-time |
|
inline |
Get the.
|
inline |
Get the.
|
inline |
Get the.
|
inline |
Get the.
|
inline |
Get the.
| void PositionControl::overwriteParams | ( | ) |
Overwrites certain parameters.
Overwrites are required for unit-conversion. This method should only be called if parameters have been updated.
|
inline |
Set the integral term in xy to 0.
|
inline |
Set the integral term in z to 0.
| void PositionControl::updateConstraints | ( | const vehicle_constraints_s & | constraints | ) |
Set constraints that are stricter than the global limits.
| constraints | a PositionControl structure with supported constraints |
|
overrideprotectedvirtual |
Call this method whenever the module gets a parameter change notification.
It will automatically call updateParams() for all children, which then call updateParamsImpl().
Reimplemented from ModuleParams.
| bool PositionControl::updateSetpoint | ( | const vehicle_local_position_setpoint_s & | setpoint | ) |
Update the desired setpoints.
| setpoint | a vehicle_local_position_setpoint_s structure |
| void PositionControl::updateState | ( | const PositionControlStates & | states | ) |
Update the current vehicle state.
| PositionControlStates | structure |
1.8.12