Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
2d5018d6
Commit
2d5018d6
authored
May 31, 2016
by
Lorenz Meier
Browse files
Update XPlane link
parent
67bb4089
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/QGCXPlaneLink.cc
View file @
2d5018d6
...
...
@@ -2,7 +2,7 @@
QGroundControl Open Source Ground Control Station
(c) 2009 - 201
1
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
(c) 2009 - 201
6
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
...
...
@@ -24,7 +24,7 @@ This file is part of the QGROUNDCONTROL project
/**
* @file QGCXPlaneLink.cc
* Implementation of X-Plane interface
* @author Lorenz Meier <
mavteam@student.ethz.ch
>
* @author Lorenz Meier <
lm@qgroundcontrol.org
>
*
*/
...
...
@@ -371,7 +371,9 @@ void QGCXPlaneLink::updateControls(quint64 time, float rollAilerons, float pitch
bool
isFixedWing
=
true
;
if
(
_vehicle
->
vehicleType
()
==
MAV_TYPE_QUADROTOR
)
if
(
_vehicle
->
vehicleType
()
==
MAV_TYPE_QUADROTOR
||
mav
->
getSystemType
()
==
MAV_TYPE_HEXAROTOR
||
mav
->
getSystemType
()
==
MAV_TYPE_OCTOROTOR
)
{
qDebug
()
<<
"MAV_TYPE_QUADROTOR"
;
...
...
@@ -381,7 +383,9 @@ void QGCXPlaneLink::updateControls(quint64 time, float rollAilerons, float pitch
p
.
f
[
2
]
=
throttle
;
p
.
f
[
3
]
=
pitchElevator
;
isFixedWing
=
false
;
// Direct throttle control
p
.
index
=
25
;
writeBytesSafe
((
const
char
*
)
&
p
,
sizeof
(
p
));
}
else
{
...
...
@@ -389,34 +393,26 @@ void QGCXPlaneLink::updateControls(quint64 time, float rollAilerons, float pitch
p
.
f
[
0
]
=
-
pitchElevator
;
p
.
f
[
1
]
=
rollAilerons
;
p
.
f
[
2
]
=
yawRudder
;
}
if
(
isFixedWing
)
{
// Ail / Elevon / Rudder
p
.
index
=
12
;
// XPlane, wing sweep
// Send to group 12
p
.
index
=
12
;
writeBytesSafe
((
const
char
*
)
&
p
,
sizeof
(
p
));
p
.
index
=
8
;
// XPlane, joystick? why?
// Send to group 8, which equals manual controls
p
.
index
=
8
;
writeBytesSafe
((
const
char
*
)
&
p
,
sizeof
(
p
));
p
.
index
=
25
;
// Thrust
// Send throttle to all four motors
p
.
index
=
25
;
memset
(
p
.
f
,
0
,
sizeof
(
p
.
f
));
p
.
f
[
0
]
=
throttle
;
p
.
f
[
1
]
=
throttle
;
p
.
f
[
2
]
=
throttle
;
p
.
f
[
3
]
=
throttle
;
// Throttle
writeBytesSafe
((
const
char
*
)
&
p
,
sizeof
(
p
));
}
else
{
qDebug
()
<<
"Transmitting p.index = 25"
;
p
.
index
=
25
;
// XPlane, throttle command.
writeBytesSafe
((
const
char
*
)
&
p
,
sizeof
(
p
));
}
}
Eigen
::
Matrix3f
euler_to_wRo
(
double
yaw
,
double
pitch
,
double
roll
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment