mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:43:34 +08:00
FlightTaskManualAltitude: thrust along xy depends on thrust along z direction
This commit is contained in:
committed by
Beat Küng
parent
157814b710
commit
3d591f4f8c
@@ -88,7 +88,22 @@ void FlightTaskManualAltitude::_updateZsetpoints()
|
||||
|
||||
void FlightTaskManualAltitude::_updateSetpoints()
|
||||
{
|
||||
FlightTaskManualStabilized::_updateSetpoints(); // get yaw and thrust setpoints
|
||||
FlightTaskManualStabilized::_updateSetpoints(); // get yaw setpoint
|
||||
/* Thrust in xy are extracted directly from stick inputs. A magnitude of
|
||||
* 1 means that maximum thrust along xy is required. A magnitude of 0 means no
|
||||
* thrust along xy is required. The maximum thrust along xy depends on the thrust
|
||||
* setpoint along z-direction, which is computed in PositionControl.cpp.
|
||||
*/
|
||||
matrix::Vector3f sp{_sticks(0), _sticks(1), 0.0f};
|
||||
sp = (matrix::Dcmf(matrix::Eulerf(0.0f, 0.0f, _yaw)) * sp);
|
||||
|
||||
if (sp.length() > 1.0f) {
|
||||
sp.normalize();
|
||||
}
|
||||
|
||||
_thr_sp(0) = sp(0);
|
||||
_thr_sp(1) = sp(1);
|
||||
|
||||
_updateZsetpoints(); // get z setpoints
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user