mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-27 18:20:38 +08:00
feat(clock_source): Create new system clock source parameter in order to select the main clock source
This commit is contained in:
1 parent
52cf24a954
commit
4bb943bf6d
13 files changed
+114
-13
No files matched your search
@@ -347,7 +347,10 @@ void GZBridge::clockCallback(const gz::msgs::Clock &msg)
|
||||
|
||||
if (!_realtime_clock_set) {
|
||||
// Set initial real time clock at startup
|
||||
px4_clock_settime(CLOCK_REALTIME, &ts);
|
||||
if (_param_sys_time_src.get() & SYS_TIME_SRC_SIMULATOR) {
|
||||
px4_clock_settime(CLOCK_REALTIME, &ts);
|
||||
}
|
||||
|
||||
_realtime_clock_set = true;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <lib/drivers/rangefinder/PX4Rangefinder.hpp>
|
||||
#include <lib/drivers/barometer/PX4Barometer.hpp>
|
||||
#include <lib/geo/geo.h>
|
||||
#include <systemlib/system_time_source.h>
|
||||
|
||||
#include <uORB/PublicationMulti.hpp>
|
||||
#include <uORB/Subscription.hpp>
|
||||
@@ -206,6 +207,7 @@ private:
|
||||
(ParamInt<px4::params::SIM_GZ_EN_ODOM>) _sim_gz_en_odom,
|
||||
(ParamInt<px4::params::SIM_GZ_EN_GPS>) _sim_gz_en_gps,
|
||||
(ParamInt<px4::params::SIM_GZ_EN_IMU>) _sim_gz_en_imu,
|
||||
(ParamInt<px4::params::SIM_GZ_EN_MAG>) _sim_gz_en_mag
|
||||
(ParamInt<px4::params::SIM_GZ_EN_MAG>) _sim_gz_en_mag,
|
||||
(ParamInt<px4::params::SYS_TIME_SRC>) _param_sys_time_src
|
||||
)
|
||||
};
|
||||
Reference in new issue
Block a user