Closed Tangolin closed 3 years ago
Hi @Tangolin,
This is by design, the path returned by this function is the ideal path in the scene assuming that an agent has 0 width and can move in any direction. This is mainly meant for use when designing rewards or for creating evaluation metrics.
Generating the shortest path that's actually realizable by the agent would be significantly more difficult given the large variety of different movement types we allow.
Can I ask what you want this shortest path for? At some point I did create an action called ObjectNavExpertAction
which, given an objectType
, returns an action that takes you towards an object of type objectType
(see this being used here). This isn't exactly the shortest path but it does pretty well in practice. Note that this action isn't officially supported though so I can't guarantee it wont disappear in future releases of THOR.
If you're just using 90 degree rotations, one can get the shortest path with a BFS over the reachable positions. Check this out to obtain that: https://github.com/allenai/ai2thor/issues/825#issuecomment-883642953.
But, as @Lucaweihs mentioned, if you're using 30 degree rotations, it is really difficult because the number of reachable positions is substantially larger as the agent isn't defined to a grid of positions.
@Lucaweihs I am trying to use this environment for embodied vision language navigation, so I thought it will be good if the path can actually be realized by the agent to provide a path that is true to the instructions. Bu t I think @mattdeitke 's reference is one that is good enough for me to work with. Thank you both for your help!
Edit 27/07
After experimenting around a bit more, I think the problem is that the paths are not really straight-line paths. If I set snapToGrid=True. The controller is able to navigate according to the route below:
Which means that the function is not using the grid that was initialised in the initial controller, however when I turn snapToGrid=False, the bot is unable to navigate by following a straight line between 2 points because there is actually an obstacle between them. Can I check if this is the intended performance? Because it will be good if the function can supply a path that is actually clearly navigable by a bot following the corner points.
I am currently using RoboTHOR for a navigation task and was trying to create ground truth paths with the aforementioned function. I plotted the ground-truth path returned by the function with the x and z axis and it looks like this:
So I first teleported the controller to the right starting position and its rotation facing the correct direction (~330degrees). However when I tried to do a MoveAhead it returned the error
wall_panel_32_5 (30) is blocking Agent 0 from moving by (-0.0773, 0.0000, 0.2384).
.I have also tried to teleport directly to the next location and it similarly returned an error
ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: Teleport position (2.760000, 0.004511, -3.510000) is not on the grid of size 0.25.
Does this mean that the ground truth path provided by the function is actually not reliable for navigation tasks since it does not take into account obstacles?