stepjam / RLBench

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

How can I control the task sample? #79

Closed superggb closed 4 years ago

superggb commented 4 years ago

In the imitation_learning example, the script will sample several demos as data to train. If I want to control the sample data, for example choosing a specified location to place the red ball to reach-target. Is there a convinient way to sample the demos I want?

stepjam commented 4 years ago

You can override tasks and add/edit behaviour. For example, in your case, you could do something like this:

class ReachTarget(Task):

    def init_episode(self, index: int) -> List[str]:
         desc = super(ReachTarget, self).init_episode(index)
         # explicit set the positions, e.g.
         self.target.set_pose(...)
         return desc

Then when you create the rlbench env, you can pass static_positions=True, which will disable automatic task placement.