Skip to content
Snippets Groups Projects
Unverified Commit 88616584 authored by Juan Ignacio Ubeira's avatar Juan Ignacio Ubeira Committed by GitHub
Browse files

Merge pull request #263 from drigz/avoid-simtime-crash

simtime: use time=0 by default
parents 13bcbee1 591f71d0
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,12 @@ public class ClockTopicTimeProvider implements TimeProvider { ...@@ -57,7 +57,12 @@ public class ClockTopicTimeProvider implements TimeProvider {
@Override @Override
public Time getCurrentTime() { public Time getCurrentTime() {
Preconditions.checkNotNull(clock); // When using simulation time, the ROS Time API will return time=0 until it has received a
// message from the /clock topic.
if (clock == null) {
return new Time();
}
synchronized (mutex) { synchronized (mutex) {
return new Time(clock.getClock()); return new Time(clock.getClock());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment