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
65ed77e8
Commit
65ed77e8
authored
10 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
Copter: ensure motors don't stop during flip
parent
e1e010c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ArduCopter/control_flip.pde
+9
-3
9 additions, 3 deletions
ArduCopter/control_flip.pde
with
9 additions
and
3 deletions
ArduCopter/control_flip.pde
+
9
−
3
View file @
65ed77e8
...
@@ -141,7 +141,9 @@ static void flip_run()
...
@@ -141,7 +141,9 @@ static void flip_run()
// between 45deg ~ -90deg request 400deg/sec roll
// between 45deg ~ -90deg request 400deg/sec roll
attitude_control
.
rate_bf_roll_pitch_yaw
(
FLIP_ROTATION_RATE
*
flip_roll_dir
,
0.0
,
0.0
);
attitude_control
.
rate_bf_roll_pitch_yaw
(
FLIP_ROTATION_RATE
*
flip_roll_dir
,
0.0
,
0.0
);
// decrease throttle
// decrease throttle
throttle_out
-=
FLIP_THR_DEC
;
if
(
throttle_out
>=
g
.
throttle_min
)
{
throttle_out
=
max
(
throttle_out
-
FLIP_THR_DEC
,
g
.
throttle_min
);
}
// beyond -90deg move on to recovery
// beyond -90deg move on to recovery
if
((
flip_angle
<
4500
)
&&
(
flip_angle
>
-
9000
))
{
if
((
flip_angle
<
4500
)
&&
(
flip_angle
>
-
9000
))
{
...
@@ -153,7 +155,9 @@ static void flip_run()
...
@@ -153,7 +155,9 @@ static void flip_run()
// between 45deg ~ -90deg request 400deg/sec pitch
// between 45deg ~ -90deg request 400deg/sec pitch
attitude_control
.
rate_bf_roll_pitch_yaw
(
0.0
,
FLIP_ROTATION_RATE
*
flip_pitch_dir
,
0.0
);
attitude_control
.
rate_bf_roll_pitch_yaw
(
0.0
,
FLIP_ROTATION_RATE
*
flip_pitch_dir
,
0.0
);
// decrease throttle
// decrease throttle
throttle_out
-=
FLIP_THR_DEC
;
if
(
throttle_out
>=
g
.
throttle_min
)
{
throttle_out
=
max
(
throttle_out
-
FLIP_THR_DEC
,
g
.
throttle_min
);
}
// check roll for inversion
// check roll for inversion
if
((
labs
(
ahrs
.
roll_sensor
)
>
9000
)
&&
(
flip_angle
>
4500
))
{
if
((
labs
(
ahrs
.
roll_sensor
)
>
9000
)
&&
(
flip_angle
>
4500
))
{
...
@@ -165,7 +169,9 @@ static void flip_run()
...
@@ -165,7 +169,9 @@ static void flip_run()
// between 45deg ~ -90deg request 400deg/sec pitch
// between 45deg ~ -90deg request 400deg/sec pitch
attitude_control
.
rate_bf_roll_pitch_yaw
(
0.0
,
FLIP_ROTATION_RATE
*
flip_pitch_dir
,
0.0
);
attitude_control
.
rate_bf_roll_pitch_yaw
(
0.0
,
FLIP_ROTATION_RATE
*
flip_pitch_dir
,
0.0
);
// decrease throttle
// decrease throttle
throttle_out
-=
FLIP_THR_DEC
;
if
(
throttle_out
>=
g
.
throttle_min
)
{
throttle_out
=
max
(
throttle_out
-
FLIP_THR_DEC
,
g
.
throttle_min
);
}
// check roll for inversion
// check roll for inversion
if
((
labs
(
ahrs
.
roll_sensor
)
<
9000
)
&&
(
flip_angle
>
-
4500
))
{
if
((
labs
(
ahrs
.
roll_sensor
)
<
9000
)
&&
(
flip_angle
>
-
4500
))
{
...
...
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