93 static const int32_t LEAP_SECONDS[][2] = {
117 template <
typename T>
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]);
124 return static_cast<T
>(0);
127 template <
typename T>
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]) {
135 return static_cast<T
>(0);
T unix2gps(const T unix_seconds)
Definition: time_conversion.h:118
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
const int32_t GPS_AND_SYSTEM_DIFF_SECONDS
Definition: time_conversion.h:115
constexpr size_t array_size(T(&)[N])
Definition: macros.h:61
T gps2unix(const T gps_seconds)
Definition: time_conversion.h:128