Calculate the user frame data (in WORLD) for a child user frame which is defined on a parent user frame.
MLxRobotSetUserFrame
) always
reference to WORLD.If you want to create a user frame which references to another user frame instead of WORLD it has to be transformed to WORLD using this function.
Example
Imagine below situation where the child user frame is on the surface of a
cylinder. This cylinder can rotate.
The parent-child setup makes it very easy to recalculate the child user
frame after the cylinder has rotated (parent Rz
axis).
- The parent user frame is defined as
X=1000
(in WORLD) - The child user frame is defined as
Y=-500, Z=125, Rx=90
(in parent user frame) - Child user frame transformed to WORLD:
X=1000, Y=-500, Z=125, Rx=90
// - parent is defined in UserFrameParent
// - child is defined (on top of the parent) in ChildDefinition
// - store the resulting user frame of the child in UserFrameChild
// define the parent user frame (using WORLD coordinates)
// (can also be defined using ORG/XX/XY)
UserFrameParent.CoordFrame[0] := 1000; // X
UserFrameParent.CoordFrame[1] := 0; // Y
UserFrameParent.CoordFrame[2] := 0; // Z
UserFrameParent.CoordFrame[3] := 0; // Rx
UserFrameParent.CoordFrame[4] := 0; // Ry
UserFrameParent.CoordFrame[5] := 0; // Rz
// define the child user frame (using parent user frame coordinates)
// (can also be defined using ORG/XX/XY)
ChildDefinition.CoordFrame[0] := 0;
ChildDefinition.CoordFrame[1] := -500;
ChildDefinition.CoordFrame[2] := 125;
ChildDefinition.CoordFrame[3] := 90;
ChildDefinition.CoordFrame[4] := 0;
ChildDefinition.CoordFrame[5] := 0;
MLxCalcChildUserFrame(
UserFrameParent := UserFrameParent,
UserFrameChild := ChildDefinition,
Result := UserFrameChild);
// result
// UserFrameChild.CoordFrame[0] := 1000;
// UserFrameChild.CoordFrame[1] := -500;
// UserFrameChild.CoordFrame[2] := 125;
// UserFrameChild.CoordFrame[3] := 90;
// UserFrameChild.CoordFrame[4] := 0;
// UserFrameChild.CoordFrame[5] := 0;
Version history
0.1.0
Changes
- initial version
Overview
kind | name | type | default | comment |
---|---|---|---|---|
in_out | UserFrameParent | MLxAppDataUserFrame | input: parent user frame (in WORLD coordinates). Supports UserFrameType=0 (X/Y/Z/Rx/Ry/Rz) and UserFrameType=1 (ORG/XX/XY) | |
in_out | UserFrameChild | MLxAppDataUserFrame | input: child user frame (in UserFrameParent coordinates). Supports UserFrameType=0 (X/Y/Z/Rx/Ry/Rz) and UserFrameType=1 (ORG/XX/XY) | |
in_out | Result | MLxAppDataUserFrame | output: resulting child user frame (in WORLD coordinates). Always using UserFrameType=0 (X/Y/Z/Rx/Ry/Rz) |
Details
UserFrameParent
MLxAppDataUserFrame
Used as input
Parent user frame data.
Supports both UserFrameType=0
(X/Y/Z/Rx/Ry/Rz)
and UserFrameType=1
(ORG/XX/XY).
UserFrameChild
MLxAppDataUserFrame
Used as input
Child user frame data.
Supports both UserFrameType=0
(X/Y/Z/Rx/Ry/Rz)
and UserFrameType=1
(ORG/XX/XY).
Result
MLxAppDataUserFrame
Used as output
Resulting child user frame data (in WORLD coordinates).
Always using UserFrameType=0
(X/Y/Z/Rx/Ry/Rz)
Implementation
MLxCalcChildUserFrame(
UserFrameParent := ,
UserFrameChild := ,
Result := );