Esempio n. 1
0
    def setUpClass(cls):
        # simple rooms setup, all rooms are 5x5x3m
        # 5 -------  ---------
        # | kitchen | bedroom |
        # 0---------5---------10

        box1 = BoxVolume(kdl.Vector(0, 0, 0), kdl.Vector(5, 5, 3))

        box2 = BoxVolume(kdl.Vector(0, 0, 0), kdl.Vector(1, 1, 0.5))

        cls.robot = Mockbot()

        cls._kitchen = Entity(
            "kitchen", "room", "/map",
            kdl.Frame(kdl.Rotation.RPY(0, 0, 0), kdl.Vector(0, 0, 0)), None,
            {"in": box1}, ["room"], 0)
        cls._bedroom = Entity(
            "bedroom", "room", "/map",
            kdl.Frame(kdl.Rotation.RPY(0, 0, 0), kdl.Vector(5, 0, 0)), None,
            {"in": box1}, ["room"], 0)
        cls._cabinet = Entity(
            "cabinet", "furniture", "/map",
            kdl.Frame(kdl.Rotation.RPY(0, 0, 0), kdl.Vector(4, 4, 0)), None,
            {"on_top_off": box2}, ["furniture"], 0)
        cls._bookcase = Entity(
            "bookcase", "furniture", "/map",
            kdl.Frame(kdl.Rotation.RPY(0, 0, 0), kdl.Vector(8, 1, 0)), None,
            {"on_top_off": box2}, ["furniture"], 0)

        cls.robot.ed._static_entities = {
            e.id: e
            for e in [cls._kitchen, cls._bedroom, cls._cabinet, cls._bookcase]
        }

        cls.tour_guide = TourGuide(cls.robot)
Esempio n. 2
0
    def setUp(self):
        # simple rooms setup, all rooms are 1x1x3m
        # 1 -------   -----------   -------
        # | kitchen | living_room | hallway |
        # 0---------2-------------3---------4

        box1 = BoxVolume(kdl.Vector(0, 0, 0),
                         kdl.Vector(1, 1, 3))

        entity1 = Entity("kitchen", "room", "/map",
                             kdl.Frame(kdl.Rotation.RPY(0, 0, 0),
                                       kdl.Vector(0, 0, 0)),
                             None, {"in": box1}, None, 0)

        entity2 = Entity("living_room", "room", "/map",
                             kdl.Frame(kdl.Rotation.RPY(0, 0, 0),
                                       kdl.Vector(1, 0, 0)),
                             None, {"in": box1}, None, 0)

        entity3 = Entity("hallway", "room", "/map",
                             kdl.Frame(kdl.Rotation.RPY(0, 0, 0),
                                       kdl.Vector(2, 0, 0)),
                             None, {"in": box1}, None, 0)

        self.room_entities = [entity1, entity2, entity3]
Esempio n. 3
0
    def setUp(self):
        box = BoxVolume(kdl.Vector(0, 0, 0), kdl.Vector(1, 1, 1))

        self.entity = Entity(
            "12345", "dummy", "/map",
            kdl.Frame(kdl.Rotation.RPY(1, 0, 0), kdl.Vector(3, 3, 3)), None,
            {"dummy_volume": box}, None, 0)

        self.area = "dummy_volume"
Esempio n. 4
0
 def resolve(self):
     return Entity(
         identifier="foo",
         object_type=None,
         frame_id="/map",
         pose=kdl.Frame(),
         shape=None,
         volumes={
             "on_top_of":
             BoxVolume(
                 kdl.Vector(-1.0, -1.0, -1.0),
                 kdl.Vector(1.0, 1.0, 1.0),
             )
         },
         super_types=[],
         last_update_time=None,
     )