Enfeffector rotates 180 degrees when trying to set orientation with direction vector

asked 2022-06-29 12:21:24 -0500

Hello,

I want to orient the robot endeffector using a direction vector that I calculate myself. The robot will always start from the same position with the endeffector pointing straight down. I already have a function that calculates a direction vector that is in the orientation that I want the endeffector to be. I have used the code in this answer to calculate the quaternion from the starting orientation to the goal orientation: https://stackoverflow.com/questions/1.... For some example orientation the quaternion that the code calculates is:

0.38268343 0 0 0.92387953

and the correct quaternion that I want is:

0 0.92387953 0.38268343 0

Unfortunately, when I pass the data on to the robot the robot has the right orientation but spins it's endeffector 180 degrees. My goal is to keep the endeffector from spinning and just rotate around it self in the angle that I want it to. I have multiple questions about this:

  1. What is the reason for the rotation around itself?
  2. How would I make sure the robot only moves to the correct orientation but does not actually change the way the end effector is facing?
  3. How can I control the rotation to make the endeffector rotate at an angle that I want? For example: 20 degrees clock or counter clockwise.

Thanks

edit retag flag offensive close merge delete