Exemplo n.º 1
0
    def test_urdf_load(self):
        rp.models.wx250s()
        rp.models.UR5()
        rp.models.Panda()

        try:
            xacro.main("")
        except BaseException:
            pass
Exemplo n.º 2
0
    def test_urdf_dynamics(self):

        urdf_string = xacro.main(
            "roboticstoolbox/models/xacro/franka_description/robots/panda_arm_hand.urdf.xacro"
        )
        urdf = URDF.loadstr(
            urdf_string,
            "roboticstoolbox/models/xacro/franka_description/robots/panda_arm_hand.urdf.xacro"
        )

        self.assertEqual(urdf.joints[0].limit.effort, 87.0)
        self.assertEqual(urdf.joints[0].limit.velocity, 2.175)

        try:
            xacro.main("")
        except BaseException:
            pass
Exemplo n.º 3
0
    def urdf_to_ets_args(file_path):
        name, ext = splitext(file_path)

        if ext == '.xacro':
            urdf_string = xacro.main(file_path)
            urdf = URDF.loadstr(urdf_string, file_path)

        return urdf.elinks, urdf.name
Exemplo n.º 4
0
    def test_urdf_visuals(self):

        urdf_string = xacro.main(
            "roboticstoolbox/models/xacro/franka_description/robots/panda_arm_hand.urdf.xacro"
        )
        urdf = URDF.loadstr(
            urdf_string,
            "roboticstoolbox/models/xacro/franka_description/robots/panda_arm_hand.urdf.xacro"
        )

        urdf.links[0].visuals[0].name = "Lonk"
        self.assertTrue(urdf.links[0].visuals[0].name == "Lonk")

        self.assertTrue(isinstance(urdf.links[0].visuals[0].origin,
                                   np.ndarray))

        urdf.links[0].visuals[0].geometry.box = rp.backend.urdf.Box([1, 2, 3])
        self.assertTrue(
            isinstance(urdf.links[0].visuals[0].geometry.geometry,
                       rp.backend.urdf.Box))

        urdf.links[0].visuals[0].geometry.cylinder = \
            rp.backend.urdf.Cylinder(1, 2)

        urdf.links[0].visuals[0].geometry.sphere = \
            rp.backend.urdf.Sphere(2)

        nt.assert_array_almost_equal(
            urdf.links[0].visuals[0].geometry.box.size, [1, 2, 3])

        self.assertEqual(urdf.links[0].visuals[0].geometry.cylinder.radius, 1)

        self.assertEqual(urdf.links[0].visuals[0].geometry.sphere.radius, 2)

        self.assertTrue(
            isinstance(urdf.links[0].visuals[0].geometry.mesh,
                       rp.backend.urdf.Mesh))

        try:
            xacro.main("")
        except BaseException:
            pass
Exemplo n.º 5
0
    def test_urdf_collisions(self):

        urdf_string = xacro.main(
            "roboticstoolbox/models/xacro/franka_description/robots/panda_arm_hand.urdf.xacro"
        )
        urdf = URDF.loadstr(
            urdf_string,
            "roboticstoolbox/models/xacro/franka_description/robots/panda_arm_hand.urdf.xacro"
        )

        urdf.links[0].collisions[0].name = "Lonk"
        self.assertTrue(urdf.links[0].collisions[0].name == "Lonk")

        self.assertTrue(
            isinstance(urdf.links[0].collisions[0].origin, np.ndarray))

        try:
            xacro.main("")
        except BaseException:
            pass