Navigator: Obey minimum turn radius the controller is capabable of.

This commit is contained in:
Lorenz Meier 2015-06-05 10:16:51 +02:00
parent c7be59038c
commit 0f3438eb17
2 changed files with 15 additions and 1 deletions

View File

@ -144,7 +144,7 @@ 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(); }
float get_acceptance_radius() { return _param_acceptance_radius.get(); }
float get_acceptance_radius();
int get_mavlink_fd() { return _mavlink_fd; }
private:

View File

@ -571,6 +571,20 @@ Navigator::publish_position_setpoint_triplet()
}
}
float
Navigator::get_acceptance_radius()
{
float radius = _param_acceptance_radius.get();
if (hrt_elapsed_time(&_nav_caps.timestamp) < 1000000) {
if (_nav_caps.turn_distance > radius) {
radius = _nav_caps.turn_distance;
}
}
return radius;
}
void Navigator::add_fence_point(int argc, char *argv[])
{
_geofence.addPoint(argc, argv);