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
fcdf550b
Commit
fcdf550b
authored
Jan 30, 2012
by
Bryant Mairs
Browse files
Removed some sources for warnings.
Also removed redundant code in QGCMapWidget.cc.
parent
6821ff47
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ui/map/QGCMapWidget.cc
View file @
fcdf550b
...
...
@@ -303,9 +303,6 @@ void QGCMapWidget::updateLocalPosition()
}
// Set new lat/lon position of UAV icon
double
latitude
=
UASManager
::
instance
()
->
getHomeLatitude
();
double
longitude
=
UASManager
::
instance
()
->
getHomeLongitude
();
double
altitude
=
UASManager
::
instance
()
->
getHomeAltitude
();
internals
::
PointLatLng
pos_lat_lon
=
internals
::
PointLatLng
(
system
->
getLatitude
(),
system
->
getLongitude
());
uav
->
SetUAVPos
(
pos_lat_lon
,
system
->
getAltitude
());
// Follow status
...
...
@@ -317,33 +314,7 @@ void QGCMapWidget::updateLocalPosition()
void
QGCMapWidget
::
updateLocalPositionEstimates
()
{
QList
<
UASInterface
*>
systems
=
UASManager
::
instance
()
->
getUASList
();
foreach
(
UASInterface
*
system
,
systems
)
{
// Get reference to graphic UAV item
mapcontrol
::
UAVItem
*
uav
=
GetUAV
(
system
->
getUASID
());
// Check if reference is valid, else create a new one
if
(
uav
==
NULL
)
{
MAV2DIcon
*
newUAV
=
new
MAV2DIcon
(
map
,
this
,
system
);
AddUAV
(
system
->
getUASID
(),
newUAV
);
uav
=
newUAV
;
uav
->
SetTrailTime
(
1
);
uav
->
SetTrailDistance
(
5
);
uav
->
SetTrailType
(
mapcontrol
::
UAVTrailType
::
ByTimeElapsed
);
}
// Set new lat/lon position of UAV icon
double
latitude
=
UASManager
::
instance
()
->
getHomeLatitude
();
double
longitude
=
UASManager
::
instance
()
->
getHomeLongitude
();
double
altitude
=
UASManager
::
instance
()
->
getHomeAltitude
();
internals
::
PointLatLng
pos_lat_lon
=
internals
::
PointLatLng
(
system
->
getLatitude
(),
system
->
getLongitude
());
uav
->
SetUAVPos
(
pos_lat_lon
,
system
->
getAltitude
());
// Follow status
if
(
followUAVEnabled
&&
system
->
getUASID
()
==
followUAVID
)
SetCurrentPosition
(
pos_lat_lon
);
// Convert from radians to degrees and apply
uav
->
SetUAVHeading
((
system
->
getYaw
()
/
M_PI
)
*
180.0
f
);
}
updateLocalPosition
();
}
...
...
src/ui/mavlink/QGCMAVLinkMessageSender.cc
View file @
fcdf550b
...
...
@@ -23,7 +23,6 @@ QGCMAVLinkMessageSender::QGCMAVLinkMessageSender(MAVLinkProtocol* mavlink, QWidg
void
QGCMAVLinkMessageSender
::
refresh
()
{
unsigned
int
maxUpdateRate
=
0
;
// Send messages
foreach
(
unsigned
int
i
,
managementItems
.
keys
())
{
...
...
@@ -79,7 +78,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid)
uint8_t
*
nums
=
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
()
>
j
)
if
((
unsigned
int
)
(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
()
)
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toInt
();
}
...
...
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