Page 1 of 1

simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 08:29
by DavBuss
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!

Re: simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 10:28
by fferri
The implementation of simROS.getTime() is to simply return the value of ros::Time::now().toSec().

Did you compile Lua with single precision floats?

Re: simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 11:05
by DavBuss
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")

Re: simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 13:34
by DavBuss
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?

Re: simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 14:40
by fferri
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.

Re: simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 14:55
by DavBuss
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.

Re: simROS.getTime() returns incoherent values

Posted: 12 Sep 2019, 14:57
by fferri
That probably is the culprit (mismatch between executable/library and ROS distribution).

Re: simROS.getTime() returns incoherent values

Posted: 20 Nov 2019, 13:57
by felipeconter
I have the same issue and I can't find the source for v_repExtRosInterface. I believe it was on Coppelia Robotics github, but now I guess it was replaced by simExtROS2Interface, which is for ROS 2. Is there another way to get the source code so i can build and hopefully solve this issue? Thanks in advance!

Re: simROS.getTime() returns incoherent values

Posted: 21 Nov 2019, 06:17
by coppelia
Hello,

simExtROSInterface is the new ROS (1) interface that works with CoppeliaSim. CoppeliaSim will be released next week, the beta can be found here.

Cheers