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
4776d22d
Commit
4776d22d
authored
Apr 13, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3227 from NaterGator/hilfix
Fix HIL mode not being properly detected for #3226
parents
3ae7cbb2
861a2d07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
Vehicle.h
src/Vehicle/Vehicle.h
+2
-0
UAS.cc
src/uas/UAS.cc
+5
-6
UAS.h
src/uas/UAS.h
+0
-2
No files found.
src/Vehicle/Vehicle.h
View file @
4776d22d
...
...
@@ -494,6 +494,8 @@ public:
uint
messagesLost
()
{
return
_messagesLost
;
}
bool
flying
()
const
{
return
_flying
;
}
bool
guidedMode
()
const
;
uint8_t
baseMode
()
const
{
return
_base_mode
;
}
uint32_t
customMode
()
const
{
return
_custom_mode
;
}
Fact
*
roll
(
void
)
{
return
&
_rollFact
;
}
Fact
*
heading
(
void
)
{
return
&
_headingFact
;
}
...
...
src/uas/UAS.cc
View file @
4776d22d
...
...
@@ -58,8 +58,6 @@ UAS::UAS(MAVLinkProtocol* protocol, Vehicle* vehicle, FirmwarePluginManager * fi
receiveDropRate
(
0
),
sendDropRate
(
0
),
base_mode
(
0
),
custom_mode
(
0
),
status
(
-
1
),
startTime
(
QGC
::
groundTimeMilliseconds
()),
...
...
@@ -1440,6 +1438,7 @@ void UAS::setManual6DOFControlCommands(double x, double y, double z, double roll
if
(
!
_vehicle
)
{
return
;
}
const
uint8_t
base_mode
=
_vehicle
->
baseMode
();
// If system has manual inputs enabled and is armed
if
(((
base_mode
&
MAV_MODE_FLAG_DECODE_POSITION_MANUAL
)
&&
(
base_mode
&
MAV_MODE_FLAG_DECODE_POSITION_SAFETY
))
||
(
base_mode
&
MAV_MODE_FLAG_HIL_ENABLED
))
...
...
@@ -1686,7 +1685,7 @@ void UAS::sendHilState(quint64 time_us, float roll, float pitch, float yaw, floa
return
;
}
if
(
this
->
base_mode
&
MAV_MODE_FLAG_HIL_ENABLED
)
if
(
_vehicle
->
hilMode
()
)
{
float
q
[
4
];
...
...
@@ -1766,7 +1765,7 @@ void UAS::sendHilSensors(quint64 time_us, float xacc, float yacc, float zacc, fl
return
;
}
if
(
this
->
base_mode
&
MAV_MODE_FLAG_HIL_ENABLED
)
if
(
_vehicle
->
hilMode
()
)
{
float
xacc_corrupt
=
addZeroMeanNoise
(
xacc
,
xacc_var
);
float
yacc_corrupt
=
addZeroMeanNoise
(
yacc
,
yacc_var
);
...
...
@@ -1817,7 +1816,7 @@ void UAS::sendHilOpticalFlow(quint64 time_us, qint16 flow_x, qint16 flow_y, floa
Q_UNUSED
(
quality
);
Q_UNUSED
(
ground_distance
);
if
(
this
->
base_mode
&
MAV_MODE_FLAG_HIL_ENABLED
)
if
(
_vehicle
->
hilMode
()
)
{
#if 0
mavlink_message_t msg;
...
...
@@ -1849,7 +1848,7 @@ void UAS::sendHilGps(quint64 time_us, double lat, double lon, double alt, int fi
if
(
QGC
::
groundTimeMilliseconds
()
-
lastSendTimeGPS
<
100
)
return
;
if
(
this
->
base_mode
&
MAV_MODE_FLAG_HIL_ENABLED
)
if
(
_vehicle
->
hilMode
()
)
{
float
course
=
cog
;
// map to 0..2pi
...
...
src/uas/UAS.h
View file @
4776d22d
...
...
@@ -370,8 +370,6 @@ protected: //COMMENTS FOR TEST UNIT
float
sendDropRate
;
///< Percentage of packets that were not received from the MAV by the GCS
/// BASIC UAS TYPE, NAME AND STATE
uint8_t
base_mode
;
///< The current mode of the MAV
uint32_t
custom_mode
;
///< The current mode of the MAV
int
status
;
///< The current status of the MAV
/// TIMEKEEPING
...
...
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