2. Data Structure Description

2.1. Joint Position Data Type

 1/**
 2* @brief Joint position data type
 3*/
 4public class JointPos
 5{
 6  double J1;
 7  double J2;
 8  double J3;
 9  double J4;
10  double J5;
11  double J6;
12
13  public JointPos(double j1, double j2, double j3, double j4, double j5, double j6)
14  {
15    J1 = j1;
16    J2 = j2;
17    J3 = j3;
18    J4 = j4;
19    J5 = j5;
20    J6 = j6;
21  }
22
23  public JointPos()
24  {
25
26  }
27}

2.2. Cartesian Space Position Data Type

 1/**
 2* @brief Cartesian space position data type
 3*/
 4public class DescTran
 5{
 6  public double x = 0.0;    /* X-axis coordinate, unit: mm */
 7  public double y = 0.0;    /* Y-axis coordinate, unit: mm */
 8  public double z = 0.0;    /* Z-axis coordinate, unit: mm */
 9  public DescTran(double posX, double posY, double posZ)
10  {
11    x = posX;
12    y = posY;
13    z = posZ;
14  }
15
16  public DescTran()
17  {
18
19  }
20
21}

2.3. Euler Angle Attitude Data Type

 1/**
 2* @brief Euler angle attitude data type
 3*/
 4public class Rpy
 5{
 6  public double rx = 0.0;   /* Rotation angle around fixed X-axis, unit: deg */
 7  public double ry = 0.0;   /* Rotation angle around fixed Y-axis, unit: deg */
 8  public double rz = 0.0;   /* Rotation angle around fixed Z-axis, unit: deg */
 9  public Rpy(double rotateX, double rotateY, double rotateZ)
10  {
11    rx = rotateX;
12    ry = rotateY;
13    rz = rotateZ;
14  }
15}

2.4. Cartesian Space Pose Data Type

 1/**
 2*@brief Cartesian space pose type
 3*/
 4public class DescPose
 5{
 6  public DescTran tran = new DescTran(0.0, 0.0, 0.0);      /* Cartesian space position */
 7  public Rpy rpy = new Rpy(0.0, 0.0, 0.0);                         /* Cartesian space attitude */
 8
 9  public DescPose()
10  {
11
12  }
13
14  public DescPose(DescTran descTran, Rpy rotateRpy)
15  {
16    tran = descTran;
17    rpy = rotateRpy;
18  }
19
20  public DescPose(double tranX, double tranY, double tranZ, double rX, double ry, double rz)
21  {
22    tran.x = tranX;
23    tran.y = tranY;
24    tran.z = tranZ;
25    rpy.rx = rX;
26    rpy.ry = ry;
27    rpy.rz = rz;
28  }
29
30  public String toString()
31  {
32    return String.valueOf(tran.x) + "," + String.valueOf(tran.y) + "," + String.valueOf(tran.z) + "," + String.valueOf(rpy.rx) + "," + String.valueOf(rpy.ry) + "," + String.valueOf(rpy.rz);
33  }
34}

2.5. Extended Axis Position Data Type

 1/**
 2* @brief Extended axis position data type
 3*/
 4public class ExaxisPos
 5{
 6  public double axis1 = 0.0;
 7  public double axis2 = 0.0;
 8  public double axis3 = 0.0;
 9  public double axis4 = 0.0;
10
11  public ExaxisPos()
12  {
13
14  }
15  public ExaxisPos(double[] exaxisPos)
16  {
17    axis1 = exaxisPos[0];
18    axis2 = exaxisPos[1];
19    axis3 = exaxisPos[2];
20    axis4 = exaxisPos[3];
21  }
22
23  public ExaxisPos(double pos1, double pos2, double pos3, double pos4)
24  {
25    axis1 = pos1;
26    axis2 = pos2;
27    axis3 = pos3;
28    axis4 = pos4;
29  }
30}

2.6. Force Torque Sensor Data Type

 1/**
 2* @brief Force component and torque component of force sensor
 3*/
 4public class ForceTorque
 5{
 6  public double fx;  /* Force component along X-axis, unit: N */
 7  public double fy;  /* Force component along Y-axis, unit: N */
 8  public double fz;  /* Force component along Z-axis, unit: N */
 9  public double tx;  /* Torque component around X-axis, unit: Nm */
10  public double ty;  /* Torque component around Y-axis, unit: Nm */
11  public double tz;  /* Torque component around Z-axis, unit: Nm */
12  public ForceTorque(double fX, double fY, double fZ, double tX, double tY, double tZ)
13  {
14    fx = fX;
15    fy = fY;
16    fz = fZ;
17    tx = tX;
18    ty = tY;
19    tz = tZ;
20  }
21}

2.7. Spiral Parameter Data Type

 1/**
 2* @brief Spiral parameter data type
 3*/
 4public class SpiralParam
 5{
 6    public int circle_num;           /* Number of spiral turns  */
 7    public double circle_angle;         /* Spiral pitch angle  */
 8    public double rad_init;             /* Initial spiral radius, in mm  */
 9    public double rad_add;              /* Radius increment  */
10    public double rotaxis_add;          /* Rotation axis increment  */
11    public int rot_direction;  /* Rotation direction: 0-clockwise, 1-counterclockwise  */
12    public int velAccMode;     /* Velocity acceleration parameter mode: 0-constant angular velocity; 1- Constant linear velocity */
13    public SpiralParam(int circleNum, double circleAngle, double radInit, double radAdd, double rotaxisAdd, int rotDirection, int vel_AccMode)
14    {
15        circle_num = circleNum;
16        circle_angle = circleAngle;
17        rad_init = radInit;
18        rad_add = radAdd;
19        rotaxis_add = rotaxisAdd;
20        rot_direction = rotDirection;
21        velAccMode=vel_AccMode;
22    }
23}

2.8. Extended Axis Status Type

 1/**
 2* @brief Extended axis status type
 3*/
 4public class EXT_AXIS_STATUS
 5{
 6 public double pos = 0;        // Extended axis position
 7 public double vel = 0;        // Extended axis velocity
 8 public int errorCode = 0;     // Extended axis error code
 9 public int ready = 0;        // Servo ready
10 public int inPos = 0;        // Servo in position
11 public int alarm = 0;        // Servo alarm
12 public int flerr = 0;        // Following error
13 public int nlimit = 0;       // Negative limit reached
14 public int pLimit = 0;       // Positive limit reached
15 public int mdbsOffLine = 0;  // Driver 485 bus offline
16 public int mdbsTimeout = 0;  // Communication timeout between control card and control box via 485
17 public int homingStatus = 0; // Extended axis homing status
18}

2.9. Sensor Type

 1/**
 2* @brief Sensor type
 3*/
 4public class DeviceConfig
 5{
 6  int company = 0;          // Manufacturer
 7  int device = 0;           // Type/device number
 8  int softwareVersion = 0;  // Software version
 9  int bus = 0;              // Mounting location
10
11  public DeviceConfig()
12  {
13
14  }
15
16  public DeviceConfig(int company, int device, int softwareVersion, int bus)
17  {
18    this.company = company;
19    this.device = device;
20    this.softwareVersion = softwareVersion;
21    this.bus = bus;
22  }
23}

2.10. 485 Extended Axis Configuration

 1/**
 2* @brief 485 extended axis configuration
 3*/
 4public class Axis485Param
 5{
 6  int servoCompany;           // Servo driver manufacturer, 1-DynaTech
 7  int servoModel;             // Servo driver model, 1-FD100-750C
 8  int servoSoftVersion;       // Servo driver software version, 1-V1.0
 9  int servoResolution;        // Encoder resolution
10  double axisMechTransRatio;  // Mechanical transmission ratio
11
12  public Axis485Param(int company, int model, int softVersion, int resolution, double mechTransRatio)
13  {
14    servoCompany = company;
15    servoModel = model;
16    servoSoftVersion = softVersion;
17    servoResolution = resolution;
18    axisMechTransRatio = mechTransRatio;
19  }
20
21  public Axis485Param()
22  {
23
24  }
25}

2.11. Servo Controller Status

 1/**
 2* @brief Servo controller status
 3*/
 4public class ROBOT_AUX_STATE
 5{
 6  public int servoId = 0;           // Servo driver ID
 7  public int servoErrCode = 0;       // Servo driver error code
 8  public int servoState = 0;         // Servo driver status
 9  public double servoPos = 0;        // Current servo position
10  public float servoVel = 0;         // Current servo velocity
11  public float servoTorque = 0;      // Current servo torque
12}

2.12. Welding Breakoff Status

1/**
2* @brief Welding breakoff status
3*/
4public class WELDING_BREAKOFF_STATE
5{
6  public int breakOffState = 0;  // Welding breakoff status
7  public int weldArcState = 0;   // Welding arc breakoff status
8}

2.13. UDP Extended Axis Communication Parameters

 1/**
 2* @brief UDP extended axis communication parameters
 3*/
 4public class UDP_EXT_AXIS_PARAM
 5{
 6  public String ip = "192.168.58.88"; // IP address
 7  public int port = 2021;            // Port number
 8  public int period = 2;             // Communication period (ms, default is 2, do not modify this parameter)
 9  public int lossPkgTime = 50;       // Packet loss detection time (ms)
10  public int lossPkgNum = 2;         // Number of packet losses
11  public int disconnectTime = 100;   // Communication disconnection confirmation duration
12  public int reconnectEnable = 0;    // Communication disconnection auto-reconnect enable 0-disable 1-enable
13  public int reconnectPeriod = 100;  // Reconnection interval (ms)
14  public int reconnectNum = 3;       // Number of reconnection attempts
15  public int selfConnect = 0;       // Whether to automatically establish connection after power restart; 0-do not establish connection; 1-establish connection
16}

2.14. Robot State Feedback Structure Type

  1/**
  2* @brief  Robot status feedback structure type
  3*/
  4public class ROBOT_STATE_PKG {
  5    public int frame_head;                      // Frame header
  6    public int frame_cnt;                       // Frame count
  7    public int data_len;                        // Data length
  8    public int program_state;                   // Program status - 1-stopped; 2-running; 3-paused
  9    public int robot_state;                     // Robot motion status - 1-stopped; 2-running; 3-paused; 4-dragging
 10    public int main_code;                       // Main fault code
 11    public int sub_code;                        // Sub fault code
 12    public int robot_mode;                      // Robot mode - 1-manual mode; 0-automatic mode
 13    public double[] jt_cur_pos = new double[6]; // Current joint positions of 6 axes, unit deg
 14    public double[] tl_cur_pos = new double[6]; // Current tool position - [x,y,z,rx,ry,rz]
 15    public double[] flange_cur_pos = new double[6]; // Current end flange position - [x,y,z,rx,ry,rz]
 16    public double[] actual_qd = new double[6];  // Current velocities of 6 joints, unit deg/s
 17    public double[] actual_qdd = new double[6]; // Current accelerations of 6 joints, unit deg/s^2
 18    public double[] target_TCP_CmpSpeed = new double[2]; // TCP composite command speed - [position mm/s, orientation deg/s]
 19    public double[] target_TCP_Speed = new double[6]; // TCP command speed - [vx,vy,vz,wx,wy,wz]
 20    public double[] actual_TCP_CmpSpeed = new double[2]; // TCP composite actual speed - [position mm/s, orientation deg/s]
 21    public double[] actual_TCP_Speed = new double[6]; // TCP actual speed - [vx,vy,vz,wx,wy,wz]
 22    public double[] jt_cur_tor = new double[6]; // Current joint torque
 23    public int tool;                            // Tool ID
 24    public int user;                            // Workpiece ID
 25    public int cl_dgt_output_h;                 // Control cabinet digital output high byte
 26    public int cl_dgt_output_l;                 // Control cabinet digital output low byte
 27    public int tl_dgt_output_l;                 // Tool digital output low byte
 28    public int cl_dgt_input_h;                  // Control cabinet digital input high byte
 29    public int cl_dgt_input_l;                  // Control cabinet digital input low byte
 30    public int tl_dgt_input_l;                  // Tool digital input low byte
 31    public int[] cl_analog_input = new int[2];  // Control cabinet analog input
 32    public int tl_anglog_input;                 // Tool analog input
 33    public double[] ft_sensor_raw_data = new double[6]; // Force sensor raw data
 34    public double[] ft_sensor_data = new double[6]; // Force sensor data
 35    public int ft_sensor_active;                // Force sensor activation status
 36    public int EmergencyStop;                   // Emergency stop status
 37    public int motion_done;                     // Motion completed
 38    public int gripper_motiondone;              // Gripper motion completed
 39    public int mc_queue_len;                    // Motion queue length
 40    public int collisionState;                  // Collision status
 41    public int trajectory_pnum;                 // Trajectory point sequence number
 42    public int safety_stop0_state;              // Safety stop 0 status
 43    public int safety_stop1_state;              // Safety stop 1 status
 44    public int gripper_fault_id;                // Gripper fault ID
 45    public int gripper_fault;                   // Gripper fault
 46    public int gripper_active;                  // Gripper activation
 47    public int gripper_position;                // Gripper position
 48    public int gripper_speed;                   // Gripper speed
 49    public int gripper_current;                 // Gripper current
 50    public int gripper_temp;                    // Gripper temperature
 51    public int gripper_voltage;                 // Gripper voltage
 52    public AuxState aux_state = new AuxState(); // Internal auxiliary axis status
 53    public EXT_AXIS_STATUS[] extAxisStatus = new EXT_AXIS_STATUS[4]; // Extension axis status array
 54    public short[] extDIState = new short[8];   // Extended I/O
 55    public short[] extDOState = new short[8];   // Extended I/O
 56    public short[] extAIState = new short[4];   // Extended I/O
 57    public short[] extAOState = new short[4];   // Extended I/O
 58    public int rbtEnableState;                  // Robot enable status
 59    public double[] jointDriverTorque = new double[6]; // Joint driver torque
 60    public double[] jointDriverTemperature = new double[6]; // Joint driver temperature
 61    public ROBOT_TIME robotTime = new ROBOT_TIME(); // Robot time object
 62    public int softwareUpgradeState;            // Software upgrade status
 63    public int endLuaErrCode;                   // End Lua error code
 64    public int[] cl_analog_output = new int[2]; // Control cabinet analog output
 65    public int tl_analog_output;                // Tool analog output
 66    public float gripperRotNum;                 // Rotating gripper rotation count
 67    public int gripperRotSpeed;                 // Rotating gripper speed
 68    public int gripperRotTorque;                // Rotating gripper torque
 69    public WELDING_BREAKOFF_STATE weldingBreakOffState = new WELDING_BREAKOFF_STATE(); // Welding interruption status
 70    public double[] jt_tgt_tor = new double[6]; // Target joint torque
 71    public int smartToolState;                  // Smart tool status
 72    public float wideVoltageCtrlBoxTemp;        // Wide voltage control box temperature
 73    public int wideVoltageCtrlBoxFanCurrent;    // Wide voltage control box fan current
 74    public double[] toolCoord = new double[6];  // Tool coordinate system
 75    public double[] wobjCoord = new double[6];  // Workpiece coordinate system
 76    public double[] extoolCoord = new double[6]; // External tool coordinate system
 77    public double[] exAxisCoord = new double[6]; // Extension axis coordinate system
 78    public double load;                         // Payload
 79    public double[] loadCog = new double[3];    // Load center of gravity
 80    public double[] lastServoTarget = new double[6]; // Last servo J target position
 81    public int servoJCmdNum;                    // Servo J command count
 82    public double[] targetJointPos = new double[6]; // Target joint position
 83    public double[] targetJointVel = new double[6]; // Target joint velocity
 84    public double[] targetJointAcc = new double[6]; // Target joint acceleration
 85    public double[] targetJointCurrent = new double[6]; // Target joint current
 86    public double[] actualJointCurrent = new double[6]; // Actual joint current
 87    public double[] actualTCPForce = new double[6]; // Actual TCP force
 88    public double[] targetTCPPos = new double[6]; // Target TCP position
 89    public int[] collisionLevel = new int[6];   // Collision level
 90    public double speedScaleManual;              // Manual speed scale
 91    public double speedScaleAuto;                // Automatic speed scale
 92    public int luaLineNum;                       // Lua line number
 93    public int abnomalStop;                      // Abnormal stop
 94    public String currentLuaFileName;            // Current Lua file name
 95    public int programTotalLine;                 // Total program lines
 96    public int[] safetyBoxSingal = new int[6];   // Safety box signal
 97    public double weldVoltage;                   // Welding voltage
 98    public double weldCurrent;                   // Welding current
 99    public double weldTrackVel;                  // Welding tracking speed
100    public int tpdException;                     // TPD exception
101    public int alarmRebootRobot;                 // Alarm reboot robot
102    public int modbusMasterConnect;              // Modbus master connection
103    public int modbusSlaveConnect;               // Modbus slave connection
104    public int btnBoxStopSignal;                 // Button box stop signal
105    public int dragAlarm;                        // Drag alarm
106    public int safetyDoorAlarm;                  // Safety door alarm
107    public int safetyPlaneAlarm;                 // Safety plane alarm
108    public int motonAlarm;                       // Motion alarm
109    public int interfaceAlarm;                   // Interference alarm
110    public int udpCmdState;                      // UDP command status
111    public int weldReadyState;                   // Welding ready status
112    public int alarmCheckEmergStopBtn;           // Alarm check emergency stop button
113    public int tsTmCmdComError;                  // Command communication error
114    public int tsTmStateComError;                // Status communication error
115    public int ctrlBoxError;                     // Control box error
116    public int safetyDataState;                  // Safety data status
117    public int forceSensorErrState;              // Force sensor error status
118    public int[] ctrlOpenLuaErrCode = new int[4]; // Control open Lua error code
119    public int strangePosFlag;                   // Singular position flag
120    public int alarm;                            // Alarm
121    public int driverAlarm;                      // Driver alarm
122    public int aliveSlaveNumError;               // Alive slave count error
123    public int[] slaveComError = new int[8];     // Slave communication error
124    public int cmdPointError;                    // Command point error
125    public int IOError;                          // IO error
126    public int gripperError;                     // Gripper error
127    public int fileError;                        // File error
128    public int paraError;                        // Parameter error
129    public int exaxisOutLimitError;              // Extension axis soft limit exceeded error
130    public int[] driverComError = new int[6];    // Driver communication error
131    public int driverError;                      // Driver error
132    public int outSoftLimitError;                // Soft limit exceeded error
133    public byte[] axleGenComData = new byte[130]; // General axis communication data
134    public int check_sum;                        // Checksum
135    public int socketConnTimeout;                // Socket connection timeout
136    public int socketReadTimeout;                // Socket read timeout
137    public int tsWebStateComErr;                 // TS Web state communication error
138}

2.15. Robot Status Feedback Configuration Result Class

1/**
2* Robot status feedback configuration result class, containing status list and period
3*/
4public static class StateConfigResult {
5  public final List<RobotState> stateList;
6  public final int period;
7}

2.16. Robot Status Feedback Configuration Enumeration Type

  1/**
  2* Robot status enumeration type
  3* Used for real-time status feedback configuration
  4*/
  5public enum RobotState {
  6    ProgramState,
  7    RobotState,
  8    MainCode,
  9    SubCode,
 10    RobotMode,
 11    JointCurPos,
 12    ToolCurPos,
 13    FlangeCurPos,
 14    ActualJointVel,
 15    ActualJointAcc,
 16    TargetTCPCmpSpeed,
 17    TargetTCPSpeed,
 18    ActualTCPCmpSpeed,
 19    ActualTCPSpeed,
 20    ActualJointTorque,
 21    Tool,
 22    User,
 23    ClDgtOutputH,
 24    ClDgtOutputL,
 25    TlDgtOutputL,
 26    ClDgtInputH,
 27    ClDgtInputL,
 28    TlDgtInputL,
 29    ClAnalogInput,
 30    TlAnglogInput,
 31    FtSensorRawData,
 32    FtSensorData,
 33    FtSensorActive,
 34    EmergencyStop,
 35    MotionDone,
 36    GripperMotiondone,
 37    McQueueLen,
 38    CollisionState,
 39    TrajectoryPnum,
 40    SafetyStop0State,
 41    SafetyStop1State,
 42    GripperFaultId,
 43    GripperFault,
 44    GripperActive,
 45    GripperPosition,
 46    GripperSpeed,
 47    GripperCurrent,
 48    GripperTemp,
 49    GripperVoltage,
 50    AuxState,
 51    ExtAxisStatus,
 52    ExtDIState,
 53    ExtDOState,
 54    ExtAIState,
 55    ExtAOState,
 56    RbtEnableState,
 57    JointDriverTorque,
 58    JointDriverTemperature,
 59    RobotTime,
 60    SoftwareUpgradeState,
 61    EndLuaErrCode,
 62    ClAnalogOutput,
 63    TlAnalogOutput,
 64    GripperRotNum,
 65    GripperRotSpeed,
 66    GripperRotTorque,
 67    WeldingBreakOffState,
 68    TargetJointTorque,
 69    SmartToolState,
 70    WideVoltageCtrlBoxTemp,
 71    WideVoltageCtrlBoxFanCurrent,
 72    ToolCoord,
 73    WobjCoord,
 74    ExtoolCoord,
 75    ExAxisCoord,
 76    Load,
 77    LoadCog,
 78    LastServoTarget,
 79    ServoJCmdNum,
 80    TargetJointPos,
 81    TargetJointVel,
 82    TargetJointAcc,
 83    TargetJointCurrent,
 84    ActualJointCurrent,
 85    ActualTCPForce,
 86    TargetTCPPos,
 87    CollisionLevel,
 88    SpeedScaleManual,
 89    SpeedScaleAuto,
 90    LuaLineNum,
 91    AbnomalStop,
 92    CurrentLuaFileName,
 93    ProgramTotalLine,
 94    SafetyBoxSingal,
 95    WeldVoltage,
 96    WeldCurrent,
 97    WeldTrackVel,
 98    TpdException,
 99    AlarmRebootRobot,
100    ModbusMasterConnect,
101    ModbusSlaveConnect,
102    BtnBoxStopSignal,
103    DragAlarm,
104    SafetyDoorAlarm,
105    SafetyPlaneAlarm,
106    MotonAlarm,
107    InterfaceAlarm,
108    UdpCmdState,
109    WeldReadyState,
110    AlarmCheckEmergStopBtn,
111    TsTmCmdComError,
112    TsTmStateComError,
113    SocketConnTimeout,
114    SocketReadTimeout,
115    TsWebStateComErr,
116    CtrlBoxError,
117    SafetyDataState,
118    ForceSensorErrState,
119    CtrlOpenLuaErrCode,
120    StrangePosFlag,
121    Alarm,
122    DriverAlarm,
123    AliveSlaveNumError,
124    SlaveComError,
125    CmdPointError,
126    IOError,
127    GripperError,
128    FileError,
129    ParaError,
130    ExaxisOutLimitError,
131    DriverComError,
132    DriverError,
133    OutSoftLimitError,
134    AxleGenComData;
135}