allenai / allenai/ai2thor

GetShortestPath

Offen
#1,054 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
1.8k
Forks
297
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi @mattdeitke
I saw the action "GetShortestPath" in allenact and I want to use it in ai2thor. I have set the gridSize=0.25 and snapToGrid=True, but the action return the path ignore the gridSize. Here is part of my code:

```python
controller = Controller(scene="FloorPlan212",
visibilityDistance=1.5,
gridSize=0.25,
snapToGrid=True)

event = controller.step(action="GetReachablePositions")
positions = event.metadata["actionReturn"]
initial_position = random.choice(positions)

event = controller.step(action="GetShortestPath",
objectType='Television',
position=initial_position,
allowedError=0.05)
if event.metadata["lastActionSuccess"]:
shortest_path = event.metadata["actionReturn"]["corners"]
```

Here is some samples of **shortest_path** :

```
{'x': -0.75, 'y': 0.010305345058441162, 'z': 0.0}
{'x': -1.0121546978325568e-07, 'y': 0.010305345058441162, 'z': 5.623087417916395e-08}

{'x': -2.0, 'y': 0.010305345058441162, 'z': -0.5}
{'x': -0.5399999618530273, 'y': 0.010305345058441162, 'z': -0.26999974250793457}
{'x': 0.0, 'y': 0.010305345058441162, 'z': -0.25}

{'x': -3.75, 'y': 0.010305345058441162, 'z': -0.5}
{'x': -0.5399999618530273, 'y': 0.010305345058441162, 'z': -0.26999974250793457}
{'x': 0.0, 'y': 0.010305345058441162, 'z': -0.25}
```

I am wondering if the action "GetShortestPath" still available in ai2thor. I didn't find any code related to this action.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.