RobotStudio event

[RobotStudio SDK] Difference between Transform.Matrix and Transform.GlobalMatrix

Hi,

I´m trying to understand the diference between Transform.Matrix and Transform.GlobalMatrix. My first idea was Transform.Matrix returns the transformation relative to active work object while Transform.GlobalMatrix returns transformation to world work object, but after some tests this is not true. In fact, I´ve done some test creating work objects (and activating them as active work object) and moving a robtarget and its Frame.Matrix and Frame.GlobalMatrix always match.

So, what is the meaning of this properties?

Thanks in advance.

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.Matrix

    The 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
    ABB
  • 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
    ABB
  • 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.