ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Using Rosjava Time

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

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

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

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

Question Tools


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

Seen: 757 times

Last updated: Oct 10 '12