stepjam / RLBench

A large-scale benchmark and learning environment.
https://sites.google.com/corp/view/rlbench
Other
1.11k stars 226 forks source link

Add option for additional timesteps at beginning/end of recorded demo #64

Closed adamconkey closed 4 years ago

adamconkey commented 4 years ago

I have an issue with my recorded demos that they seem to stop recording prematurely even though technically the success conditions for the task have been met. For example, it has satisfied the proximity sensor success condition but the robot is still in motion, and I would like at the very end of the demo to be near zero joint velocity and in a static position.

I tried adding a success condition for having zero velocity at a waypoint, but I couldn't get it to work for whatever reason. My new solution is to hack the get_demo function of Scene by adding this to the beginning and end of the demo:

for _ in range(10):
    self.step()
    self._demo_record_step(demo, record, func)

I am wondering if you think it'd be good to make this a feature of the API such that you can parameterize my hack and allow the user to specify how many additional timesteps they want recorded at the start or beginning.

Alternatively, is there a better way to set the success condition for the robot being in a static configuration at a waypoint?

stepjam commented 4 years ago

Hi Adam, Have you used ConditionSet? see here

Here is an example of it being used. In this case, it's checking that the lid is in the prox sensor and that it is still grasped.

Best, Stephen

stepjam commented 4 years ago

Alternatively, is there a better way to set the success condition for the robot being in a static configuration at a waypoint?

The best way, as you suggested, is to have a new success condition for the arm being static. I think this would be a useful success condition to rlbench, so please make a PR :)

adamconkey commented 4 years ago

Hm I didn't know about the ConditionSet, I was under the impression that by registering a list of conditions they would be AND-ed together. I will try the condition set with a static condition and if it works I can submit a PR for the static condition.

stepjam commented 4 years ago

Yes fair point, I agree, they should be AND-ed. Happy to accept a PR for this, otherwise I'll add it on my TODO list to eventually get to.