This page is only available in English.
Current position
Read the current robot position in world coordinates or user frame coordinates, for single or multi-group controllers.
Read the current robot position in world coordinates or in a specific user frame, for any motion group.
Note: The current position is that of the current tool (UTOOL).
World current position
// Connect to the robotrobot.Connect(parameters);// Read a current world positionPosition worldPosition = robot.Snpx.CurrentPosition.ReadWorldPosition();// Access the Cartesian positiondouble x = worldPosition.CartesianPosition.X;// Access the user tool at this cartesian positionshort usertTool = worldPosition.UserTool;// Access the joint positionsdouble j1 = worldPosition.JointsPosition.J1;// Read a current world position of group 2Position worldPositionG2 = robot.Snpx.CurrentPosition.ReadWorldPosition(2);}
Click to see the full code
User frame current position
ReadUserFramePosition returns the position relative to a specific user frame. Use user frame 15 to get the currently selected user frame from the pendant.
// Connect to the robotrobot.Connect(parameters);// Read user frame 2 positionPosition userFrame = robot.Snpx.CurrentPosition.ReadUserFramePosition(1);// Access the Cartesian positiondouble x = userFrame.CartesianPosition.X;// Access the user tool at this cartesian positionshort usertTool = userFrame.UserTool;// Access the user frame idshort usertFrame = userFrame.UserFrame;// Access the joint positionsdouble j1 = userFrame.JointsPosition.J1;// Read a current world position of group 2Position userFrameG2 = robot.Snpx.CurrentPosition.ReadWorldPosition(2);}
Click to see the full code
Multi-group controllers
For controllers with multiple motion groups (e.g., robot + positioner), specify the group number:
parameters.Snpx.Enable = true;robot.Connect(parameters);// Read world position of group 2Position group2Pos = robot.Snpx.CurrentPosition.ReadWorldPosition(2);// Read user frame position of group 2Position group2Frame = robot.Snpx.CurrentPosition.ReadUserFramePosition(1, 2);}}
Click to see the full code
API reference
Robot position with joints and cartesian representations
| Member | Type | Description |
|---|---|---|
Position() Constructor | Default constructor | |
Position(short, short, JointsPosition, ExtendedCartesianPosition) Constructor | Constructor with user frame, tool, joints and cartesian position | |
CartesianPosition Property | ExtendedCartesianPosition | Cartesian position with extended axes |
JointsPosition Property | JointsPosition | Joint values in degrees |
UserFrame Property | short | User frame index |
UserTool Property | short | User tool index |
Equals(object) Method | bool | |
GetHashCode() Method | int | |
ToString() Method | string |
Joints position in degrees
| Member | Type | Description |
|---|---|---|
JointsPosition() Constructor | Default constructor | |
JointsPosition(double, double, double, double, double, double) Constructor | Constructor with 6 joint values in degrees | |
JointsPosition(double, double, double, double, double, double, double, double, double) Constructor | Constructor with 9 joint values in degrees | |
JointsPosition(double[]) Constructor | Constructor from an array of joint values in degrees | |
this[int] Property | double | Gets or sets the joint value at the specified index |
J1 Property | double | Joint 1 in degrees |
J2 Property | double | Joint 2 in degrees |
J3 Property | double | Joint 3 in degrees |
J4 Property | double | Joint 4 in degrees |
J5 Property | double | Joint 5 in degrees |
J6 Property | double | Joint 6 in degrees |
J7 Property | double | Joint 7 in degrees |
J8 Property | double | Joint 8 in degrees |
J9 Property | double | Joint 9 in degrees |
Values Property read only | double[] | Numeric values for each joints |
Equals(object) Method | bool | |
GetHashCode() Method | int | |
IsNear(JointsPosition, JointsPosition, double) Method static | bool | Check if joints position is near to expected joints position with a tolerance value |
ToString() Method | string |
Cartesian position with extended axes (E1, E2, E3)
| Member | Type | Description |
|---|---|---|
ExtendedCartesianPosition() Constructor | Default constructor | |
ExtendedCartesianPosition(double, double, double, double, double, double, double, double, double) Constructor | Constructor with position, rotations, and extended axes | |
E1 Property | double | Extended axis 1 value |
E2 Property | double | Extended axis 2 value |
E3 Property | double | Extended axis 3 value |
Equals(object) Method | bool | |
GetHashCode() Method | int | |
ToString() Method | string |
Fanuc cartesian position and rotations
| Member | Type | Description |
|---|---|---|
CartesianPosition() Constructor | Default constructor | |
CartesianPosition(double, double, double, double, double, double) Constructor | Constructor with position and rotations | |
CartesianPosition(double, double, double, double, double, double, Configuration) Constructor | Constructor with position, rotations and configuration | |
CartesianPosition(CartesianPosition) Constructor | Copy constructor | |
CartesianPosition(XYZPosition, double, double, double) Constructor | Constructor from an XYZ position with rotations | |
Configuration Property | Configuration | Position configuration |
Equals(object) Method | bool | |
FromHomogeneousMatrix(double[,]) Method static | CartesianPosition | Create a CartesianPosition with unknow configuration from a homogeneous rotation and translation 4x4 matrix
|
GetHashCode() Method | int | |
IsNear(CartesianPosition, CartesianPosition, double, double) Method static | bool | Check if two Cartesian positions are near each other within specified tolerances |
NormalizeAngle(double) Method static | double | Normalize an angle to the range ]-180, 180] |
NormalizeAngles(CartesianPosition) Method static | void | Normalize the W, P, R angles to the range ]-180, 180] |
ToHomogeneousMatrix() Method | double[,] | Convert position to a homogeneous rotation and translation 4x4 matrix |
ToString() Method | string |
Cartesian position X, Y, Z
| Member | Type | Description |
|---|---|---|
XYZPosition() Constructor | Default constructor | |
XYZPosition(double, double, double) Constructor | Constructor with X, Y, Z coordinates in millimeters | |
X Property | double | X coordinate in millimeters |
Y Property | double | Y coordinate in millimeters |
Z Property | double | Z coordinate in millimeters |
Equals(object) Method | bool | |
GetHashCode() Method | int | |
ToString() Method | string |