UnderAutomation
有问题吗?

[email protected]

联系我们
UnderAutomation
⌘Q
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.

  • World current position
  • User frame current position
  • Multi-group controllers
  • API reference

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 robot
robot.Connect(parameters);
// Read a current world position
Position worldPosition = robot.Snpx.CurrentPosition.ReadWorldPosition();
// Access the Cartesian position
double x = worldPosition.CartesianPosition.X;
// Access the user tool at this cartesian position
short usertTool = worldPosition.UserTool;
// Access the joint positions
double j1 = worldPosition.JointsPosition.J1;
// Read a current world position of group 2
Position 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 robot
robot.Connect(parameters);
// Read user frame 2 position
Position userFrame = robot.Snpx.CurrentPosition.ReadUserFramePosition(1);
// Access the Cartesian position
double x = userFrame.CartesianPosition.X;
// Access the user tool at this cartesian position
short usertTool = userFrame.UserTool;
// Access the user frame id
short usertFrame = userFrame.UserFrame;
// Access the joint positions
double j1 = userFrame.JointsPosition.J1;
// Read a current world position of group 2
Position 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 2
Position group2Pos = robot.Snpx.CurrentPosition.ReadWorldPosition(2);
// Read user frame position of group 2
Position group2Frame = robot.Snpx.CurrentPosition.ReadUserFramePosition(1, 2);
}
}
Click to see the full code

API reference

Class
Position
C#Python

Robot position with joints and cartesian representations

MemberTypeDescription
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
Class
JointsPosition
C#Python

Joints position in degrees

MemberTypeDescription
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
Class
ExtendedCartesianPositioninherits CartesianPosition
C#Python

Cartesian position with extended axes (E1, E2, E3)

MemberTypeDescription
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
Class
CartesianPositioninherits XYZWPRPosition
C#Python

Fanuc cartesian position and rotations

MemberTypeDescription
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
  • R : Homogeneous 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
Class
XYZPosition
C#Python

Cartesian position X, Y, Z

MemberTypeDescription
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

轻松将 Universal Robots、Fanuc、Yaskawa、ABB 或 Staubli 机器人集成到您的 .NET、Python、LabVIEW 或 Matlab 应用程序中

UnderAutomation
联系我们Legal

© All rights reserved.