Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Arming: can specify any Proximity failsafe area #10250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ArduCopter/AP_Arming.cpp
Expand Up @@ -490,8 +490,8 @@ bool AP_Arming_Copter::pre_arm_proximity_check(bool display_failure)
float angle_deg, distance;
if (copter.avoid.proximity_avoidance_enabled() && copter.g2.proximity.get_closest_object(angle_deg, distance)) {
// display error if something is within 60cm
if (distance <= 0.6f) {
check_failed(ARMING_CHECK_PARAMETERS, display_failure, "Proximity %d deg, %4.2fm", (int)angle_deg, (double)distance);
if (distance <= _obstacle_distance / 100.0f) {
check_failed(ARMING_CHECK_PARAMETERS, display_failure, "Proximity %d deg, %5.2fm", (int)angle_deg, (double)distance);
return false;
}
}
Expand Down
8 changes: 8 additions & 0 deletions libraries/AP_Arming/AP_Arming.cpp
Expand Up @@ -88,6 +88,14 @@ const AP_Param::GroupInfo AP_Arming::var_info[] = {
// @User: Advanced
AP_GROUPINFO("MIS_ITEMS", 7, AP_Arming, _required_mission_items, 0),

// @Param: OBS_DIST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call it PRX_DIST and change it to meters.

// @DisplayName: Obstacle detection distance
// @Description: Define dangerous zone from vehicle
// @Units: cm
// @Range: 60 2000
// @User: Standard
AP_GROUPINFO("OBS_DIST", 8, AP_Arming, _obstacle_distance, 60),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a value of 0 disables the check?


// index 4 was VOLT_MIN, moved to AP_BattMonitor
AP_GROUPEND
};
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_Arming/AP_Arming.h
Expand Up @@ -84,6 +84,7 @@ class AP_Arming {
AP_Float accel_error_threshold;
AP_Int8 _rudder_arming;
AP_Int32 _required_mission_items;
AP_Int16 _obstacle_distance; // Obstacle detection distance

// internal members
bool armed:1;
Expand Down