simROS.getTime() returns incoherent values

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

simROS.getTime() returns incoherent values

Post 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!

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

Re: simROS.getTime() returns incoherent values

Post 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?

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

Re: simROS.getTime() returns incoherent values

Post 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")

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

Re: simROS.getTime() returns incoherent values

Post 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?

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

Re: simROS.getTime() returns incoherent values

Post 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.

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

Re: simROS.getTime() returns incoherent values

Post 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.

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

Re: simROS.getTime() returns incoherent values

Post by fferri »

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

felipeconter
Posts: 1
Joined: 19 Nov 2019, 14:47

Re: simROS.getTime() returns incoherent values

Post 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!

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

Re: simROS.getTime() returns incoherent values

Post 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

Post Reply