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

Task PutUmbrellaInUmbrellaStand crashes with BoundaryError #14

Closed
adamconkey opened this issue Oct 28, 2019 · 5 comments
Closed

Task PutUmbrellaInUmbrellaStand crashes with BoundaryError #14

adamconkey opened this issue Oct 28, 2019 · 5 comments

Comments

@adamconkey
Copy link

I got the following terminal output when trying the PutUmbrellaInUmbrellaStand task, which instructed me to raise an issue:

Traceback (most recent call last):
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/task_environment.py", line 71, in reset
    randomly_place=not self._static_positions)
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/backend/scene.py", line 104, in init_episode
    raise e
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/backend/scene.py", line 97, in init_episode
    self._place_task()
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/backend/scene.py", line 386, in _place_task
    min_rotation=min_rot, max_rotation=max_rot)
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/backend/spawn_boundary.py", line 172, in sample
    raise BoundaryError('Could not place within boundary.'
rlbench.backend.exceptions.BoundaryError: Could not place within boundary.Perhaps the object is too big for it?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "collect_rlbench_data.py", line 94, in <module>
    collect_demos(env, [task_class_name], h5_root, args.demos_per_task, len(args.task))
  File "collect_rlbench_data.py", line 37, in collect_demos
    demo = task.get_demos(1, live_demos=True)[0]
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/task_environment.py", line 239, in get_demos
    demos = self._get_live_demos(amount)
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/task_environment.py", line 248, in _get_live_demos
    self.reset()
  File "/home/adam/venv3/lib/python3.5/site-packages/rlbench/task_environment.py", line 76, in reset
    % self._task.get_name()) from e
rlbench.task_environment.TaskEnvironmentError: Could not place the task put_umbrella_in_umbrella_stand in the scene. This should not happen, please raise an issues on this task.

Here are the snippets from my code that are relevant:

obs_config = ObservationConfig()
obs_config.set_all(True)
action_mode = ActionMode(ArmActionMode.ABS_JOINT_VELOCITY)
env = Environment(action_mode, obs_config=obs_config, headless=args.headless)
env.launch()

task = env.get_task(PutUmbrellaInUmbrellaStand)
demo = task.get_demos(1, live_demos=True)[0]

My system:

  • Ubuntu 16.04
  • Python 3.5 (in virtual environment using venv)
  • V-REP 3.6.2
@stepjam
Copy link
Owner

stepjam commented Oct 30, 2019

Hi,
Thanks for raising. What happens if you run your script a few times? Does it always give this error?

Best,
Stephen

@adamconkey
Copy link
Author

No it's not every time. The demo = task.get_demos(1, live_demos=True)[0] line is actually in a for loop that tries to get 100 demos in a row (note I only get 1 at a time because I'm rendering a progress bar on the terminal). I can sometimes collect 15-20 demos before I get the error.

I can post my full code if that's helpful but I think I picked out the parts that are RLBench-specific.

@adamconkey
Copy link
Author

I just got the same error for OpenBox as well after successfully getting 18 demos.

@stepjam
Copy link
Owner

stepjam commented Oct 31, 2019

Hi Adam,
OK, so first let me explain why this is happening. When you get a demo, the task is placed randomly inside the workspace boundary. RLBench does this by sampling. Sometimes you can get unlucky and get bad samples and if it samples too many times, it assume the task has been badly designed. But I know that the 2 tasks you refer to are fine, so I either need to increase the sampling threshold, or I need to adjust the task so it doesn't reach the current threshold.
Regardless, for now I suggest wrapping the get_demos call in a try-catch clause. I'll take a look at the tasks after I get back from CoRL.

@adamconkey
Copy link
Author

Thanks for your help, Stephen. I will note that I'm running data collection on all 100 tasks and I see this error come up occasionally in many of them. The try/except approach works fine though and it often recovers after one error. I put it in a while-loop to make 10 consecutive attempts just to be robust to consecutive errors.

markusgrotz pushed a commit to markusgrotz/RLBench that referenced this issue Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants