facebookresearch / habitat-sim

A flexible, high-performance 3D simulator for Embodied AI research.
https://aihabitat.org/
MIT License
2.45k stars 404 forks source link

Unable to Navigate to Random Navigable Point #2414

Open yrraadi-io opened 2 weeks ago

yrraadi-io commented 2 weeks ago

I'm working with the home-robot repository currently and as part of the project I'm experimenting with navigating to random points in my current environment using find_path method in GreedyGeodesicFollower.

  1. Initializing ShortestPathFollower: self.spf = ShortestPathFollower(sim, 0.25, False) Where I'm passing sim=self._env.habitat_env.env._sim

  2. Getting a random navigable point:

    self.spf._build_follower()
    goal_pos = self.spf._follower.pathfinder.get_random_navigable_point(10)
  3. Finding path to the point (In a seperate method by passing goal_pos)

    self.spf._build_follower()
    next_action = self.spf._follower.find_path(goal_pos=goal_pos)

However, this results in the following error:

raise errors.GreedyFollowerError()
habitat_sim.errors.GreedyFollowerError

I'm unable to understand why it's not able to generate a series of actions that will take me to the "random navigable point". And if it's not navigable, why is it being returned when I'm trying to find my "random navigable point".

Appreciate any clarification.

yvsriram commented 2 weeks ago

Hi Yash,

Are you facing issue with the first episode you try?

If yes, maybe you want to check if goal_pos and current_position are on the same navmesh island?

For a point, you can use this to get island it is on: https://aihabitat.org/docs/habitat-sim/habitat_sim.nav.PathFinder.html#get_island-70760

And you can pass island index to random_navigable_point to island_index

yrraadi-io commented 2 weeks ago

Thank you for the pointers. I will try this. Yes I am facing the issue with the first episode I try.

As a follow up, I tried generating a get_random_navigable_point_near my agent's current position (state.position). I tried this on one episode (790) and then used find_path to get a series of actions. That worked, it gave me a list of 30 actions or so. But, upon following those actions I ended up at a different point as the random navigable point near that I generated. I know this since I logged those points.

Happy to share more details if you feel that will be helpful!