Support gliding setpoints for autonomous soaring (#14643)

* Enable offboard gliding position setpoints

Adds a capability to make the vehicle glide when given position setpoints.

Gliding setpoints are enabled by setting POSITION_TARGET_TYPEMASK_Z_IGNORE, POSITION_TARGET_TYPEMASK_VZ_IGNORE,  POSITION_TARGET_TYPEMASK_AZ_IGNORE on the typemask of position setpoints.
Include zero cruising throttle
Invalid setpoints with nan

* Handle nans for curise_throttle
This commit is contained in:
JaeyoungLim
2020-09-14 10:56:29 +02:00
committed by GitHub
parent 8bc512dc93
commit 0592f6ba6e
5 changed files with 55 additions and 12 deletions
+2 -1
View File
@@ -1912,6 +1912,7 @@ bool Mission::position_setpoint_equal(const position_setpoint_s *p1, const posit
(p1->acceleration_is_force == p2->acceleration_is_force) &&
(fabsf(p1->acceptance_radius - p2->acceptance_radius) < FLT_EPSILON) &&
(fabsf(p1->cruising_speed - p2->cruising_speed) < FLT_EPSILON) &&
(fabsf(p1->cruising_throttle - p2->cruising_throttle) < FLT_EPSILON));
((fabsf(p1->cruising_throttle - p2->cruising_throttle) < FLT_EPSILON) || (!PX4_ISFINITE(p1->cruising_throttle)
&& !PX4_ISFINITE(p2->cruising_throttle))));
}
+2 -2
View File
@@ -240,7 +240,7 @@ public:
/**
* Set the target throttle
*/
void set_cruising_throttle(float throttle = -1.0f) { _mission_throttle = throttle; }
void set_cruising_throttle(float throttle = NAN) { _mission_throttle = throttle; }
/**
* Get the acceptance radius given the mission item preset radius
@@ -393,7 +393,7 @@ private:
float _mission_cruising_speed_mc{-1.0f};
float _mission_cruising_speed_fw{-1.0f};
float _mission_throttle{-1.0f};
float _mission_throttle{NAN};
// update subscriptions
void params_update();
+1 -1
View File
@@ -907,7 +907,7 @@ Navigator::get_cruising_throttle()
return _mission_throttle;
} else {
return -1.0f;
return NAN;
}
}