Giter Site home page Giter Site logo

Comments (4)

mathfac avatar mathfac commented on May 20, 2024

We don't have such tutorial yet.

from habitat-lab.

gianscarpe avatar gianscarpe commented on May 20, 2024

Hi! Is this still of any interests?

from habitat-lab.

rpartsey avatar rpartsey commented on May 20, 2024

Hi @eric-xw @gianscarpe

If you are still interested in using the VectorEnv for shortest path following, this should be pretty easy to implement.

You may define a thin wrapper around of the Env class (let's say, SPFEnv) that should have attributes env (Env instance) and spf (ShortestPathFollower instance). SPFEnv will translate SPFEnv.step(any_action) to Env.step(spf.get_next_action()).

from habitat.tasks.nav.shortest_path_follower import ShortestPathFollower

class SPFEnv(Env):
    def __init__(self, config, goal_radius):
        super().__init__(config)
        self.shortest_path_follower = ShortestPathFollower(
            sim=self.sim,
            goal_radius=goal_radius,
            return_one_hot=False
        )

    def step(self, action):
        best_action = self.shortest_path_follower.get_next_action(
            self.current_episode.goals[0].position
        )
        return super().step(best_action)

Then using VectorEnv you could create as many instances of SPFEnv as you need. For more details on how to use VectorEnv you may check PPOTrainer implementation.

from habitat-lab.

rpartsey avatar rpartsey commented on May 20, 2024

Closing due to inactivity. Feel free to re-open the issue, if you still have questions.

from habitat-lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.