Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Ardupilot
Commits
e5cc16b4
Commit
e5cc16b4
authored
11 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
Copter: radio, batt failsafe disarm if copter is landed in Loiter or AltHold
parent
b66beff2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ArduCopter/events.pde
+24
-0
24 additions, 0 deletions
ArduCopter/events.pde
with
24 additions
and
0 deletions
ArduCopter/events.pde
+
24
−
0
View file @
e5cc16b4
...
@@ -48,6 +48,23 @@ static void failsafe_radio_on_event()
...
@@ -48,6 +48,23 @@ static void failsafe_radio_on_event()
}
}
// if failsafe_throttle is 2 (i.e. FS_THR_ENABLED_CONTINUE_MISSION) no need to do anything
// if failsafe_throttle is 2 (i.e. FS_THR_ENABLED_CONTINUE_MISSION) no need to do anything
break
;
break
;
case
LOITER
:
case
ALT_HOLD
:
// if landed with throttle at zero disarm, otherwise do the regular thing
if
(
g
.
rc_3
.
control_in
==
0
&&
ap
.
land_complete
)
{
init_disarm_motors
();
}
else
if
(
g
.
failsafe_throttle
==
FS_THR_ENABLED_ALWAYS_LAND
)
{
// if failsafe_throttle is 3 (i.e. FS_THR_ENABLED_ALWAYS_LAND) land immediately
set_mode
(
LAND
);
}
else
if
(
home_distance
>
wp_nav
.
get_waypoint_radius
())
{
if
(
!
set_mode
(
RTL
))
{
set_mode
(
LAND
);
}
}
else
{
// We have no GPS or are very close to home so we will land
set_mode
(
LAND
);
}
break
;
case
LAND
:
case
LAND
:
// continue to land if battery failsafe is also active otherwise fall through to default handling
// continue to land if battery failsafe is also active otherwise fall through to default handling
if
(
g
.
failsafe_battery_enabled
==
FS_BATT_LAND
&&
failsafe
.
battery
)
{
if
(
g
.
failsafe_battery_enabled
==
FS_BATT_LAND
&&
failsafe
.
battery
)
{
...
@@ -120,6 +137,13 @@ static void failsafe_battery_event(void)
...
@@ -120,6 +137,13 @@ static void failsafe_battery_event(void)
set_mode
(
LAND
);
set_mode
(
LAND
);
}
}
break
;
break
;
case
LOITER
:
case
ALT_HOLD
:
// if landed with throttle at zero disarm, otherwise fall through to default handling
if
(
g
.
rc_3
.
control_in
==
0
&&
ap
.
land_complete
)
{
init_disarm_motors
();
break
;
}
default
:
default
:
// set mode to RTL or LAND
// set mode to RTL or LAND
if
(
g
.
failsafe_battery_enabled
==
FS_BATT_RTL
&&
home_distance
>
wp_nav
.
get_waypoint_radius
())
{
if
(
g
.
failsafe_battery_enabled
==
FS_BATT_RTL
&&
home_distance
>
wp_nav
.
get_waypoint_radius
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment