Hi, I use V-REP with ROS in Ubuntu 16.04.
I want to get V-REP simulation time by ROS topic, so I use 'use_sim_time' parameter as 'true.'
So, I can get simulation time by using 'ros::Time::now()' in my own ros node(This node is not depend on V-REP).
However, in V-REP script, 'simROS.getTime()' return ROS wall time(system time), not simulation time.
According to description of simROS.getTime(), this function return the current ROS time (i.e. the time returned by ros::Time::now()). (Ref : https://www.coppeliarobotics.com/helpFi ... tm#getTime)
Could anyone explain me why these functions are different?
Thanks.
V-REP ROS Plugin get wrong rostime when I use simulation time
Re: V-REP ROS Plugin get wrong rostime when I use simulation time
Hi,
Yes,
If you need the simulation time, there's a different API for that:
If you want to use simulation time as the ROS clock source, you can achieve that by publishing to the clock topic. See Running a Clock Server.
Cheers
Yes,
simROS.getTime()
returns the value in seconds of ros::Time::now()
as described in the API reference. Which functions are different?If you need the simulation time, there's a different API for that:
sim.getSimulationTime()
.If you want to use simulation time as the ROS clock source, you can achieve that by publishing to the clock topic. See Running a Clock Server.
Cheers