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

Commit

Permalink
* Reset timestamp for each decoding cycle
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 Feb 1, 2019
1 parent be755ed commit 60debbc
Show file tree
Hide file tree
Showing 2 changed files with 4 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.11 --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.12 --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
4 changes: 3 additions & 1 deletion src/pos-decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void POSDecoder::decode(const std::string &data, std::chrono::system_clock::time
}

size_t POSDecoder::parseBuffer(uint8_t *buffer, const size_t size, std::chrono::system_clock::time_point &&tp) {
cluon::data::TimeStamp sampleTimeStamp{cluon::time::convert(std::move(tp))};
cluon::data::TimeStamp timeStampFromPacket{cluon::time::convert(std::move(tp))};

auto extractTimeDistance = [timeOffsetSinceGPSinMicroseconds = m_timeOffsetSinceGPSinMicroseconds](double time1){
int64_t seconds{static_cast<int64_t>(floor(time1))};
Expand Down Expand Up @@ -154,6 +154,8 @@ size_t POSDecoder::parseBuffer(uint8_t *buffer, const size_t size, std::chrono::
return offset;
}
else {
cluon::data::TimeStamp sampleTimeStamp{timeStampFromPacket};

// We can decode the next message.
const std::string message(reinterpret_cast<char*>(buffer + offset + POSDecoder::GRP_HEADER_SIZE), messageSize);
std::stringstream b(message);
Expand Down

0 comments on commit 60debbc

Please sign in to comment.