def test_detach_object(self, function_setup): """ :type parsed_base_bot: self.cls """ parsed_base_bot = self.cls(base_bot_urdf()) parsed_base_bot.detach_sub_tree(u'rot_z') assert len(parsed_base_bot.get_link_names()) == 3 assert len(parsed_base_bot.get_joint_names()) == 2 assert u'rot_z' not in parsed_base_bot.get_joint_names() assert u'eef' not in parsed_base_bot.get_link_names()
def test_attach_obj_with_link_name(self, function_setup): parsed_base_bot = self.cls(base_bot_urdf()) box = self.cls.from_world_body(make_world_body_box(u'eef')) p = Pose() p.position = Point(0, 0, 0) p.orientation = Quaternion(0, 0, 0, 1) try: parsed_base_bot.attach_urdf_object(box, u'eef', p) assert False, u'didnt get expected exception' except DuplicateNameException as e: assert True
def test_attach_to_non_existing_link(self, function_setup): parsed_base_bot = self.cls(base_bot_urdf()) box = self.cls.from_world_body(make_world_body_box()) p = Pose() p.position = Point(0, 0, 0) p.orientation = Quaternion(0, 0, 0, 1) try: parsed_base_bot.attach_urdf_object(box, u'muh', p) assert False, u'didnt get expected exception' except UnknownBodyException: assert True
def test_attach_urdf_object2(self, function_setup): parsed_base_bot = self.cls(base_bot_urdf()) links_before = set(parsed_base_bot.get_link_names()) joints_before = set(parsed_base_bot.get_joint_names()) donbot = make_urdf_world_body(u'mustafa', donbot_urdf()) donbot_obj = self.cls.from_world_body(donbot) p = Pose() p.position = Point(0, 0, 0) p.orientation = Quaternion(0, 0, 0, 1) parsed_base_bot.attach_urdf_object(donbot_obj, u'eef', p) assert donbot_obj.get_root() in parsed_base_bot.get_link_names() assert set(parsed_base_bot.get_link_names()).difference( links_before.union(set(donbot_obj.get_link_names()))) == set() assert set(parsed_base_bot.get_joint_names()).difference( joints_before.union(set( donbot_obj.get_joint_names()))) == {u'mustafa'} links = [l.name for l in parsed_base_bot.get_urdf_robot().links] assert len(links) == len(set(links)) joints = [j.name for j in parsed_base_bot.get_urdf_robot().joints] assert len(joints) == len(set(joints))
def test_get_joint_limits4(self, function_setup): parsed_base_bot = self.cls(base_bot_urdf()) lower_limit, upper_limit = parsed_base_bot.get_joint_limits(u'joint_x') assert lower_limit == -3 assert upper_limit == 3
def parsed_base_bot(function_setup): """ :rtype: Robot """ return Robot(base_bot_urdf())
def test_create_object(self, function_setup): parsed_base_bot = self.cls(base_bot_urdf()) assert_num_pybullet_objects(1) assert u'pointy' in pbw.get_body_names()