Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
* Fixing leap seconds
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berger <christian.berger@gu.se>
  • Loading branch information
chrberger committed Dec 11, 2018
1 parent 53f73f1 commit 1a26aaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ the messages according to OpenDLV Standard Message Set into session 111 in
Google Protobuf format, simply start it as follows:

```
docker run --init --rm --net=host chalmersrevere/opendlv-device-gps-pos-multi:v0.0.9 --pos_ip=192.168.1.77 --pos_port=5602 --cid=111 --verbose
docker run --init --rm --net=host chalmersrevere/opendlv-device-gps-pos-multi:v0.0.10 --pos_ip=192.168.1.77 --pos_port=5602 --cid=111 --verbose
```

## Build from sources on the example of Ubuntu 16.04 LTS
Expand Down
2 changes: 1 addition & 1 deletion src/pos-decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ POSDecoder::POSDecoder(std::function<void(const double &latitude, const double &
gmtime_r(&currentTime, &currentTimeBrokenDown);

const constexpr int32_t GPS_EPOCH_OFFSET{315964800};
const constexpr int32_t GPS_LEAP_SECONDS{18};
const constexpr int32_t GPS_LEAP_SECONDS{-18};
constexpr const int64_t SECONDS_PER_WEEK{60*60*24*7};
const double diff = difftime(createTimeFromYYYYMMDD(currentTimeBrokenDown.tm_year+1900, currentTimeBrokenDown.tm_mon+1, currentTimeBrokenDown.tm_mday), createTimeFromYYYYMMDD(1980, 1, 6));
m_timeOffsetSinceGPSinMicroseconds = (static_cast<int64_t>(diff)/SECONDS_PER_WEEK)*SECONDS_PER_WEEK + GPS_EPOCH_OFFSET + GPS_LEAP_SECONDS;
Expand Down

0 comments on commit 1a26aaf

Please sign in to comment.