Skip to content
Snippets Groups Projects
Commit eba0bb38 authored by Martina Rivizzigno's avatar Martina Rivizzigno Committed by Lorenz Meier
Browse files

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

parent e037edd2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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 */
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment