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
56768a8d
"README.md" did not exist on "9cb60e1cc9f7402418d7f0983d32e9ba38db01e4"
Commit
56768a8d
authored
11 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
Copter: add min alt check to parachute release
parent
b478c3a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ArduCopter/control_modes.pde
+2
-2
2 additions, 2 deletions
ArduCopter/control_modes.pde
ArduCopter/crash_check.pde
+32
-0
32 additions, 0 deletions
ArduCopter/crash_check.pde
with
34 additions
and
2 deletions
ArduCopter/control_modes.pde
+
2
−
2
View file @
56768a8d
...
...
@@ -378,7 +378,7 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
case
AUX_SWITCH_PARACHUTE_RELEASE
:
if
(
ch_flag
==
AUX_SWITCH_HIGH
)
{
parachute_release
();
parachute_
manual_
release
();
}
break
;
...
...
@@ -393,7 +393,7 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
break
;
case
AUX_SWITCH_HIGH
:
parachute
.
enabled
(
true
);
parachute_release
();
parachute_
manual_
release
();
break
;
}
#endif
...
...
This diff is collapsed.
Click to expand it.
ArduCopter/crash_check.pde
+
32
−
0
View file @
56768a8d
...
...
@@ -88,6 +88,9 @@ void parachute_check()
return
;
}
// call update to give parachute a chance to move servo or relay back to off position
parachute
.
update
();
// return immediately if motors are not armed or pilot's throttle is above zero
if
(
!
motors
.
armed
())
{
control_loss_count
=
0
;
...
...
@@ -100,6 +103,12 @@ void parachute_check()
return
;
}
// ensure we are above the minimum altitude above home
if
(
baro_alt
<
parachute
.
alt_min_cm
())
{
control_loss_count
=
0
;
return
;
}
// get desired lean angles
const
Vector3f
&
target_angle
=
attitude_control
.
angle_ef_targets
();
...
...
@@ -108,6 +117,11 @@ void parachute_check()
labs
(
ahrs
.
pitch_sensor
-
target_angle
.
y
)
>
CRASH_CHECK_ANGLE_DEVIATION_CD
)
{
control_loss_count
++
;
// don't let control_loss_count get too high
if
(
control_loss_count
>
PARACHUTE_CHECK_ITERATIONS_MAX
)
{
control_loss_count
=
PARACHUTE_CHECK_ITERATIONS_MAX
;
}
// record baro if we have just started losing control
if
(
control_loss_count
==
1
)
{
baro_alt_start
=
baro_alt
;
...
...
@@ -121,6 +135,9 @@ void parachute_check()
// check if loss of control for at least 1 second
}
else
if
(
control_loss_count
>=
PARACHUTE_CHECK_ITERATIONS_MAX
)
{
// reset control loss counter
control_loss_count
=
0
;
// release parachute
parachute_release
();
}
}
else
{
...
...
@@ -146,4 +163,19 @@ static void parachute_release()
// release parachute
parachute
.
release
();
}
// parachute_manual_release - trigger the release of the parachute, after performing some checks for pilot error
// checks if the vehicle is landed
static
void
parachute_manual_release
()
{
// do not release if we are landed or below the minimum altitude above home
if
(
ap
.
land_complete
||
baro_alt
<
parachute
.
alt_min_cm
())
{
// warn user of reason for failure
gcs_send_text_P
(
SEVERITY_HIGH
,
PSTR
(
"Parachute: Not Released"
));
return
;
}
// if we get this far release parachute
parachute_release
();
}
#endif // PARACHUTE == ENABLED
\ No newline at end of file
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