Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
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
Baitboat
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
Loading
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()
}
// if failsafe_throttle is 2 (i.e. FS_THR_ENABLED_CONTINUE_MISSION) no need to do anything
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
:
// 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
)
{
...
...
@@ -120,6 +137,13 @@ static void failsafe_battery_event(void)
set_mode
(
LAND
);
}
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
:
// set mode to RTL or LAND
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