ObstacleAvoidance: fix comment, update failsafe position if one axis is NAN

This commit is contained in:
Martina Rivizzigno 2019-04-24 08:30:40 +02:00 committed by Lorenz Meier
parent e037edd2cc
commit eba0bb389a
2 changed files with 3 additions and 3 deletions

View File

@ -103,8 +103,8 @@ void ObstacleAvoidance::injectAvoidanceSetpoints(Vector3f &pos_sp, Vector3f &vel
PX4_WARN("Obstacle Avoidance system failed, loitering");
_publishVehicleCmdDoLoiter();
if (!PX4_ISFINITE(_failsafe_position(0)) && !PX4_ISFINITE(_failsafe_position(1))
&& !PX4_ISFINITE(_failsafe_position(2))) {
if (!PX4_ISFINITE(_failsafe_position(0)) || !PX4_ISFINITE(_failsafe_position(1))
|| !PX4_ISFINITE(_failsafe_position(2))) {
// save vehicle position when entering failsafe
_failsafe_position = _position;
}

View File

@ -116,7 +116,7 @@ private:
orb_advert_t _pub_vehicle_command{nullptr}; /**< vehicle command do publication */
matrix::Vector3f _curr_wp = {}; /**< current position triplet */
matrix::Vector3f _position = {}; /**< current position triplet */
matrix::Vector3f _position = {}; /**< current vehicle position */
matrix::Vector3f _failsafe_position = {}; /**< vehicle position when entered in failsafe */
/**