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
14764f26
Unverified
Commit
14764f26
authored
Apr 08, 2018
by
Don Gagne
Committed by
GitHub
Apr 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6246 from bluerobotics/patrickelectric/set_time
Set vehicle time when finishing initial parameters read
parents
4f90da67
ca34927e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
5 deletions
+24
-5
AutoPilotPlugin.cc
src/AutoPilotPlugins/AutoPilotPlugin.cc
+1
-3
AutoPilotPlugin.h
src/AutoPilotPlugins/AutoPilotPlugin.h
+0
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+22
-0
Vehicle.h
src/Vehicle/Vehicle.h
+1
-1
No files found.
src/AutoPilotPlugins/AutoPilotPlugin.cc
View file @
14764f26
...
...
@@ -13,8 +13,6 @@
#include "AutoPilotPlugin.h"
#include "QGCApplication.h"
#include "ParameterManager.h"
#include "UAS.h"
#include "FirmwarePlugin.h"
AutoPilotPlugin
::
AutoPilotPlugin
(
Vehicle
*
vehicle
,
QObject
*
parent
)
...
...
@@ -28,7 +26,7 @@ AutoPilotPlugin::AutoPilotPlugin(Vehicle* vehicle, QObject* parent)
AutoPilotPlugin
::~
AutoPilotPlugin
()
{
}
void
AutoPilotPlugin
::
_recalcSetupComplete
(
void
)
...
...
src/AutoPilotPlugins/AutoPilotPlugin.h
View file @
14764f26
...
...
@@ -19,7 +19,6 @@
#include "FactSystem.h"
#include "Vehicle.h"
class
ParameterManager
;
class
Vehicle
;
class
FirmwarePlugin
;
...
...
src/Vehicle/Vehicle.cc
View file @
14764f26
...
...
@@ -2255,12 +2255,34 @@ void Vehicle::_rallyPointLoadComplete(void)
void
Vehicle
::
_parametersReady
(
bool
parametersReady
)
{
// Try to set current unix time to the vehicle
_sendQGCTimeToVehicle
();
// Send time twice, more likely to get to the vehicle on a noisy link
_sendQGCTimeToVehicle
();
if
(
parametersReady
)
{
_setupAutoDisarmSignalling
();
_startPlanRequest
();
}
}
void
Vehicle
::
_sendQGCTimeToVehicle
(
void
)
{
mavlink_message_t
msg
;
mavlink_system_time_t
cmd
;
// Timestamp of the master clock in microseconds since UNIX epoch.
cmd
.
time_unix_usec
=
QDateTime
::
currentDateTime
().
currentMSecsSinceEpoch
()
*
1000
;
// Timestamp of the component clock since boot time in milliseconds (Not necessary).
cmd
.
time_boot_ms
=
0
;
mavlink_msg_system_time_encode_chan
(
_mavlink
->
getSystemId
(),
_mavlink
->
getComponentId
(),
priorityLink
()
->
mavlinkChannel
(),
&
msg
,
&
cmd
);
sendMessageOnLink
(
priorityLink
(),
msg
);
}
void
Vehicle
::
disconnectInactiveVehicle
(
void
)
{
// Vehicle is no longer communicating with us, disconnect all links
...
...
src/Vehicle/Vehicle.h
View file @
14764f26
...
...
@@ -11,7 +11,6 @@
#include <QObject>
#include <QGeoCoordinate>
#include <QElapsedTimer>
#include "FactGroup.h"
#include "LinkInterface.h"
...
...
@@ -994,6 +993,7 @@ private slots:
void
_updateDistanceToHome
(
void
);
void
_updateHobbsMeter
(
void
);
void
_vehicleParamLoaded
(
bool
ready
);
void
_sendQGCTimeToVehicle
(
void
);
private:
bool
_containsLink
(
LinkInterface
*
link
);
...
...
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