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
@@ -122,7 +122,7 @@ bool FlightTaskOrbit::activate()
bool ret = FlightTaskManualAltitudeSmooth::activate();
_r = _radius_min;
_v = 1.f;
_center = Vector2f(_position.data());
_center = Vector2f(_position);
_center(0) -= _r;
// need a valid position and velocity
@@ -149,8 +149,8 @@ bool FlightTaskOrbit::update()
setVelocity(v);
// xy velocity to go around in a circle
Vector2f center_to_position = Vector2f(_position.data()) - _center;
Vector2f velocity_xy = Vector2f(-center_to_position(1), center_to_position(0));
Vector2f center_to_position = Vector2f(_position) - _center;
Vector2f velocity_xy(-center_to_position(1), center_to_position(0));
velocity_xy = velocity_xy.unit_or_zero();
velocity_xy *= _v;