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
1f253c52
Commit
1f253c52
authored
13 years ago
by
rmackay9
Browse files
Options
Downloads
Patches
Plain Diff
ArduCopter - altitude hold - ensure throttle_avg is initialised from g.throttle_cruise parameter
parent
19981d48
No related branches found
Branches containing commit
Tags
ArduCopter-2.5.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ArduCopter/ArduCopter.pde
+5
-1
5 additions, 1 deletion
ArduCopter/ArduCopter.pde
with
5 additions
and
1 deletion
ArduCopter/ArduCopter.pde
+
5
−
1
View file @
1f253c52
...
...
@@ -1580,7 +1580,7 @@ void update_throttle_mode(void)
int16_t
throttle_out
;
#if AUTO_THROTTLE_HOLD != 0
static
float
throttle_avg
=
THROTTLE_CRUISE
;
static
float
throttle_avg
=
0
;
// this is initialised to g.throttle_cruise later
#endif
switch
(
throttle_mode
){
...
...
@@ -1598,6 +1598,10 @@ void update_throttle_mode(void)
#endif
#if AUTO_THROTTLE_HOLD != 0
// ensure throttle_avg has been initialised
if
(
throttle_avg
==
0
)
{
throttle_avg
=
g
.
throttle_cruise
;
}
// calc average throttle
if
((
g
.
rc_3
.
control_in
>
MINIMUM_THROTTLE
)
&&
abs
(
climb_rate
)
<
60
){
throttle_avg
=
throttle_avg
*
.98
+
(
float
)
g
.
rc_3
.
control_in
*
.02
;
...
...
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