Esempio n. 1
0
    def get_observation(self, env: RoboThorEnvironment,
                        task: Optional[PointNavTask], *args: Any,
                        **kwargs: Any) -> Any:

        agent_state = env.agent_state()
        agent_position = np.array([agent_state[k] for k in ["x", "y", "z"]])
        rotation_world_agent = self.quaternion_from_y_angle(
            agent_state["rotation"]["y"])

        goal_position = np.array(
            [task.task_info["target"][k] for k in ["x", "y", "z"]])

        return self._compute_pointgoal(agent_position, rotation_world_agent,
                                       goal_position)
Esempio n. 2
0
 def _create_environment(self) -> RoboThorEnvironment:
     env = RoboThorEnvironment(**self.env_args)
     return env
Esempio n. 3
0
 def _create_environment(self) -> RoboThorEnvironment:
     assert (self.env_args["agentCount"] == 2
             ), "NavToPartner is only defined for 2 agents!"
     env = RoboThorEnvironment(**self.env_args)
     return env