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
122e2430
Commit
122e2430
authored
13 years ago
by
Jason Short
Browse files
Options
Downloads
Patches
Plain Diff
ACM: Flip code revision to fix bad orientation bug.
parent
2dfe3858
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/flip.pde
+8
-7
8 additions, 7 deletions
ArduCopter/flip.pde
with
8 additions
and
7 deletions
ArduCopter/flip.pde
+
8
−
7
View file @
122e2430
...
@@ -37,9 +37,9 @@ void roll_flip()
...
@@ -37,9 +37,9 @@ void roll_flip()
flip_state
++
;
flip_state
++
;
break
;
break
;
case
1
:
// Step 2 : Increase throttle to start maneuver
case
1
:
// Step 2 : Increase throttle to start maneuver
if
(
flip_timer
<
9
5
){
// .5 seconds
if
(
flip_timer
<
9
0
){
// .5 seconds
g
.
rc_1
.
servo_out
=
get_stabilize_roll
(
0
);
g
.
rc_1
.
servo_out
=
get_stabilize_roll
(
0
);
g
.
rc_3
.
servo_out
=
g
.
rc_3
.
control_in
+
AAP_THR_INC
;
g
.
rc_3
.
servo_out
=
g
.
throttle_cruise
+
AAP_THR_INC
;
flip_timer
++
;
flip_timer
++
;
}
else
{
}
else
{
flip_state
++
;
flip_state
++
;
...
@@ -51,7 +51,7 @@ void roll_flip()
...
@@ -51,7 +51,7 @@ void roll_flip()
if
(
ahrs
.
roll_sensor
<
4500
){
if
(
ahrs
.
roll_sensor
<
4500
){
// Roll control
// Roll control
g
.
rc_1
.
servo_out
=
AAP_ROLL_OUT
;
g
.
rc_1
.
servo_out
=
AAP_ROLL_OUT
;
g
.
rc_3
.
servo_out
=
g
.
rc_3
.
control_in
;
g
.
rc_3
.
servo_out
=
g
.
throttle_cruise
;
}
else
{
}
else
{
flip_state
++
;
flip_state
++
;
}
}
...
@@ -59,17 +59,18 @@ void roll_flip()
...
@@ -59,17 +59,18 @@ void roll_flip()
case
3
:
// Step 4 : CONTINUE ROLL (until we reach a certain angle [-45deg])
case
3
:
// Step 4 : CONTINUE ROLL (until we reach a certain angle [-45deg])
if
((
ahrs
.
roll_sensor
>=
4500
)
||
(
ahrs
.
roll_sensor
<
-
9000
)){
// we are in second half of roll
if
((
ahrs
.
roll_sensor
>=
4500
)
||
(
ahrs
.
roll_sensor
<
-
9000
)){
// we are in second half of roll
g
.
rc_1
.
servo_out
=
0
;
//g.rc_1.servo_out = 0;
g
.
rc_3
.
servo_out
=
g
.
rc_3
.
control_in
-
AAP_THR_DEC
;
g
.
rc_1
.
servo_out
=
get_rate_roll
(
40000
);
g
.
rc_3
.
servo_out
=
g
.
throttle_cruise
-
AAP_THR_DEC
;
}
else
{
}
else
{
flip_state
++
;
flip_state
++
;
}
}
break
;
break
;
case
4
:
// Step 5 : Increase throttle to stop the descend
case
4
:
// Step 5 : Increase throttle to stop the descend
if
(
flip_timer
<
9
0
){
// .5 seconds
if
(
flip_timer
<
12
0
){
// .5 seconds
g
.
rc_1
.
servo_out
=
get_stabilize_roll
(
0
);
g
.
rc_1
.
servo_out
=
get_stabilize_roll
(
0
);
g
.
rc_3
.
servo_out
=
g
.
rc_3
.
control_in
+
AAP_THR_INC
+
30
;
g
.
rc_3
.
servo_out
=
g
.
throttle_cruise
+
g
.
throttle_cruise
/
2
;
flip_timer
++
;
flip_timer
++
;
}
else
{
}
else
{
flip_state
++
;
flip_state
++
;
...
...
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