angelmtenor / RL-ROBOT

Reinforcement Learning framework for Robotics
Other
85 stars 29 forks source link

vrep simulation speed #3

Closed xxx-007 closed 2 years ago

xxx-007 commented 3 years ago

hello,i am using vrep for reinforcement learning ,but my simulation speed is very slow ,i want to know your simulation speed ,in your paper ,only show computational cost of Sample-modeled wander-1K,without any computational cost of vrep simulation . thank you very much,and look forward to you replay!

angelmtenor commented 3 years ago

Hi,

There is no computational cost involved in the real or simulated robot, just the algorithm. In each step. the agent learns & selects the next action in less than 1ms; then sends the action to the simulated or real robot (asynchronously), waits for STEP_TIME, and gets the reached state (by the measured values of the sensors of the robot). The STEP_TIME can be defined in each task, I used 1s for all the cases (needed for the action to change the physical state of the robot). This time was high enough to ignore the <1ms computation time.

To speed up the VREP simulation you can use exp.SPEED_RATE: e.g.: SPEED_RATE = 3.0 # Recommended: REAL ROBOT: 1.0 (x1), VREP: 3.0 (x3) https://github.com/angelmtenor/RL-ROBOT/blob/master/exp.py

Remember to set the same simulation speed on VREP: https://github.com/angelmtenor/RL-ROBOT/tree/master/vrep_scenes

SPEED_RATE higher than 3 in VREP caused delays and experiment issues in my machine (2016).

By the way, I needed to set asynchronous calls to VREP to avoid comm delays : https://github.com/angelmtenor/RL-ROBOT/blob/master/rl_vrep.py (STREAMING/BUFFER)

Good luck!

xxx-007 commented 3 years ago

hi,i try four experience,one is simulating in real time ,multiplication factor is 1,one is simulating in real time , multiplication factor is 3,one is simulating in real time ,multiplication factor is 6,the last one is not simulating in real time ,but these four experiences spend same time,which is to said they have same speed.i am vrey weird!

angelmtenor commented 3 years ago

It's weird, were you able to set the multiplication factors (real-time simulation enabled) in V-REP correctly? I recommend you test your V-REP scenario with no external library first. https://www.coppeliarobotics.com/helpFiles/en/simulationPropertiesDialog.htm

xxx-007 commented 3 years ago

yes , i am able to correctly set the multiplication factors (real-time simulation speed ) in vrep,and I will try my vrep scenario with no external library .

thank you very much ,thank you !