allenai / allenai/ai2thor

Objects collide when randomly spawned

Open
#303 1 comment 0 reactions 2 assignees Claimed by @AlvaroHG View on GitHub
Controller Initialize Needs Help
Dominant language
C#
Stars
1.8k
Forks
296
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have noticed that sometimes when I use `RandomSpawn` to initialize the environment, certain objects collide in a way that you can barely see one of the two objects. For instance, when Cup and Bread collide, you can barely see Cup since most of its shape is covered by Bread. The details of the colliding instance are:
* Floorplan : `FloorPlan28` (Kitchen Scene)
* Random seed for random spawn : 24225
* Objects that collide :
- `Cup`
- name : `Cup_41873c33`
- objectId : `Cup|-03.54|+00.76|-03.63`
- position : `{'x': -3.54186773, 'y': 0.7607916, 'z': -3.62693739}`
- `Bread`
- name : `Bread_4d72833d`
- objectId : `Bread|-03.61|+00.84|-03.49`
- position : `{'x': -3.60929036, 'y': 0.84152, 'z': -3.48792648}`

Below is the code block I used to initialize the environment:
```
import ai2thor.controller

controller = ai2thor.controller.Controller()
controller.start()

# Object position randomization
controller.reset('FloorPlan28')
controller.step(dict(action='Initialize', gridSize=0.10, visibilityDistance=5.0))
event = controller.step(
dict(
action='InitialRandomSpawn',
randomSeed=24225,
forVisible=False,
numPlacementAttempts=5
)
)
```

Is there a way to prevent this kind of collision?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.