simROS.getTime() returns incoherent values

Report crashes, strange behaviour, or apparent bugs
Post Reply
DavBuss
Posts: 9
Joined: 07 Dec 2018, 13:57

simROS.getTime() returns incoherent values

Post by DavBuss » 12 Sep 2019, 08:29

Hello all,

When I call simROS.getTime(), I get incoherent values, that goes back and forth and are very different from the values I get with the rest of my ROS components:

Code: Select all

> simROS.getTime()
406881952.0000326
> simROS.getTime()
406216352.0000326
> simROS.getTime()
407266656.0000326
> simROS.getTime()
406437504.0000326
> simROS.getTime()
407428336.0000326
> simROS.getTime()
406847232.000032
If I relaunch V-REP, I get completely different resuls:

Code: Select all

> simROS.getTime()
3624673344.0000324
> simROS.getTime()
3626354448.0000324
> simROS.getTime()
3625708496.0000324
> simROS.getTime()
3625451328.0000324
> simROS.getTime()
3625753696.0000324
For instance, ros::Time::now() returns 1568272409.795527935 on other nodes.

Roscore is launched (before V-REP), the ROS parameter /use_sim_clock not set or set to false. Start and stop the simulation has no impact.
I use V-REP 3.5.0-rev6 and ROS kinetic, on Ubuntu 16.04.

Does someone has a clue on this?

Thanks!

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

Re: simROS.getTime() returns incoherent values

Post by fferri » 12 Sep 2019, 10:28

The implementation of simROS.getTime() is to simply return the value of ros::Time::now().toSec().

Did you compile Lua with single precision floats?

DavBuss
Posts: 9
Joined: 07 Dec 2018, 13:57

Re: simROS.getTime() returns incoherent values

Post by DavBuss » 12 Sep 2019, 11:05

I use the Lua library bundled with V-REP I downloaded here : http://www.coppeliarobotics.com/files/V ... nux.tar.gz

I suppose it is double precision float, since single-precision float cannot store precisely "3624673344.0000324" (it would gives something like "3624673280.0")

DavBuss
Posts: 9
Joined: 07 Dec 2018, 13:57

Re: simROS.getTime() returns incoherent values

Post by DavBuss » 12 Sep 2019, 13:34

So, I built v_repExtRosInterface from source (on v3.5.0), and now it works!

Just to know, is there a pre-compiled version of V-REP that is linked against ros kinetic?

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

Re: simROS.getTime() returns incoherent values

Post by fferri » 12 Sep 2019, 14:40

To my knowledge there are no binary releases of v_repExtRosInterface.

You have to compile it from source using the ROS environment installed on your machine.

DavBuss
Posts: 9
Joined: 07 Dec 2018, 13:57

Re: simROS.getTime() returns incoherent values

Post by DavBuss » 12 Sep 2019, 14:55

libv_repExtRosInterface.so is bundled with at least the Pro-Edu Linux version of V-REP. However I don't know on which version of ROS they are linked against.

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

Re: simROS.getTime() returns incoherent values

Post by fferri » 12 Sep 2019, 14:57

That probably is the culprit (mismatch between executable/library and ROS distribution).

Post Reply