Neural-SLAM
Neural-SLAM copied to clipboard
get_sim_location
Hello, I don't know why X and y need minus signs
def get_sim_location(self): agent_state = super().habitat_env.sim.get_agent_state(0) x = -agent_state.position[2] y = -agent_state.position[0] axis = quaternion.as_euler_angles(agent_state.rotation)[0] if (axis%(2*np.pi)) < 0.1 or (axis%(2*np.pi)) > 2*np.pi - 0.1: o = quaternion.as_euler_angles(agent_state.rotation)[1] else: o = 2*np.pi - quaternion.as_euler_angles(agent_state.rotation)[1] if o > np.pi: o -= 2 * np.pi return x, y, o