mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 14:53:34 +08:00
Refactor: Use new matrix::Vector2f constructor
This commit is contained in:
committed by
Daniel Agar
parent
ada0179cda
commit
bee6a6b8b0
@@ -78,7 +78,7 @@ void FlightTaskManualPosition::_scaleSticks()
|
||||
FlightTaskManualAltitude::_scaleSticks();
|
||||
|
||||
/* Constrain length of stick inputs to 1 for xy*/
|
||||
Vector2f stick_xy(_sticks_expo(0), _sticks_expo(1));
|
||||
Vector2f stick_xy(&_sticks_expo(0));
|
||||
|
||||
float mag = math::constrain(stick_xy.length(), 0.0f, 1.0f);
|
||||
|
||||
@@ -119,8 +119,8 @@ void FlightTaskManualPosition::_scaleSticks()
|
||||
void FlightTaskManualPosition::_updateXYlock()
|
||||
{
|
||||
/* If position lock is not active, position setpoint is set to NAN.*/
|
||||
const float vel_xy_norm = Vector2f(&_velocity(0)).length();
|
||||
const bool apply_brake = Vector2f(&_velocity_setpoint(0)).length() < FLT_EPSILON;
|
||||
const float vel_xy_norm = Vector2f(_velocity).length();
|
||||
const bool apply_brake = Vector2f(_velocity_setpoint).length() < FLT_EPSILON;
|
||||
const bool stopped = (MPC_HOLD_MAX_XY.get() < FLT_EPSILON || vel_xy_norm < MPC_HOLD_MAX_XY.get());
|
||||
|
||||
if (apply_brake && stopped && !PX4_ISFINITE(_position_setpoint(0))) {
|
||||
|
||||
Reference in New Issue
Block a user