Position
Read the current joints and the Cartesian position of a Staubli robot, for the flange or a tool, in the world frame or in another frame.
This page shows how to read the current position of a Staubli robot on a CS8 or CS9 controller: the joint values, and the Cartesian position of the flange or of a tool, in the world or in another frame.
Joints and Cartesian position
GetCurrentCartesianJointPosition(robot) returns the joints and the Cartesian position of the flange in the world frame, in one request.
var controller = new StaubliController();controller.Connect("192.168.0.254");// Joints and flange position of the first robot, in one requestCartesianJointPosition position = controller.Soap.GetCurrentCartesianJointPosition(robot: 0);// Joint values, in radiansdouble[] joints = position.JointsPosition;// Flange position in the world frame: X, Y, Z in meters, Rx, Ry, Rz in radiansCartesianPosition flange = position.CartesianPosition;Console.WriteLine($"X={flange.X} Y={flange.Y} Z={flange.Z}");Console.WriteLine($"Rx={flange.Rx} Ry={flange.Ry} Rz={flange.Rz}");controller.Disconnect();}
| Value | Unit |
|---|---|
JointsPosition, one value per axis | radians |
X, Y, Z | meters |
Rx, Ry, Rz | radians |
Joints only
GetCurrentJointPosition(robot) returns only the joint values. Use it when you do not need the Cartesian position.
var controller = new StaubliController();controller.Connect("192.168.0.254");// Only the joints, in radiansdouble[] joints = controller.Soap.GetCurrentJointPosition(robot: 0);for (int i = 0; i < joints.Length; i++)Console.WriteLine($"J{i + 1} = {joints[i] * 180 / Math.PI:F2} deg");controller.Disconnect();}
With a tool and a frame
By default, the Cartesian position is the one of the flange, in the world frame. Pass a tool and a frame to get the position of the tool center point in the frame of your part or table.
tool: position of the tool center point, given in the flange frame.frame: position of the reference frame, given in the world frame.
var controller = new StaubliController();controller.Connect("192.168.0.254");// Tool center point, given in the flange frame: 120 mm along Zvar tool = new CartesianPosition { Z = 0.120 };// Reference frame, given in the world frame: a table 500 mm in front of the robotvar frame = new CartesianPosition { X = 0.500 };CartesianJointPosition position = controller.Soap.GetCurrentCartesianJointPosition(robot: 0, tool, frame);// Position of the tool center point in the table frameCartesianPosition tcp = position.CartesianPosition;controller.Disconnect();}
Pass null (None in Python) for the flange or for the world frame.
Position of a joint configuration
To get the Cartesian position of joint values that are not the current ones, use the forward kinematics: see Kinematics.
Try it in the demo application
Everything on this page can be tried without writing code, in the Get current position page of the demo application.

The demo application is open source. The C# source of this page is CurrentPositionControl.cs.
Reference
Methods of SoapClientBase :// Get the Cartesian position and joint positions of a robotCartesianJointPosition GetCurrentCartesianJointPosition(int robot = 0, CartesianPosition tool = null, CartesianPosition frame = null);// Get the current joint position of a robotdouble[] GetCurrentJointPosition(int robot = 0);
Represents the joint positions and the Cartesian position of a robot end effector.
| Member | Type | Description |
|---|---|---|
CartesianJointPosition() Constructor | ||
CartesianPosition Property | CartesianPosition | The Cartesian position of the robot end effector. |
JointsPosition Property | double[] | The joint positions in radians. |
Equals(object) Method | bool | |
GetHashCode() Method | int | |
ToString() Method | string |
Represents a Cartesian position with X, Y, Z translation and Rx, Ry, Rz rotation components.
| Member | Type | Description |
|---|---|---|
CartesianPosition() Constructor | Initializes a new instance of the CartesianPosition class. | |
Rx Property | double | Rotation around the X axis (radians). |
Ry Property | double | Rotation around the Y axis (radians). |
Rz Property | double | Rotation around the Z axis (radians). |
X Property | double | X translation component (m). |
Y Property | double | Y translation component (m). |
Z Property | double | Z translation component (m). |
Equals(object) Method | bool | |
GetHashCode() Method | int | |
ToString() Method | string |