How to get the simulation time

Typically: "How do I... ", "How can I... " questions
Post Reply
narutom
Posts: 1
Joined: 07 Jan 2019, 04:24

How to get the simulation time

Post by narutom » 10 Jan 2019, 11:32

hey,guys.

I want to know how to get the time running in V-rep.
I use the SetJointTarjectPosition to control the joint, but it was completed in 0.5 seconds.
I plan to wait until 1 second,then give the next target joint angle.
So, I have to check if the real-time running in V-rep has reached 1 second.
I know that the simxGetLastCmdTime can get the simulation time, but that is the time of the last fetched command.
I want to know how to get the real-time running in V-rep but not the API finish time. Is there any API can make it?

Thanks.

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

Re: How to get the simulation time

Post by coppelia » 11 Jan 2019, 09:47

Hello,

if your controller is in V-REP, then use sim.getSystemTimeInMs for the real-time. Otherwise sim.getSimulationTime for the simulation time.

Cheers

Post Reply