top of page

Java 2. Data Structure Description

2.1. Joint Position Data Type

/**
* @brief Joint position data type
*/
public class JointPos
{
  double J1;
  double J2;
  double J3;
  double J4;
  double J5;
  double J6;

  public JointPos(double j1, double j2, double j3, double j4, double j5, double j6)
  {
    J1 = j1;
    J2 = j2;
    J3 = j3;
    J4 = j4;
    J5 = j5;
    J6 = j6;
  }

  public JointPos()
  {

  }
}

2.2. Cartesian Space Position Data Type

/**
* @brief Cartesian space position data type
*/
public class DescTran
{
  public double x = 0.0;    /* X-axis coordinate, unit: mm */
  public double y = 0.0;    /* Y-axis coordinate, unit: mm */
  public double z = 0.0;    /* Z-axis coordinate, unit: mm */
  public DescTran(double posX, double posY, double posZ)
  {
    x = posX;
    y = posY;
    z = posZ;
  }

  public DescTran()
  {

  }

}

2.3. Euler Angle Attitude Data Type

/**
* @brief Euler angle attitude data type
*/
public class Rpy
{
  public double rx = 0.0;   /* Rotation angle around fixed X-axis, unit: deg */
  public double ry = 0.0;   /* Rotation angle around fixed Y-axis, unit: deg */
  public double rz = 0.0;   /* Rotation angle around fixed Z-axis, unit: deg */
  public Rpy(double rotateX, double rotateY, double rotateZ)
  {
    rx = rotateX;
    ry = rotateY;
    rz = rotateZ;
  }
}

2.4. Cartesian Space Pose Data Type

/**
*@brief Cartesian space pose type
*/
public class DescPose
{
  public DescTran tran = new DescTran(0.0, 0.0, 0.0);      /* Cartesian space position */
  public Rpy rpy = new Rpy(0.0, 0.0, 0.0);                         /* Cartesian space attitude */

  public DescPose()
  {

  }

  public DescPose(DescTran descTran, Rpy rotateRpy)
  {
    tran = descTran;
    rpy = rotateRpy;
  }

  public DescPose(double tranX, double tranY, double tranZ, double rX, double ry, double rz)
  {
    tran.x = tranX;
    tran.y = tranY;
    tran.z = tranZ;
    rpy.rx = rX;
    rpy.ry = ry;
    rpy.rz = rz;
  }

  public String toString()
  {
    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);
  }
}

2.5. Extended Axis Position Data Type

/**
* @brief Extended axis position data type
*/
public class ExaxisPos
{
  public double axis1 = 0.0;
  public double axis2 = 0.0;
  public double axis3 = 0.0;
  public double axis4 = 0.0;

  public ExaxisPos()
  {

  }
  public ExaxisPos(double[] exaxisPos)
  {
    axis1 = exaxisPos[0];
    axis2 = exaxisPos[1];
    axis3 = exaxisPos[2];
    axis4 = exaxisPos[3];
  }

  public ExaxisPos(double pos1, double pos2, double pos3, double pos4)
  {
    axis1 = pos1;
    axis2 = pos2;
    axis3 = pos3;
    axis4 = pos4;
  }
}

2.6. Force Torque Sensor Data Type

/**
* @brief Force component and torque component of force sensor
*/
public class ForceTorque
{
  public double fx;  /* Force component along X-axis, unit: N */
  public double fy;  /* Force component along Y-axis, unit: N */
  public double fz;  /* Force component along Z-axis, unit: N */
  public double tx;  /* Torque component around X-axis, unit: Nm */
  public double ty;  /* Torque component around Y-axis, unit: Nm */
  public double tz;  /* Torque component around Z-axis, unit: Nm */
  public ForceTorque(double fX, double fY, double fZ, double tX, double tY, double tZ)
  {
    fx = fX;
    fy = fY;
    fz = fZ;
    tx = tX;
    ty = tY;
    tz = tZ;
  }
}

robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page