Getting Link position
ssickss
✭
in RobotStudio
Good morning,
I am developing an add-in in RobotStudio that needs to extract the position and orientation of Link4, Link5 and Link6 of the robot. Yesterday I tried the following code, but I got some values that were not correct, or at least not where I expected them to be.
This is my code:
I am developing an add-in in RobotStudio that needs to extract the position and orientation of Link4, Link5 and Link6 of the robot. Yesterday I tried the following code, but I got some values that were not correct, or at least not where I expected them to be.
This is my code:
foreach (GraphicComponent gc in robot.GraphicComponents)
{
Logger.AddMessage(new LogMessage(gc.Name + " => X: " + gc.Transform.X + " | Y: " + gc.Transform.Y + " | Z: " + gc.Transform.Z + " | RX : " + gc.Transform.RX + " | RY : " + gc.Transform.RY + " | RZ : " + gc.Transform.RZ));
}
Am I doing it wrong? Is there another way to get this value?
Thanks in advance,
Stefano
Am I doing it wrong? Is there another way to get this value?
Thanks in advance,
Stefano
Tagged:
0
Answers
-
I think i figured it out.
By using Mechanism.GetJointTransform(int index) and passing it the index of the joint you want to find, you will get a matrix with the position and orientation of the joint (its Euler XYZ and Euler ZYX)Post edited by ssickss on0 -
Hello,You can have a look how I update a virtual mechanism with a real one here:
0 -
Hello @DenisFR,
thanks for your time and for your response,
I see that you extracted the robot joints via
Mechanism.GetJointValues()
So I think that this is the correct way to go, to use the values inside Mechanism and not GraphicComponents, so:
*To get joint values of the robot you use Mechanism.GetJointValues(), that returns an array of double as result;
*To get the position and the orientation of the link of the joints you use Mechanism.GetJointTransform(), which gives you a Matrix4 result. Inside of it you can look for Transform and EulerXYZ/EulerZYX rotation values.
0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings