Real-time simulation slowdowns robot motion

Typically: "How do I... ", "How can I... " questions
Post Reply
Victoria Edwards
Posts: 6
Joined: 02 Feb 2021, 07:35

Real-time simulation slowdowns robot motion

Post by Victoria Edwards »

Hello
As you know, in the example "motionPlanningDemo1" scene, the Kuka 7 dof manipulator uses sampling based path planning to reach some predefined points in the work space. In the simulation settings when Real-time simulation is enabled, the manipulator moves slower.

1. I just want to know what Real-time simulation enabled really does? Why it slowdowns the robot motion? I just guss this setting makes the robot to act just like a real robot in the real world. Am I right?
It is crucial for me because I want to compare my 7 dof manipulator's path planning speed with an other researcher's project, to see if my robot design is better or not. That researcher's robot is a UR5 manipulator in real world and its path planning is done in ROS, but mine is a spacially designed for the task, simulated in coppeliasim (my robot simulation is just like the "motionPlanningDemo1" example).

2. How could I modify the simulation setting to obtain a trustworthy simulation speed in order to be compared with that researcher's robot? Actually I want to compare my path planning calculation time and execution time (how long the manipulator takes to execute a planned motion).

3. How could I obtain the path planning computation time and path planning execution time? For now I use time displayed by "simulation time display" (in the model browser) to obtain execution time, and time displayed by "real time display" (in the model browser) minus time dispalyed by "simulation time display" in order to obtain the calculation time for each motion. Is it a reliable method?

Sorry for my too long questions.
Thanks in advance.

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

Re: Real-time simulation slowdowns robot motion

Post by fferri »

Hi,

as described in Simulation loop, when real-time is enabled, the simulator tries to keep the simulated time synchronized with real time.

With real-time disabled, the simulation (therefore, simulation time) advances as fast as possible, so the speed of the simulation can vary from machine to machine.

Of course this only applies when the simulation complexity does not exceed what the simulator can handle in realtime. If the simulator takes more time than the time-step itself, real-time or not makes no difference, and simulated time will proceed slower than real time.

Generally, enabling real-time is better, as it produces more consistent results across different machines, as well as with exported content such as GLTF animations, which will play back at real-time speed.

Note that you have the API functions:
  • sim.getSystemTime gets the system time: use this for measuring algorithms computation time.
  • sim.getSimulationTime gets the simulation time: this time advances faster or slower than system time, but in some cases you want to use this, e.g. to compute speeds.

Victoria Edwards
Posts: 6
Joined: 02 Feb 2021, 07:35

Re: Real-time simulation slowdowns robot motion

Post by Victoria Edwards »

Thanks a million for your answer dear fferri:

1. So Real-time simulation enabled In my case slowdowns simulation which means my computer's cpu power is not completely used (what I think is not a good thing in my case, because it results in a slower robot and thus showing that my robot is not well designed, while with Real-time disabled my robot is faster and thus shows its good design). So I prefer to diable Real-time to abttain better results offcourse. Is there any thing wrong with it?

2. I think that in path planning, coppeliasim first calculates the path, then renders the scene to simulat the robot movements. So does Real-time simulation enabled, effect the path planning calculation time (I mean only the calculation time without the rendering time)?

Thanks in advance

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

Re: Real-time simulation slowdowns robot motion

Post by fferri »

No, real-time simulation does not affect path planning calculation time.

Victoria Edwards
Posts: 6
Joined: 02 Feb 2021, 07:35

Re: Real-time simulation slowdowns robot motion

Post by Victoria Edwards »

Thank you very much

Post Reply