Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

How to calculate rotations from a Target

#1
Hi everyone,
I want to work with a base target [abc: -90, 0 , 180]
[Image: aOzWjGP.png]
Using this target I want to move the robot to this position but rotated, so the final movement is [abc: -43.033, -14.679, 164.814] using the rotx, roty and rotz function

[Image: 5zlZyG2.png]

So the difference between the base target and the desired target is [abc: 46.967, -14.679, 15.186]
if I set the rotation like this:

new_target = MoveJ(target * rotx(46.967* pi / 180) * roty (-14.679* pi / 180) * rotz (15.186* pi / 180))

Instead of the desired target I get [abc: -90, 21, 135]

- What's the link between the rotation functions and this result???
- Is this the best way to achieve this?

Thanks for your attention
#2
Hi Nox,

Correct me if I'm wrong, but I believe you are using a Kuka robot.

If it's the case remember that the pose notation is written like this :



So translation in X,Y,Z and then rotation in Z,Y,X.

Considering that, the value in your rotx and rotz should be switched and the order of the rotx and rotz should be switched.

The following code:

Code:
RDK = Robolink()

# Program example:
Target = RDK.Item('Target 3')
print(Target.Name())
print(Pose_2_KUKA(Target.Pose()))

Pose = Target.Pose()*rotz(-46.967*pi/180)*roty(14.679*pi/180)*rotx(-15.186*pi/180)
print(Target.Name()+' Modification')
print(Pose_2_KUKA(Pose))

Will result in :

Code:
C:\Python34\python.exe "C:/Users/Jeremy RoboDK/Desktop/À classer/Test/Test API/Python/Test API.py"
Target 3
(0.0, 0.0, 0.0, -90.0, -0.0, 180.0)
Target 3 Modification
[0.0, 0.0, 0.0, -43.033, -14.678999999999993, 164.814]

Process finished with exit code 0

If you are not familiar with the topic, you should read about Euler angles, how it is used in robotics and how different brands use different rotation formula (Ex: (z,y,x) or (x,y,z) or (z,y,z) etc.).

Hope it helps.
Jeremy




Users browsing this thread:
1 Guest(s)