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
07e1d07a
Commit
07e1d07a
authored
May 29, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
fbfb0931
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
18 deletions
+11
-18
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+10
-17
QGCHilFlightGearConfiguration.cc
src/ui/QGCHilFlightGearConfiguration.cc
+1
-1
No files found.
src/comm/QGCFlightGearLink.cc
View file @
07e1d07a
...
...
@@ -98,16 +98,6 @@ void QGCFlightGearLink::run()
connect
(
this
,
SIGNAL
(
sensorHilRawImuChanged
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
quint32
)),
mav
,
SLOT
(
sendHilSensors
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
quint32
)));
// FIXME: Does this need to be called from the new thread
// FIXME: Why the need for dynamic cast. Missing virtual in interface?
// Wait until we know we can actually start FlightGear?
UAS
*
uas
=
dynamic_cast
<
UAS
*>
(
mav
);
if
(
uas
)
{
uas
->
startHil
();
}
// Start a new process to run FlightGear in
process
=
new
QProcess
(
this
);
Q_CHECK_PTR
(
process
);
...
...
@@ -148,11 +138,10 @@ void QGCFlightGearLink::run()
#endif
process
->
start
(
_fgProcessName
,
/*debugArgList*/
_fgArgList
);
connectState
=
true
;
emit
simulationConnected
(
connectState
);
if
(
connectState
)
{
emit
simulationConnected
();
}
emit
simulationConnected
();
exec
();
}
...
...
@@ -257,13 +246,13 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p
QString
state
(
"%1
\t
%2
\t
%3
\t
%4
\t
%5
\n
"
);
state
=
state
.
arg
(
rollAilerons
).
arg
(
pitchElevator
).
arg
(
yawRudder
).
arg
(
true
).
arg
(
throttle
);
writeBytes
(
state
.
toAscii
().
constData
(),
state
.
length
());
// qDebug() << "updated controls" << rollAilerons << pitchElevator << yawRudder << throttle;
//qDebug() << "Updated controls" << rollAilerons << pitchElevator << yawRudder << throttle;
//qDebug() << "Updated controls" << state;
}
else
{
qDebug
()
<<
"HIL: Got NaN values from the hardware: isnan output: roll: "
<<
isnan
(
rollAilerons
)
<<
", pitch: "
<<
isnan
(
pitchElevator
)
<<
", yaw: "
<<
isnan
(
yawRudder
)
<<
", throttle: "
<<
isnan
(
throttle
);
}
//qDebug() << "Updated controls" << state;
}
void
QGCFlightGearLink
::
writeBytes
(
const
char
*
data
,
qint64
size
)
...
...
@@ -313,7 +302,7 @@ void QGCFlightGearLink::readBytes()
// Print string
QString
state
(
b
);
//
qDebug() << "FG LINK GOT:" << state;
//
qDebug() << "FG LINK GOT:" << state;
QStringList
values
=
state
.
split
(
"
\t
"
);
...
...
@@ -508,6 +497,10 @@ bool QGCFlightGearLink::disconnectSimulation()
emit
simulationDisconnected
();
emit
simulationConnected
(
false
);
// Exit the thread
quit
();
return
!
connectState
;
}
...
...
@@ -819,7 +812,7 @@ bool QGCFlightGearLink::connectSimulation()
// Setup protocol we will be using to communicate with FlightGear
QString
fgProtocol
(
mav
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
?
"qgroundcontrol-quadrotor"
:
"qgroundcontrol-fixed-wing"
);
QString
fgProtocolArg
(
"--generic=socket,%1,
5
0,127.0.0.1,%2,udp,%3"
);
QString
fgProtocolArg
(
"--generic=socket,%1,
30
0,127.0.0.1,%2,udp,%3"
);
_fgArgList
<<
fgProtocolArg
.
arg
(
"out"
).
arg
(
port
).
arg
(
fgProtocol
);
_fgArgList
<<
fgProtocolArg
.
arg
(
"in"
).
arg
(
currentPort
).
arg
(
fgProtocol
);
...
...
src/ui/QGCHilFlightGearConfiguration.cc
View file @
07e1d07a
...
...
@@ -13,7 +13,7 @@ const char* QGCHilFlightGearConfiguration::_sensorHilKey = "SEN
// Default set of optional command line parameters. If FlightGear won't run HIL without it it should go into
// the QGCFlightGearLink code instead.
const
char
*
QGCHilFlightGearConfiguration
::
_defaultOptions
=
"--roll=0 --pitch=0 --vc=0 --heading=300 --timeofday=noon --disable-hud-3d --disable-fullscreen --geometry=400x300 --disable-anti-alias-hud --wind=0@0 --turbulence=0.0 --
prop:/sim/frame-rate-throttle-hz=30 --control=mouse --disable-sound --disable-random-objects --disable-ai-traffic --shading-flat --fog-disable --disable-specular-highlight --disable-random-objects --disable-panel --disable-clouds --fdm=jsb --units-meters --enable-terrasync --atlas=socket,out,1,localhost,5505,udp
"
;
const
char
*
QGCHilFlightGearConfiguration
::
_defaultOptions
=
"--roll=0 --pitch=0 --vc=0 --heading=300 --timeofday=noon --disable-hud-3d --disable-fullscreen --geometry=400x300 --disable-anti-alias-hud --wind=0@0 --turbulence=0.0 --
control=mouse --disable-sound --disable-random-objects --disable-ai-traffic --shading-flat --fog-disable --disable-specular-highlight --disable-random-objects --disable-panel --disable-clouds --fdm=jsb --units-meters --enable-terrasync
"
;
QGCHilFlightGearConfiguration
::
QGCHilFlightGearConfiguration
(
UAS
*
mav
,
QWidget
*
parent
)
:
QWidget
(
parent
),
...
...
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