Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement Idea: Trigger multiple simulation steps at once #6

Closed
Phlogiston90 opened this issue Jul 1, 2019 · 3 comments
Closed
Labels
enhancement New feature or request stale No activity. Will be closed soon.

Comments

@Phlogiston90
Copy link

Phlogiston90 commented Jul 1, 2019

Hi Stephen,

in my particular RL problem, I want to simulate 20 simulation steps before the agent observes the new state, because it drops something and has to see where it lands, which takes longer than 1 simulation step. Increasing the simulation time delta by 20 times obviously doesn't work as this will not consider collisions that might happen in between.
I could imagine that I would not be the only one that has a setting like this.

Sending 20 times PyRep.step() is slow (~210ms in my scene), which is the same time as sending 20 times vrep.simxSynchronousTrigger() in the original VREP python API.
I was able to speed this up by a factor of ~20 times by writing a customization script that executes 20 simulation steps at one call as suggested in http://www.forum.coppeliarobotics.com/viewtopic.php?f=9&t=7926 .
One would have to write a customization script containing

function sysCall_init()
    stepsToRun=0
end

function start20StepRun()
    stepsToRun=20
end

function sysCall_beforeMainScript()
    return {doNotRunMainScript=(stepsToRun==0)}
end

function sysCall_actuation()
    stepsToRun=stepsToRun-1
end

and then don't use the synchronous mode in VREP.
Unfortunately, this doesn't work with PyRep anymore, and I was wondering if you could add this functionality directly into it, e.g. that PyRep.step() accepts the number of steps as a parameter. This would be an awesome functionality and another bonus for PyRep!

Best,
Mark

@stepjam stepjam added the enhancement New feature or request label Jul 1, 2019
@stepjam
Copy link
Owner

stepjam commented Jul 2, 2019

I've looked in to this more and I think I have a plan. I'll have to make the modifications to the V-REP source, so it will take some time before this feature becomes available (in the next public revision of V-REP).

@Phlogiston90
Copy link
Author

That's awesome!!

@stale
Copy link

stale bot commented Jun 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No activity. Will be closed soon. label Jun 27, 2020
@stale stale bot closed this as completed Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale No activity. Will be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants