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
56654426
Commit
56654426
authored
Sep 18, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #385 from limhyon/master
Quadrotor HILS Update
parents
d64f163e
943391db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
27 deletions
+45
-27
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+43
-27
UAS.cc
src/uas/UAS.cc
+2
-0
No files found.
src/comm/QGCXPlaneLink.cc
View file @
56654426
...
@@ -292,15 +292,6 @@ void QGCXPlaneLink::updateActuators(uint64_t time, float act1, float act2, float
...
@@ -292,15 +292,6 @@ void QGCXPlaneLink::updateActuators(uint64_t time, float act1, float act2, float
void
QGCXPlaneLink
::
updateControls
(
uint64_t
time
,
float
rollAilerons
,
float
pitchElevator
,
float
yawRudder
,
float
throttle
,
uint8_t
systemMode
,
uint8_t
navMode
)
void
QGCXPlaneLink
::
updateControls
(
uint64_t
time
,
float
rollAilerons
,
float
pitchElevator
,
float
yawRudder
,
float
throttle
,
uint8_t
systemMode
,
uint8_t
navMode
)
{
{
// Do not update this control type for
// all multirotors
if
(
mav
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
||
mav
->
getSystemType
()
==
MAV_TYPE_HEXAROTOR
||
mav
->
getSystemType
()
==
MAV_TYPE_OCTOROTOR
)
{
return
;
}
#pragma pack(push, 1)
#pragma pack(push, 1)
struct
payload
{
struct
payload
{
char
b
[
5
];
char
b
[
5
];
...
@@ -315,7 +306,11 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc
...
@@ -315,7 +306,11 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc
p
.
b
[
3
]
=
'A'
;
p
.
b
[
3
]
=
'A'
;
p
.
b
[
4
]
=
'\0'
;
p
.
b
[
4
]
=
'\0'
;
p
.
index
=
12
;
Q_UNUSED
(
time
);
Q_UNUSED
(
systemMode
);
Q_UNUSED
(
navMode
);
bool
isFixedWing
=
true
;
if
(
mav
->
getAirframe
()
==
UASInterface
::
QGC_AIRFRAME_X8
||
if
(
mav
->
getAirframe
()
==
UASInterface
::
QGC_AIRFRAME_X8
||
mav
->
getAirframe
()
==
UASInterface
::
QGC_AIRFRAME_VIPER_2_0
||
mav
->
getAirframe
()
==
UASInterface
::
QGC_AIRFRAME_VIPER_2_0
||
...
@@ -329,31 +324,52 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc
...
@@ -329,31 +324,52 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc
// yaw
// yaw
p
.
f
[
2
]
=
0.0
f
;
p
.
f
[
2
]
=
0.0
f
;
}
}
else
if
(
mav
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
)
{
qDebug
()
<<
"MAV_TYPE_QUADROTOR"
;
// Individual effort will be provided directly to the actuators on Xplane quadrotor.
p
.
f
[
0
]
=
yawRudder
;
p
.
f
[
1
]
=
rollAilerons
;
p
.
f
[
2
]
=
throttle
;
p
.
f
[
3
]
=
pitchElevator
;
isFixedWing
=
false
;
}
else
else
{
{
// direct pass-through
// direct pass-through
, normal fixed-wing.
p
.
f
[
0
]
=
-
pitchElevator
;
p
.
f
[
0
]
=
-
pitchElevator
;
p
.
f
[
1
]
=
rollAilerons
;
p
.
f
[
1
]
=
rollAilerons
;
p
.
f
[
2
]
=
yawRudder
;
p
.
f
[
2
]
=
yawRudder
;
}
}
Q_UNUSED
(
time
);
if
(
isFixedWing
)
Q_UNUSED
(
systemMode
);
{
Q_UNUSED
(
navMode
);
// Ail / Elevon / Rudder
p
.
index
=
12
;
// XPlane, wing sweep
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
p
.
index
=
8
;
// XPlane, joystick? why?
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
p
.
index
=
25
;
// Thrust
memset
(
p
.
f
,
0
,
sizeof
(
p
.
f
));
p
.
f
[
0
]
=
throttle
;
p
.
f
[
1
]
=
throttle
;
p
.
f
[
2
]
=
throttle
;
p
.
f
[
3
]
=
throttle
;
// Throttle
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
}
else
{
qDebug
()
<<
"Transmitting p.index = 25"
;
p
.
index
=
25
;
// XPlane, throttle command.
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
}
// Ail / Elevon / Rudder
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
p
.
index
=
8
;
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
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
writeBytes
((
const
char
*
)
&
p
,
sizeof
(
p
));
}
}
Eigen
::
Matrix3f
euler_to_wRo
(
double
yaw
,
double
pitch
,
double
roll
)
{
Eigen
::
Matrix3f
euler_to_wRo
(
double
yaw
,
double
pitch
,
double
roll
)
{
...
...
src/uas/UAS.cc
View file @
56654426
...
@@ -1326,6 +1326,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -1326,6 +1326,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
}
}
break
;
break
;
#if 0
case MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
case MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
{
{
mavlink_servo_output_raw_t raw;
mavlink_servo_output_raw_t raw;
...
@@ -1340,6 +1341,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -1340,6 +1341,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
}
}
break;
break;
#endif
#ifdef MAVLINK_ENABLED_PIXHAWK
#ifdef MAVLINK_ENABLED_PIXHAWK
case
MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE
:
case
MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE
:
{
{
...
...
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