Apollo 10.0
自动驾驶开放平台
apollo::drivers::util 命名空间参考

函数

template<typename T >
unix2gps (const T unix_seconds)
 
template<typename T >
gps2unix (const T gps_seconds)
 

变量

const int32_t GPS_AND_SYSTEM_DIFF_SECONDS = 315964800
 

函数说明

◆ gps2unix()

template<typename T >
T apollo::drivers::util::gps2unix ( const T  gps_seconds)

在文件 time_conversion.h128 行定义.

128 {
129 for (size_t i = 0; i < array_size(LEAP_SECONDS); ++i) {
130 T result = gps_seconds + (GPS_AND_SYSTEM_DIFF_SECONDS - LEAP_SECONDS[i][1]);
131 if (result >= LEAP_SECONDS[i][0]) {
132 return result;
133 }
134 }
135 return static_cast<T>(0);
136}
const int32_t GPS_AND_SYSTEM_DIFF_SECONDS
constexpr size_t array_size(T(&)[N])
Definition macros.h:61

◆ unix2gps()

template<typename T >
T apollo::drivers::util::unix2gps ( const T  unix_seconds)

在文件 time_conversion.h118 行定义.

118 {
119 for (size_t i = 0; i < array_size(LEAP_SECONDS); ++i) {
120 if (unix_seconds >= LEAP_SECONDS[i][0]) {
121 return unix_seconds - (GPS_AND_SYSTEM_DIFF_SECONDS - LEAP_SECONDS[i][1]);
122 }
123 }
124 return static_cast<T>(0);
125}

变量说明

◆ GPS_AND_SYSTEM_DIFF_SECONDS

const int32_t apollo::drivers::util::GPS_AND_SYSTEM_DIFF_SECONDS = 315964800

在文件 time_conversion.h115 行定义.