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
f3cb6196
Commit
f3cb6196
authored
Dec 04, 2015
by
Don Gagne
Browse files
Home position fixes
parent
70cdbaf2
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/MissionController.cc
View file @
f3cb6196
...
...
@@ -426,21 +426,21 @@ void MissionController::_initAllMissionItems(void)
if
(
_activeVehicle
&&
_activeVehicle
->
firmwarePlugin
()
->
sendHomePositionToVehicle
()
&&
_missionItems
->
count
()
!=
0
)
{
homeItem
=
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
0
));
homeItem
->
setHomePositionSpecialCase
(
true
);
}
else
{
// Add the home position item to the front
homeItem
=
new
MissionItem
(
this
);
homeItem
->
setHomePositionSpecialCase
(
true
);
if
(
_activeVehicle
)
{
homeItem
->
setCoordinate
(
_activeVehicle
->
homePosition
());
homeItem
->
setHomePositionValid
(
_activeVehicle
->
homePositionAvailable
());
}
homeItem
->
setCommand
(
MAV_CMD_NAV_WAYPOINT
);
homeItem
->
setFrame
(
MAV_FRAME_GLOBAL_RELATIVE_ALT
);
homeItem
->
setSequenceNumber
(
0
);
_missionItems
->
insert
(
0
,
homeItem
);
}
homeItem
->
setHomePositionValid
(
false
);
homeItem
->
setHomePositionSpecialCase
(
true
);
if
(
_activeVehicle
)
{
homeItem
->
setCoordinate
(
_activeVehicle
->
homePosition
());
homeItem
->
setHomePositionValid
(
_activeVehicle
->
homePositionAvailable
());
}
else
{
homeItem
->
setHomePositionValid
(
false
);
}
homeItem
->
setCommand
(
MAV_CMD_NAV_WAYPOINT
);
homeItem
->
setFrame
(
MAV_FRAME_GLOBAL
);
for
(
int
i
=
0
;
i
<
_missionItems
->
count
();
i
++
)
{
_initMissionItem
(
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
)));
...
...
src/Vehicle/Vehicle.cc
View file @
f3cb6196
...
...
@@ -236,17 +236,18 @@ void Vehicle::_handleHomePosition(mavlink_message_t& message)
QGeoCoordinate
newHomePosition
(
homePos
.
latitude
/
10000000.0
,
homePos
.
longitude
/
10000000.0
,
homePos
.
altitude
/
1000.0
);
if
(
newHomePosition
!=
_homePosition
)
{
if
(
!
_homePositionAvailable
||
newHomePosition
!=
_homePosition
)
{
emitHomePositionChanged
=
true
;
_homePosition
=
newHomePosition
;
}
if
(
!
_homePositionAvailable
)
{
emitHomePositionAvailableChanged
=
true
;
_homePositionAvailable
=
true
;
}
_homePositionAvailable
=
true
;
if
(
emitHomePositionChanged
)
{
qCDebug
(
VehicleLog
)
<<
"New home position"
<<
newHomePosition
;
emit
homePositionChanged
(
_homePosition
);
}
if
(
emitHomePositionAvailableChanged
)
{
...
...
src/comm/MockLink.cc
View file @
f3cb6196
...
...
@@ -70,7 +70,7 @@ union px4_custom_mode {
float
MockLink
::
_vehicleLatitude
=
47.633033
f
;
float
MockLink
::
_vehicleLongitude
=
-
122.08794
f
;
float
MockLink
::
_vehicleAltitude
=
9872
.5
f
;
float
MockLink
::
_vehicleAltitude
=
3
.5
f
;
const
char
*
MockConfiguration
::
_firmwareTypeKey
=
"FirmwareType"
;
const
char
*
MockConfiguration
::
_vehicleTypeKey
=
"VehicleType"
;
...
...
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