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

Can rosbridge set the timestamp of stamped messages?

asked 2012-03-16 00:37:14 -0600

JBuesch gravatar image

Hello guys,

I am using rosbridge in my project and it would be great if the bridge could set the timestamps in messages passed through it as simple json messages. Is that supported somehow?

Cheers, J.B.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-03-19 09:30:26 -0600

tjay gravatar image

In the current SVN (experimental version of rosbridge):

svn co http://brown-ros-pkg.googlecode.com/svn/trunk/experimental/rosbridge

I have added a feature so that if you send a header (or an object containing a header) with an empty stamp field, it will be replaced with the current rostime. In other words:

con.publish('/heads','std_msgs/Header',{seq:42,frame_id:'foo',stamp:{}})

results in something like:

seq: 43                                                                                             
stamp:                                                                                              
  secs: 1332141768                                                                                  
  nsecs: 325777053                                                                                  
frame_id: foo

Keep in mind that this is purely for cases where you don't need a very accurate timestamp. The proper thing to do is still to synchronize the client and ROS runtime's clocks.

If for some reason you don't want to run the SVN version of rosbridge, you can also use this patch until the binary version is updated (after more time and testing).

edit flag offensive delete link more
0

answered 2012-03-19 23:03:26 -0600

JBuesch gravatar image

Thank you so much! That will things easier for me. In my setup I have only one hard wired link between the sender and the bridge such that I don't anticipate much delay there and thus not afraid setting the stamp only at the bridge which will deliver decent enough accuracy.

Nevertheless I will keep your suggestion in mind in case there is something odd happening and whenever the setup will become more complex I will immediately switch to setting the stamp at the source.

Thanks again! Cheers

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-03-16 00:37:14 -0600

Seen: 1,414 times

Last updated: Mar 19 '12