uwgraphics / relaxed_ik

RelaxedIK Solver
MIT License
186 stars 50 forks source link

UR5's links and collision obstacles not aligned #29

Open LuciAnge opened 2 years ago

LuciAnge commented 2 years ago

Hi, I am running the start_here.py in a ROS Melodic enviroment using Python2.7 to generate all necessary files to use relaxed_ik_core. I am using a modified UR5 urdf (my_ur5.txt) because I need a specific position of end-effector link. Anyway, also with your ur5.urdf the problem that I will present below was the same. All seems fine until step 7. When I display robot platform with collision objects they don't match at all with robot's link. Seen below in the screen shot. How can I fix this?

issue-photo

I assume that when the algorithm calculates distance between links, it actually calculates distance between their approximations (green cylindres). So if they don't match with robot's links all the process is useless. Is it correct? Thank you for your time in advance.

djrakita commented 2 years ago

You are right, it is the green cylinders that trains the collision model. I'll try to figure out what's causing the mis-alignment using the urdf you included. Thanks

LuciAnge commented 2 years ago

Thank you for your reply. I also tried to find a solution for the mis-alignment. Reading your code I figured out the way cylinders are generated. Every cylinder is defined thanks to two points superimposed on joint frames.

issue-photo5

I fixed the mis-alignment editing your code. My solution works only for UR5 and I'm sure it's not the best one. If you have any type of suggestion please let me know. These are the files that I modified collision_utils.py and arm.py.

issue-photo4

Thank you really much for your time.