Ask Your Question
0

Using Rosjava Time

asked 2012-10-03 11:15:06 -0600

Jyo gravatar image

I am trying to use the ClockTopicTimeProvider to get time information, but it's constructor takes a defaultNode. Most of my nodes were launched via nodeMainExecutor,

nodeMainExecutor.execute(sensorView, nodeConfiguration);

The result of this has a connectedNode, I tried casting this to a defaultNode but that didn't work. The actual constructor for a defaultNode looks like its definably not something I should be using.

Has anyone had any success getting ClockTopicTimeProvider working? Or knows how one obtains the "defaultNode" For reference I have multiple other subscribers and publishers working, and this is an android application using rosjava.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-10-10 05:36:13 -0600

damonkohler gravatar image

You should ask the Node for the current time instead of using a TimeProvider directly. You can specify the TimeProvider to use in the NodeConfiguration then use Node.getCurrentTime().

A ClockTopicTimeProvider will be used automatically if the /use_sim_time parameter is true when the Node starts.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-10-03 11:15:06 -0600

Seen: 582 times

Last updated: Oct 10 '12