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
fe9705ad
Commit
fe9705ad
authored
13 years ago
by
Jason Short
Browse files
Options
Downloads
Patches
Plain Diff
Checking for climb rate
parent
01420440
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
Tools/autotest/common.py
+7
-1
7 additions, 1 deletion
Tools/autotest/common.py
with
7 additions
and
1 deletion
Tools/autotest/common.py
+
7
−
1
View file @
fe9705ad
...
@@ -63,12 +63,18 @@ def current_location(mav):
...
@@ -63,12 +63,18 @@ def current_location(mav):
mav
.
messages
[
'
VFR_HUD
'
].
alt
)
mav
.
messages
[
'
VFR_HUD
'
].
alt
)
def
wait_altitude
(
mav
,
alt_min
,
alt_max
,
timeout
=
30
):
def
wait_altitude
(
mav
,
alt_min
,
alt_max
,
timeout
=
30
):
climb_rate
=
0
previous_alt
=
0
'''
wait for a given altitude range
'''
'''
wait for a given altitude range
'''
tstart
=
time
.
time
()
tstart
=
time
.
time
()
print
(
"
Waiting for altitude between %u and %u
"
%
(
alt_min
,
alt_max
))
print
(
"
Waiting for altitude between %u and %u
"
%
(
alt_min
,
alt_max
))
while
time
.
time
()
<
tstart
+
timeout
:
while
time
.
time
()
<
tstart
+
timeout
:
m
=
mav
.
recv_match
(
type
=
'
VFR_HUD
'
,
blocking
=
True
)
m
=
mav
.
recv_match
(
type
=
'
VFR_HUD
'
,
blocking
=
True
)
print
(
"
Altitude %u
"
%
m
.
alt
)
climb_rate
=
m
.
alt
-
previous_alt
previous_alt
=
m
.
alt
print
(
"
Altitude %u, rate: %u
"
%
(
m
.
alt
,
climb_rate
))
if
abs
(
climb_rate
)
>
0
:
tstart
=
time
.
time
();
if
m
.
alt
>=
alt_min
and
m
.
alt
<=
alt_max
:
if
m
.
alt
>=
alt_min
and
m
.
alt
<=
alt_max
:
return
True
return
True
print
(
"
Failed to attain altitude range
"
)
print
(
"
Failed to attain altitude range
"
)
...
...
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