Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d72185eb
Commit
d72185eb
authored
Feb 02, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PX4 config: Insist on correct throttle position before accepting RC config end
parent
bd14c408
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+25
-16
No files found.
src/ui/QGCPX4VehicleConfig.cc
View file @
d72185eb
...
@@ -422,22 +422,31 @@ void QGCPX4VehicleConfig::setTrimPositions()
...
@@ -422,22 +422,31 @@ void QGCPX4VehicleConfig::setTrimPositions()
rcTrim
[
i
]
=
1500
;
rcTrim
[
i
]
=
1500
;
}
}
bool
throttleDone
=
false
;
while
(
!
throttleDone
)
{
// Set trim to min if stick is close to min
// Set trim to min if stick is close to min
if
(
abs
(
rcValue
[
throttleMap
]
-
rcMin
[
throttleMap
])
<
100
)
{
if
(
abs
(
rcValue
[
throttleMap
]
-
rcMin
[
throttleMap
])
<
100
)
{
rcTrim
[
throttleMap
]
=
rcMin
[
throttleMap
];
// throttle
rcTrim
[
throttleMap
]
=
rcMin
[
throttleMap
];
// throttle
throttleDone
=
true
;
}
}
// Set trim to max if stick is close to max
// Set trim to max if stick is close to max
else
if
(
abs
(
rcValue
[
throttleMap
]
-
rcMax
[
throttleMap
])
<
100
)
{
else
if
(
abs
(
rcValue
[
throttleMap
]
-
rcMax
[
throttleMap
])
<
100
)
{
rcTrim
[
throttleMap
]
=
rcMax
[
throttleMap
];
// throttle
rcTrim
[
throttleMap
]
=
rcMax
[
throttleMap
];
// throttle
throttleDone
=
true
;
}
}
else
{
else
{
// Reject
// Reject
QMessageBox
warnMsgBox
;
QMessageBox
warnMsgBox
;
warnMsgBox
.
setText
(
tr
(
"Throttle Stick Trim Position Invalid"
));
warnMsgBox
.
setText
(
tr
(
"Throttle Stick Trim Position Invalid"
));
warnMsgBox
.
setInformativeText
(
tr
(
"The throttle stick is not in the min position. Please set it to the minimum value
"
));
warnMsgBox
.
setInformativeText
(
tr
(
"The throttle stick is not in the min position. Please set it to the zero throttle position and then click OK.
"
));
warnMsgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
warnMsgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
warnMsgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
warnMsgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
(
void
)
warnMsgBox
.
exec
();
(
void
)
warnMsgBox
.
exec
();
// wait long enough to get some data
QGC
::
SLEEP
::
msleep
(
500
);
}
}
}
// Set trim for roll, pitch, yaw, throttle
// Set trim for roll, pitch, yaw, throttle
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment