[RobotStudio SDK] Difference between Transform.Matrix and Transform.GlobalMatrix
Comments
-
The general idea is that .Matrix will return the transformation from the object's parent, while GlobalMatrix will return the total transform from the root of the object hierarchy (typically the station).
AFAIK which wobj is active will not affect the result.
For RsTarget, GlobalTransform is internally calculated as follows:
<parent_workobject>.ObjectFrame.GlobalMatrix * <the_rstarget>.Frame.MatrixThe GlobalMatrix is mostly useful when trying to find the relative transform between two unrelated objects in the station - invert one of the global matrices and multiply with the other and you have the relative transform between them.
/Anders
Anders Ekelund
Architect, RobotStudio
ABB0 -
An additional note: RsRobTarget (as opposed to RsTarget) is a bit of a special case. Just like in RAPID, you don't really know where a robtarget is in world coordinates until it is used together with a workobject in a move instruction. That's why we have both the RsRobTarget and RsTarget classes - the former matches the actual RAPID data declaration, while the latter represents a RobTarget used with a Workobject, and can actually be rendered on screen.
The result of this is that RsRobTarget does not really have a GlobalMatrix relative to the station, so you will get it's local matrix back.
/Anders
Anders Ekelund
Architect, RobotStudio
ABB0 -
Ok! Great explanation. So If I want to get the object position relative to a workobject the API doesn´t provides functions to do it, I have to calculate it manually.0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 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