Skip to content

Commit

Permalink
FlightTaskOrbit: correct acceleration feed-forward
Browse files Browse the repository at this point in the history
The acceleration setpoint gets implicitly inherited from the altitude
flight task since PX4#14212. This feed-forward adds an unwanted
acceleration when the right stick is deflected. Instead I'm using it
to command the expected centripetal acceleration when flying
in a circle for better orbit tracking.
  • Loading branch information
MaEtUgR committed Jul 14, 2020
1 parent 5d43492 commit 762ade2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/flight_tasks/tasks/Orbit/FlightTaskOrbit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ void FlightTaskOrbit::generate_circle_setpoints(Vector2f center_to_position)
// xy velocity adjustment to stay on the radius distance
velocity_xy += (_r - center_to_position.norm()) * center_to_position.unit_or_zero();

_velocity_setpoint(0) = velocity_xy(0);
_velocity_setpoint(1) = velocity_xy(1);
_position_setpoint(0) = _position_setpoint(1) = NAN;
_velocity_setpoint.xy() = velocity_xy;
_acceleration_setpoint.xy() = -center_to_position.unit_or_zero() * _v * _v / _r;

// yawspeed feed-forward because we know the necessary angular rate
_yawspeed_setpoint = _v / _r;
Expand Down

0 comments on commit 762ade2

Please sign in to comment.