V-Rep should publish to the /clock topic

Requests or suggestions for new features
sradmard
Posts: 9
Joined: 06 Oct 2016, 00:39

Re: V-Rep should publish to the /clock topic

Postby sradmard » 24 Jan 2017, 04:04

I was facing a similar problem to publish a tf tree and odometry data to ROS using the rosInterface implementation method. Rviz was giving me errors of Message removed because it is too old ..., which is because rviz by default uses ROS Time, while rosInterface implementation broadcasts in Simulation time. fferri suggestions were quite useful, so I would like to summarize them for the record, and add an extra point.
- You need to set /use_sim_time parameter in ROS to true right after running roscore and before launching any other ROS related command.
- Make sure that you are publishing from v-rep into /clock topic in ROS as instructed by fferri.
- Anywhere in the child script of v-rep that you need the time stamp, use the function simGetSimulationTime() and not simGetSystemTime().

coppelia
Site Admin
Posts: 6058
Joined: 14 Dec 2012, 00:25

Re: V-Rep should publish to the /clock topic

Postby coppelia » 25 Jan 2017, 08:28

Thanks for the precision!

Cheers

Billie1123
Posts: 57
Joined: 08 Jun 2016, 22:47

Re: V-Rep should publish to the /clock topic

Postby Billie1123 » 10 Mar 2017, 19:59

I have a console in which I print the output of clock, i.e: rostopic echo /clock

When I start the scene for the first time it works fine, but if I stop it and then start it again, the console needs some time to start printing the messages, sometimes even several seconds.

Can anybody reproduce this behaviour?

Regards

coppelia
Site Admin
Posts: 6058
Joined: 14 Dec 2012, 00:25

Re: V-Rep should publish to the /clock topic

Postby coppelia » 13 Mar 2017, 08:47

Hello,

can you confirm that simulation is running and messages are being sent? OR is the simulation during that time halted too?

Cheers

Billie1123
Posts: 57
Joined: 08 Jun 2016, 22:47

Re: V-Rep should publish to the /clock topic

Postby Billie1123 » 13 Mar 2017, 10:05

Yes, the simulation is running and other messages are being published using the RosInterface plugin while the /clock remains frozen for up to a few seconds.

This only happens, when I stop and play the simulation again leaving the console with "rostopic echo /clock" open. If I ctrl+C this console and start a new subscriber using the same command and press the play button in V-REP it works flawlessly.

Regards

fferri
Posts: 90
Joined: 09 Sep 2013, 19:28

Re: V-Rep should publish to the /clock topic

Postby fferri » 13 Mar 2017, 10:26

This may be related https://github.com/ros/ros_comm/issues/176

from dirk-thomas:
This is a fundamental design choice of ROS and not "fixable". The connections between nodes happens after each node is started so messages can get lost until all these connections are made.

You should design your nodes in a way that they either do not rely on each message to arrive or consider using latched topics to at least get the last message when the connections is established after it was initially published.

Billie1123
Posts: 57
Joined: 08 Jun 2016, 22:47

Re: V-Rep should publish to the /clock topic

Postby Billie1123 » 13 Mar 2017, 11:27

I was wrong when I checked the other messages. I was checking a message that was being published via a plugin I did. If I check a message published with the RosInterface plugin it also takes a while to publish if I was already subscribed to it when the simulation started.

I am going to open a new thread since it is not a clock issue as I first thought.

edit: this is the same problem I have described viewtopic.php?f=5&t=6180&p=24908&hilit=rosinterface#p24908


Return to “Feature requests”

Who is online

Users browsing this forum: Google [Bot] and 3 guests