Skip to content

Commit

Permalink
microRTPS_timesync.cpp: fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
TSC21 committed Mar 9, 2020
1 parent ff4af95 commit f9e0d8f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions msg/templates/urtps/microRTPS_timesync.cpp.em
Expand Up @@ -190,23 +190,23 @@ void TimeSync::processTimesyncMsg(timesync* msg) {
@[ end if]@
@[end if]@
if (msg->sys_id() == 1 && msg->seq() != _last_remote_msg_seq) {
if (msg->tc1() > 0) {
_last_remote_msg_seq = msg->seq();
if (msg->tc1() > 0) {
_last_remote_msg_seq = msg->seq();

if (!addMeasurement(msg->ts1(), msg->tc1(), getMonoRawTimeNSec())) {
std::cerr << "Offset not updated" << std::endl;
}
if (!addMeasurement(msg->ts1(), msg->tc1(), getMonoRawTimeNSec())) {
std::cerr << "Offset not updated" << std::endl;
}

} else if (msg->tc1() == 0) {
_last_remote_msg_seq = msg->seq();
} else if (msg->tc1() == 0) {
_last_remote_msg_seq = msg->seq();

msg->timestamp() = getMonoTimeUSec();
msg->sys_id() = 0;
msg->seq()++;
msg->tc1() = getMonoRawTimeNSec();
msg->timestamp() = getMonoTimeUSec();
msg->sys_id() = 0;
msg->seq()++;
msg->tc1() = getMonoRawTimeNSec();

_timesync_pub.publish(msg);
}
_timesync_pub.publish(msg);
}
}
}

Expand Down

0 comments on commit f9e0d8f

Please sign in to comment.