Phylliade / ikpy

IKPy, an Universal Inverse Kinematics library
http://phylliade.github.io/ikpy
Apache License 2.0
733 stars 153 forks source link

ValueError: Unknown joint type: continuous #134

Open gurselturkeri opened 1 year ago

gurselturkeri commented 1 year ago

Hi, I get an error when I run my python script.

Traceback (most recent call last):
  File "/home/gursel/robotics_ws/src/robotic_arm/2_inverse_kinematics_solution.py", line 72, in <module>
    main()
  File "/home/gursel/robotics_ws/src/robotic_arm/2_inverse_kinematics_solution.py", line 64, in main
    joint_trajectory_object = Trajectory_publisher()
  File "/home/gursel/robotics_ws/src/robotic_arm/2_inverse_kinematics_solution.py", line 28, in __init__
    self.robot_initialize(urdf_file)
  File "/home/gursel/robotics_ws/src/robotic_arm/2_inverse_kinematics_solution.py", line 43, in robot_initialize
    self.kuka_robot = ikpy.chain.Chain.from_urdf_file(urdf_file)
  File "/home/gursel/.local/lib/python3.10/site-packages/ikpy/chain.py", line 324, in from_urdf_file
    links = URDF.get_urdf_parameters(urdf_file, base_elements=base_elements, last_link_vector=last_link_vector, base_element_type=base_element_type, symbolic=symbolic)
  File "/home/gursel/.local/lib/python3.10/site-packages/ikpy/urdf/URDF.py", line 250, in get_urdf_parameters
    raise ValueError("Unknown joint type: {}".format(joint_type))
ValueError: Unknown joint type: continuous
Phylliade commented 1 year ago

Hello @gurselturkeri ,

Can you paste your URDF file?

StrangerChamber commented 1 year ago

I'm having the same issue.

here is my urdf file:

<?xml version="1.0"?>

gurselturkeri commented 1 year ago

@StrangerChamber In ros2 humble version it works clearly.

EdgarJRobles commented 4 months ago

I faced the same issue running a urdf from ROS here: https://github.com/ros-industrial/abb/tree/kinetic-devel on webots. webots implement ikpy library to calculate de inverse kinematics.

Heavy industrial robots usually a piston to support 2 axis heavy loads an that why it have invinite revolute ROS called "continuous" joint type.

It looks like there is not definition for continuous joint type on URDF.py ` joint_type = joint.attrib["type"] if joint_type not in ["revolute", "prismatic", "fixed"]: raise ValueError("Unknown joint type: {}".format(joint_type))

    axis = joint.find("axis")
    if axis is not None:
        if joint_type == "revolute":
            rotation = [float(x) for x in axis.attrib["xyz"].split()]
            translation = None
        elif joint_type == "prismatic":
            rotation = None
            translation = [float(x) for x in axis.attrib["xyz"].split()]
        elif joint_type == "fixed":
            warnings.warn(
                "Joint {} is of type: fixed, but has an 'axis' attribute defined. This is not in the URDF spec and thus this axis is ignored".format(
                    joint.attrib["name"]
                )
            )
        else:
            raise ValueError(
                "Unknown joint type with an axis: {}, {}".format(joint_type, axis)
            )

` some definition from ROS here http://wiki.ros.org/urdf/XML/joint

mhortman commented 3 months ago

I think you can replace convolute with revolute, and add some limits on to the revolute, and it should work. I am testing this theory now.

MichaelrMentele commented 1 month ago

Having the same issue -- any update on workaround @mhortman ?

mhortman commented 1 month ago

well doing that got it to parse, but my urdf file doesn't seem to send my arm to the right xyz coordinates, so not 100% sure.

Phylliade commented 1 month ago

Hello everyone,

I will add this feature asap, in the stylé of @mhortman !