Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MAVProxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SASC
MAVProxy
Commits
0fecd1af
Commit
0fecd1af
authored
10 years ago
by
Michael Day
Committed by
Michael Day
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
param: Prompt auto updates when SYSID_THISMAV arrives from the plane.
parent
f3f4c0a9
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
MAVProxy/modules/mavproxy_param.py
+8
-2
8 additions, 2 deletions
MAVProxy/modules/mavproxy_param.py
with
8 additions
and
2 deletions
MAVProxy/modules/mavproxy_param.py
+
8
−
2
View file @
0fecd1af
...
@@ -37,7 +37,9 @@ class ParamState:
...
@@ -37,7 +37,9 @@ class ParamState:
added_new_parameter
=
False
added_new_parameter
=
False
if
m
.
param_count
!=
-
1
:
if
m
.
param_count
!=
-
1
:
self
.
mav_param_count
=
m
.
param_count
self
.
mav_param_count
=
m
.
param_count
self
.
mav_param
[
str
(
param_id
)]
=
m
.
param_value
self
.
mav_param
[
str
(
param_id
)]
=
m
.
param_value
if
self
.
fetch_one
>
0
:
if
self
.
fetch_one
>
0
:
self
.
fetch_one
-=
1
self
.
fetch_one
-=
1
print
(
"
%s = %f
"
%
(
param_id
,
m
.
param_value
))
print
(
"
%s = %f
"
%
(
param_id
,
m
.
param_value
))
...
@@ -50,7 +52,7 @@ class ParamState:
...
@@ -50,7 +52,7 @@ class ParamState:
self
.
fetch_check
(
master
,
force
=
True
)
self
.
fetch_check
(
master
,
force
=
True
)
def
fetch_check
(
self
,
master
,
force
=
False
):
def
fetch_check
(
self
,
master
,
force
=
False
):
'''
check for missing parameters periodically
'''
'''
check for missing parameters periodically
'''
if
self
.
param_period
.
trigger
()
or
force
:
if
self
.
param_period
.
trigger
()
or
force
:
if
master
is
None
:
if
master
is
None
:
return
return
...
@@ -281,7 +283,11 @@ class ParamModule(mp_module.MPModule):
...
@@ -281,7 +283,11 @@ class ParamModule(mp_module.MPModule):
def
mavlink_packet
(
self
,
m
):
def
mavlink_packet
(
self
,
m
):
'''
handle an incoming mavlink packet
'''
'''
handle an incoming mavlink packet
'''
self
.
pstate
.
handle_mavlink_packet
(
self
.
master
,
m
)
param_changed
=
self
.
pstate
.
handle_mavlink_packet
(
self
.
master
,
m
)
#hack to put plane's sysid in front of mode on prompt
if
param_changed
!=
None
and
param_changed
[
0
].
upper
()
==
"
SYSID_THISMAV
"
:
self
.
mpstate
.
rl
.
set_prompt
(
str
(
int
(
param_changed
[
1
]))
+
"
:
"
+
self
.
status
.
flightmode
+
"
>
"
)
def
idle_task
(
self
):
def
idle_task
(
self
):
'''
handle missing parameters
'''
'''
handle missing parameters
'''
...
...
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