This is part of 2.1.0latest release.

MLxCalcChildUserFrame

0.1.0
since lib: v2.1.0  
math 

Calculate the user frame data (in WORLD) for a child user frame which is defined on a parent user frame.

User frames sent by MotoLogix (using 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.

If the parent user frame changes the child user frame needs to be recalculated and resent as well.

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

child-user-frame
Parent- and child user frame

  • 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

  deGroot

Changes

Added:
  • initial version

Overview

kindnametypedefaultcomment
in_outUserFrameParentMLxAppDataUserFrameinput: parent user frame (in WORLD coordinates). Supports UserFrameType=0 (X/Y/Z/Rx/Ry/Rz) and UserFrameType=1 (ORG/XX/XY)
in_outUserFrameChildMLxAppDataUserFrameinput: child user frame (in UserFrameParent coordinates). Supports UserFrameType=0 (X/Y/Z/Rx/Ry/Rz) and UserFrameType=1 (ORG/XX/XY)
in_outResultMLxAppDataUserFrameoutput: 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).

Used as output

Resulting child user frame data (in WORLD coordinates).

Always using UserFrameType=0 (X/Y/Z/Rx/Ry/Rz)

Implementation

Snippet of the function call:
MLxCalcChildUserFrame(
  UserFrameParent := , 
  UserFrameChild := , 
  Result := );

Pages built with Hugo - 23 Apr 2024 11:54 CEST