Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running example.py #9

Open
ashwin-97 opened this issue Mar 6, 2022 · 10 comments
Open

Running example.py #9

ashwin-97 opened this issue Mar 6, 2022 · 10 comments

Comments

@ashwin-97
Copy link

Hello
Running the example code throws out an error saying inverse kinematics is not possible for the coordinates

@LiukeyCC
Copy link

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?

@peterwarlg
Copy link

peterwarlg commented Mar 22, 2022

@ashwin-97 @LiukeyCC
just replace the urdf file. what i have done is:

  1. download ur5.urdf.xacro from here,;
  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, 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

@LiukeyCC
Copy link

@peterwarlg
dear, peter
Thanks a lot, I will try it.

@PaulDanielML
Copy link
Owner

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
Copy link
Author

@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.

@peterwarlg
Copy link

@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.

wangzituuu@gmail.com

@xiaopoche1221
Copy link

@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?

@papercut-linkin
Copy link

A downgrade to ikpy==3.1 solved ik problem in my case

@ChristosPeridis
Copy link

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

@giovannicordova
Copy link

@ChristosPeridis, I was able to solve this error by using ikpy==3.3 using the most recent version of numpy (1.24.4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants