mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 04:07:35 +08:00
flight tasks: minor cleanup (avoid using *= for assignment)
This commit is contained in:
@@ -74,10 +74,10 @@ const vehicle_local_position_setpoint_s FlightTask::getPositionSetpoint()
|
||||
|
||||
void FlightTask::_resetSetpoints()
|
||||
{
|
||||
_position_setpoint *= NAN;
|
||||
_velocity_setpoint *= NAN;
|
||||
_acceleration_setpoint *= NAN;
|
||||
_thrust_setpoint *= NAN;
|
||||
_position_setpoint.setAll(NAN);
|
||||
_velocity_setpoint.setAll(NAN);
|
||||
_acceleration_setpoint.setAll(NAN);
|
||||
_thrust_setpoint.setAll(NAN);
|
||||
_yaw_setpoint = _yawspeed_setpoint = NAN;
|
||||
_desired_waypoint = FlightTask::empty_trajectory_waypoint;
|
||||
}
|
||||
|
||||
@@ -130,8 +130,7 @@ void FlightTaskManualPosition::_updateXYlock()
|
||||
} else if (PX4_ISFINITE(_position_setpoint(0)) && apply_brake) {
|
||||
// Position is locked but check if a reset event has happened.
|
||||
// We will shift the setpoints.
|
||||
if (_sub_vehicle_local_position->get().xy_reset_counter
|
||||
!= _reset_counter) {
|
||||
if (_sub_vehicle_local_position->get().xy_reset_counter != _reset_counter) {
|
||||
_position_setpoint(0) = _position(0);
|
||||
_position_setpoint(1) = _position(1);
|
||||
_reset_counter = _sub_vehicle_local_position->get().xy_reset_counter;
|
||||
@@ -147,6 +146,6 @@ void FlightTaskManualPosition::_updateXYlock()
|
||||
void FlightTaskManualPosition::_updateSetpoints()
|
||||
{
|
||||
FlightTaskManualAltitude::_updateSetpoints(); // needed to get yaw and setpoints in z-direction
|
||||
_thrust_setpoint *= NAN; // don't require any thrust setpoints
|
||||
_thrust_setpoint.setAll(NAN); // don't require any thrust setpoints
|
||||
_updateXYlock(); // check for position lock
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user