MuJoCo_RL_UR5
MuJoCo_RL_UR5 copied to clipboard
Running example.py
Hello Running the example code throws out an error saying inverse kinematics is not possible for the coordinates
Hello, I also encountered the same problem when I downloaded this code for the second time, prompting ' x0
is infeasible.
Could not find an inverse kinematics solution. '
Did you solve it?
@ashwin-97 @LiukeyCC just replace the urdf file. what i have done is:
- download
ur5.urdf.xacro
from here,; - run
rosrun xacro xacro ur5.urdf.xacro > ur5.urdf
in where u downloadur5.urdf.xacro
to get a urdf file - change the original
ur5_gripper.urdf
withur5.urdf
- or u can just use the file ur5.txt, and change
.txt
to.urdf
i thought it will works fine if you try all the steps above, but i have also did some other change since i got some warnings, all the changes are in MujocoController.py
:
- in line 41, it seems the robot only control 5 DOF, so change
self.create_group("Arm", list(range(5)))
toself.create_group("Arm", list(range(6)))
- in line 47, change
self.ee_chain = ...
toself.ee_chain = ikpy.chain.Chain.from_urdf_file(path + "/UR5+gripper/ur5.urdf",active_links_mask=[False, True, True, True, True, True, True, False])
. (u may got a warnning if u not change, but it works fine though) - in line 509, change
joint_angles = joint_angles[1:-2]
tojoint_angles = joint_angles[1:-1]
, so u get to control all the 6 joint
Hello Running the example code throws out an error saying inverse kinematics is not possible for the coordinates
@peterwarlg dear, peter Thanks a lot, I will try it.
Hi everyone sorry for the late reply. Unfortunately, I do not have the time to still keep the repo updated, there are quite a few things I would change if I were to do it again. The inverse kinematic solver I used was implemented in another repository, and sometimes failed to calculate joint angles for coordinates that the robot EE should be able to reach. Have you tried changing the target coordinates? I saw that the ikpy repo is also still being updated, it is possible that a breaking change was introduced, which could be a problem since I did not pin the dependency version. In that case downgrading the ikpy version might also help.
@ashwin-97 @LiukeyCC just replace the urdf file. what i have done is:
1. download `ur5.urdf.xacro` from [here](https://github.com/ros-industrial/universal_robot/tree/kinetic-devel/ur_description/urdf),; 2. run `rosrun xacro xacro ur5.urdf.xacro > ur5.urdf` in where u download `ur5.urdf.xacro` to get a urdf file 3. change the original `ur5_gripper.urdf` with `ur5.urdf` 4. or u can just use the file [ur5.txt](https://github.com/PaulDanielML/MuJoCo_RL_UR5/files/8324908/ur5.txt), and change `.txt` to `.urdf`
i thought it will works fine if you try all the steps above, but i have also did some other change since i got some warnings, all the changes are in
MujocoController.py
:1. in **line 41**, it seems the robot only control 5 DOF, so change `self.create_group("Arm", list(range(5)))` to `self.create_group("Arm", list(range(6)))` 2. in **line 47**, change ` self.ee_chain = ...` to `self.ee_chain = ikpy.chain.Chain.from_urdf_file(path + "/UR5+gripper/ur5.urdf",active_links_mask=[False, True, True, True, True, True, True, False])`. (u may got a warnning if u not change, but it works fine though) 3. in **line 509**, change `joint_angles = joint_angles[1:-2]` to `joint_angles = joint_angles[1:-1]`, so u get to control all the 6 joint
Hello Running the example code throws out an error saying inverse kinematics is not possible for the coordinates
Hello Peter Can I get your email ID, I had some more things to ask.
@ashwin-97 @LiukeyCC just replace the urdf file. what i have done is:
1. download `ur5.urdf.xacro` from [here](https://github.com/ros-industrial/universal_robot/tree/kinetic-devel/ur_description/urdf),; 2. run `rosrun xacro xacro ur5.urdf.xacro > ur5.urdf` in where u download `ur5.urdf.xacro` to get a urdf file 3. change the original `ur5_gripper.urdf` with `ur5.urdf` 4. or u can just use the file [ur5.txt](https://github.com/PaulDanielML/MuJoCo_RL_UR5/files/8324908/ur5.txt), and change `.txt` to `.urdf`
i thought it will works fine if you try all the steps above, but i have also did some other change since i got some warnings, all the changes are in
MujocoController.py
:1. in **line 41**, it seems the robot only control 5 DOF, so change `self.create_group("Arm", list(range(5)))` to `self.create_group("Arm", list(range(6)))` 2. in **line 47**, change ` self.ee_chain = ...` to `self.ee_chain = ikpy.chain.Chain.from_urdf_file(path + "/UR5+gripper/ur5.urdf",active_links_mask=[False, True, True, True, True, True, True, False])`. (u may got a warnning if u not change, but it works fine though) 3. in **line 509**, change `joint_angles = joint_angles[1:-2]` to `joint_angles = joint_angles[1:-1]`, so u get to control all the 6 joint
Hello Running the example code throws out an error saying inverse kinematics is not possible for the coordinates
Hello Peter Can I get your email ID, I had some more things to ask.
@ashwin-97 @LiukeyCC just replace the urdf file. what i have done is:
1. download `ur5.urdf.xacro` from [here](https://github.com/ros-industrial/universal_robot/tree/kinetic-devel/ur_description/urdf),; 2. run `rosrun xacro xacro ur5.urdf.xacro > ur5.urdf` in where u download `ur5.urdf.xacro` to get a urdf file 3. change the original `ur5_gripper.urdf` with `ur5.urdf` 4. or u can just use the file [ur5.txt](https://github.com/PaulDanielML/MuJoCo_RL_UR5/files/8324908/ur5.txt), and change `.txt` to `.urdf`
i thought it will works fine if you try all the steps above, but i have also did some other change since i got some warnings, all the changes are in
MujocoController.py
:1. in **line 41**, it seems the robot only control 5 DOF, so change `self.create_group("Arm", list(range(5)))` to `self.create_group("Arm", list(range(6)))` 2. in **line 47**, change ` self.ee_chain = ...` to `self.ee_chain = ikpy.chain.Chain.from_urdf_file(path + "/UR5+gripper/ur5.urdf",active_links_mask=[False, True, True, True, True, True, True, False])`. (u may got a warnning if u not change, but it works fine though) 3. in **line 509**, change `joint_angles = joint_angles[1:-2]` to `joint_angles = joint_angles[1:-1]`, so u get to control all the 6 joint
Hello Running the example code throws out an error saying inverse kinematics is not possible for the coordinates
Hello Peter Can I get your email ID, I had some more things to ask.
Does it work? I modified it according to this. There are still questions, what version of IKPY are you using?
A downgrade to ikpy==3.1 solved ik problem in my case
Dear @papercut-linkin which version of numpy did you use because I am receiving the following error when downgrading to ikpy==3.1
module 'numpy' has no attribute 'float'.
np.float
was a deprecated alias for the builtin float
. To avoid this error in existing code, use float
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64
here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Could not find an inverse kinematics solution.
Thank you very much for your valuable help!
Christos Peridis
@ChristosPeridis, I was able to solve this error by using ikpy==3.3 using the most recent version of numpy (1.24.4).