Exemplo n.º 1
0
    def test_grammar():
        # Export a (default) robot env. This is necessary because the action server
        # loads knowledge on construction of actions.
        # It is desirable to improve this in the future.
        os.environ["ROBOT_ENV"] = "robotics_testlabs"
        knowledge = load_knowledge('challenge_demo')

        # Construct a Mockbot object and add a number of static entities
        robot = Mockbot()
        robot.ed._static_entities = {
            "couch_table": from_entity_info(EntityInfo(id="couch_table")),
            "operator": from_entity_info(EntityInfo(id="operator")),
        }
        robot.ed._dynamic_entities = dict()
        test_grammar(robot, knowledge.grammar, knowledge.grammar_target)
Exemplo n.º 2
0
    def generate_random_entity(id=None):
            entity_info = EntityInfo()

            if not id:
                entity_info.id = str(hash(entity_info))
            entity_info.type = random.choice(["random_from_magicmock", "human", "coke", "fanta"])
            # entity.data = mock.MagicMock()
            entity_info.data = ""

            entity = from_entity_info(entity_info)
            entity._pose = random_kdl_frame()
            return entity
Exemplo n.º 3
0
    def generate_random_entity(id=None):
            entity_info = EntityInfo()

            if not id:
                entity_info.id = str(hash(entity_info))
            entity_info.type = random.choice(["random_from_magicmock", "human", "coke", "fanta"])
            # entity.data = mock.MagicMock()
            entity_info.data = ""

            entity = from_entity_info(entity_info)
            entity._pose = random_kdl_frame()
            return entity