Hi,
I’m trying to use RTDE communication with robot but i don’t understand how to exchange data with it.
I have made RTDE_REQUEST_PROTOCOL_VERSION and RTDE_GET_URCONTROL_VERSION
Now how should i receive information from controller about robot temperature ecc?
I especially need to understand format of package to send robot
In UR manuals is recommended to use RTDE because other methods are deprecated.
My question is: Have I to write a specific program in robot teach pendant to comunicate or not?
I would read robot state only using a C# program.
Is it possible with RTDE or I need also to write a program on my robot?
You don’t need to do anything special on the robot to retrieve temperature information via RTDE.
RTDE is an advanced protocol that takes time to set up.
If you want to be quick and connect to the robot in just a few lines, you can use this library to quickly obtain RTDE information:
using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Rtde;
var robot = new UR();
var param = new ConnectParameters("192.168.0.1");
// Enable RTDE
param.Rtde.Enable = true;
// Exchange data at 100Hz
param.Rtde.Frequency = 100;
// Select data you want the read from the robot
param.Rtde.OutputSetup.Add(RtdeOutputData.JointTemperatures);
param.Rtde.OutputSetup.Add(RtdeOutputData.ToolTemperature);
// Connect to robot
robot.Connect(param);
// Be notified at 100Hz when data is received
robot.Rtde.OutputDataReceived += Rtde_OutputDataReceived;
////***********
private static void Rtde_OutputDataReceived(object sender, RtdeDataPackageEventArgs e)
{
double jointBaseTemp = e.OutputDataValues.JointTemperatures.Base;
double jointElbowTemp = e.OutputDataValues.JointTemperatures.Elbow;
//double joint...Temp = e.OutputDataValues.JointTemperatures....; // all joints temperature
double toolTemprature = e.OutputDataValues.ToolTemperature;
}