Refactor: Use new matrix::Vector2f constructor

This commit is contained in:
Matthias Grob
2018-10-01 11:39:43 +02:00
committed by Daniel Agar
parent ada0179cda
commit bee6a6b8b0
13 changed files with 98 additions and 95 deletions
@@ -40,7 +40,7 @@
using namespace matrix;
FlightTaskManualPositionSmooth::FlightTaskManualPositionSmooth() :
_smoothingXY(this, matrix::Vector2f(&_velocity(0))),
_smoothingXY(this, Vector2f(_velocity)),
_smoothingZ(this, _velocity(2), _sticks(2))
{}
@@ -50,8 +50,8 @@ void FlightTaskManualPositionSmooth::_updateSetpoints()
FlightTaskManualPosition::_updateSetpoints();
/* Smooth velocity setpoint in xy.*/
matrix::Vector2f vel(&_velocity(0));
Vector2f vel_sp_xy = Vector2f(&_velocity_setpoint(0));
Vector2f vel(_velocity);
Vector2f vel_sp_xy(_velocity_setpoint);
_smoothingXY.updateMaxVelocity(_constraints.speed_xy);
_smoothingXY.smoothVelocity(vel_sp_xy, vel, _yaw, _yawspeed_setpoint, _deltatime);
_velocity_setpoint(0) = vel_sp_xy(0);