forked from Archive/PX4-Autopilot
navigator: Use the controller radius also as lower bound for mission items
This commit is contained in:
parent
0f3438eb17
commit
b2a694f71d
|
@ -123,12 +123,12 @@ MissionBlock::is_mission_item_reached()
|
|||
* Therefore the item is marked as reached once the system reaches the loiter
|
||||
* radius (+ some margin). Time inside and turn count is handled elsewhere.
|
||||
*/
|
||||
if (dist >= 0.0f && dist <= _mission_item.loiter_radius * 1.2f) {
|
||||
if (dist >= 0.0f && dist <= _navigator->get_acceptance_radius(_mission_item.loiter_radius * 1.2f)) {
|
||||
_waypoint_position_reached = true;
|
||||
}
|
||||
} else {
|
||||
/* for normal mission items used their acceptance radius */
|
||||
if (dist >= 0.0f && dist <= _mission_item.acceptance_radius) {
|
||||
if (dist >= 0.0f && dist <= _navigator->get_acceptance_radius(_mission_item.acceptance_radius)) {
|
||||
_waypoint_position_reached = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,22 @@ public:
|
|||
Geofence& get_geofence() { return _geofence; }
|
||||
bool get_can_loiter_at_sp() { return _can_loiter_at_sp; }
|
||||
float get_loiter_radius() { return _param_loiter_radius.get(); }
|
||||
|
||||
/**
|
||||
* Get the acceptance radius
|
||||
*
|
||||
* @return the distance at which the next waypoint should be used
|
||||
*/
|
||||
float get_acceptance_radius();
|
||||
|
||||
/**
|
||||
* Get the acceptance radius given the mission item preset radius
|
||||
*
|
||||
* @param mission_item_radius the radius to use in case the controller-derived radius is smaller
|
||||
*
|
||||
* @return the distance at which the next waypoint should be used
|
||||
*/
|
||||
float get_acceptance_radius(float mission_item_radius);
|
||||
int get_mavlink_fd() { return _mavlink_fd; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -574,7 +574,13 @@ Navigator::publish_position_setpoint_triplet()
|
|||
float
|
||||
Navigator::get_acceptance_radius()
|
||||
{
|
||||
float radius = _param_acceptance_radius.get();
|
||||
return get_acceptance_radius(_param_acceptance_radius.get());
|
||||
}
|
||||
|
||||
float
|
||||
Navigator::get_acceptance_radius(float mission_item_radius)
|
||||
{
|
||||
float radius = mission_item_radius;
|
||||
|
||||
if (hrt_elapsed_time(&_nav_caps.timestamp) < 1000000) {
|
||||
if (_nav_caps.turn_distance > radius) {
|
||||
|
|
Loading…
Reference in New Issue