Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Python: Set simulation speed

#1
Hi,
I have created a program in RoboDK using the API and now want to run a simulation of that program to check if it looks OK. Since the program is a little larger I do not want to watch it in real time and therefore tried to speed up the simulation. I figured it would be nice if the simulation would take 5min (300s), independently from the actual cycle time.
这是我的程序:

Code:
rc=PrintProgram.Update(check_collisions, timeout_sec, mm_step, deg_step)
cycTime=rc[1]
simTime=float(300)
speed=cycTime/simTime
RDK.setSimulationSpeed(speed)
run_mode = 1
RDK.setRunMode(run_mode)
code = 'Print_project'
code_is_fcn_call = False
RDK.RunCode(code,code_is_fcn_call)
估计周期时间1:34:03, therefore my simulation speed should be 18.81 to achieve a simulation time of 300s. When I run the simulation as shown above, it does not really seem to run faster than real time. Can you help me out here?
#2
Hi David,

You can improve the simulation time and make it more accurate by changing this setting:
  1. Tools-Options-Motion tab
  2. Uncheck: Always display robots at the end of each movement
The simulated time will be slightly slower than expected due to the rendering delay. By default, RoboDK displays the robot at the end of every movement instruction. The time to display the screen for these points is not accounted for during the simulation. The steps I provided above will remove this default behavior.

Let me know if it doesn't help.

Albert
#3
Hi Albert,
thanks for the advice. I ran some tests and your settings definitly decrease the simulation time. Nevertheless I think I am going to remove this feature from my application. The best time I could achieve was about 38 minutes. Thinking about what you said about the rendering it probably does not make sense at all to compress the program down to 5 minutes. When dealing with 120k movements that would mean 400 fps. To perform a quick visual validation that way can not work.




Users browsing this thread:
1 Guest(s)