Esempio n. 1
0
class MoverTests(unittest.TestCase):
    def setUp(self):
        # Good starting global pos to not casue collisons
        INIT = (4.8, 0.16, 0)
        self.agent = LoCoBotMover(ip=IP, backend="habitat")
        self.agent.bot.go_to_absolute(INIT, close_loop=False)

    def test_move_relative(self):
        for task_pos in [(0, 0, 0), (0, -0.1, 1.0), (0, 0.1, 0),
                         (-0.1, -0.1, -1.0)]:
            initial_state = self.agent.bot.get_base_state(state_type="odom")
            self.agent.move_relative([task_pos])
            assert_distance_moved(
                initial_state,
                self.agent.bot.get_base_state(state_type="odom"), task_pos)

    def test_turn(self):
        # turn a set of a angles
        turns_in_degrees = [0, 45, 90, -90, 180]
        for x in turns_in_degrees:
            init = self.agent.bot.get_base_state(state_type="odom")
            self.agent.turn(x)
            final = self.agent.bot.get_base_state(state_type="odom")
            assert_turn_degree(init[2], final[2], x)
Esempio n. 2
0
 def init_physical_interfaces(self):
     """Instantiates the interface to physically move the robot."""
     self.mover = LoCoBotMover(ip=self.opts.ip, backend=self.opts.backend, use_dslam=self.opts.use_dslam)
Esempio n. 3
0
 def setUp(self):
     # Good starting global pos to not casue collisons
     INIT = (4.8, 0.16, 0)
     self.agent = LoCoBotMover(ip=IP, backend="habitat")
     self.agent.bot.go_to_absolute(INIT, close_loop=False)
Esempio n. 4
0
 def setUp(self) -> None:
     m_agent = MagicMock()
     m_agent.mover = LoCoBotMover(ip=IP, backend="habitat")
     self.input_handler = InputHandler(m_agent, read_from_camera=True)
Esempio n. 5
0
 def setUp(self) -> None:
     m_agent = MagicMock()
     m_agent.mover = LoCoBotMover(ip=IP, backend="habitat")
     self.input_handler = InputHandler(m_agent, read_from_camera=True)
     self.perception = SlowPerception(PERCEPTION_MODELS_DIR)