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

Issues with Simulation Performance and Time Measurement in RoboDK

#1
I am using RoboDK for a relatively large-scale simulation. To reduce the load on my PC, I currently use the following configuration:
Code:
RDK.Render(False)
RDK.setRunMode(RUNMODE_SIMULATE)
RDK.setRunMode(RUNMODE_QUICKVALIDATE) # Movements
RDK.setSimulationSpeed(100)
However, sometimes the program seems to encounter issues. For example, the optimal cost graph appears completely flat, and I cannot understand why, especially when Render = True is enabled. Could there be some kind of conflict between these commands?
Additionally, I am trying to measure simulation time, but I want to obtain real execution time, not the scaled simulation time. For example, if the real execution time is 4 seconds and I set the simulation speed to 100×, I don’t want to get 0.04 seconds but still 4 seconds.
Is there a function in RoboDK that allows me to retrieve the real execution time?
Thank you!
#2
I don't recommend you to use the Run Mode RUNMODE_QUICKVALIDATE as this won't account for timings and speeds. Instead, I recommend you to use this lower level commands:
  1. Block render by setting the Render command to 0. This will speed up the simulation preventing the render event.
  2. You should set render back on using the API, this is not done automatically. Otherwise, the screen will remain black.
  3. You can retrieve the simulated time regardless of the simulation speed you use by using the SimulationTime command.
Example:
Code:
RDK.Command("Render", 0) # Turn off render
RDK.Command("SimulationSpeed", 1000) # Set a fast simulation speed
# ... perform your simulation
# Request the simulated time:
print("Simulated time is: ")
print(RDK.Command("SimulationTime"))
# ...
RDK.Command("Render", 0) # Set render back on
What do you mean by the "optimal cost graph"?
#3
I'm solving a TSP problem and the cost graph of the optimal path turns out to be completely flat only with certain configurations of the previous commands.
For example, when using RUNMODE_QUICKVALIDATE, the graph is flat.
I don't understand the correlation between these two things, but it somehow has an impact.
#4
OK that makes sense. Then, why don't you use the travel distance required to travel between any 2 points? You could involve joints displacement making it the sum of all joint displacements?
  




Users browsing this thread:
1 Guest(s)