top of page

Java 6.38. Set joint friction compensation coefficient - side installation

/**
* @brief Set joint friction compensation coefficient - side installation
* @param [in] coeff Six joint compensation coefficients, range [0~1]
* @return Error code
*/
int SetFrictionValue_wall(Object[] coeff);

6.39. Set joint friction compensation coefficient - inverted installation

/**
* @brief Set joint friction compensation coefficient - inverted installation
* @param [in] coeff Six joint compensation coefficients, range [0~1]
* @return Error code
*/
int SetFrictionValue_ceiling(Object[] coeff);

6.40. Set joint friction compensation coefficient - free installation

/**
* @brief Set joint friction compensation coefficient - free installation
* @param [in] coeff Six joint compensation coefficients, range [0~1]
* @return Error code
*/
int SetFrictionValue_freedom(Object[] coeff);

6.41. Robot set joint friction compensation code example

public static int TestFriction(Robot robot)
{

    Object[] lcoeff = { 0.9,0.9,0.9,0.9,0.9,0.9 };
    Object[] wcoeff = { 0.4,0.4,0.4,0.4,0.4,0.4 };
    Object[] ccoeff = { 0.6,0.6,0.6,0.6,0.6,0.6 };
    Object[] fcoeff = { 0.5,0.5,0.5,0.5,0.5,0.5 };

    int rtn = robot.FrictionCompensationOnOff(1);
    System.out.println("FrictionCompensationOnOff rtn is:"+ rtn);

    rtn = robot.SetFrictionValue_level(lcoeff);
    System.out.println("SetFrictionValue_level rtn is:"+ rtn);

    rtn = robot.SetFrictionValue_wall(wcoeff);
    System.out.println("SetFrictionValue_wall rtn is:"+ rtn);

    rtn = robot.SetFrictionValue_ceiling(ccoeff);
    System.out.println("SetFrictionValue_ceiling rtn is:"+ rtn);

    rtn = robot.SetFrictionValue_freedom(fcoeff);
    System.out.println("SetFrictionValue_freedom rtn is:"+ rtn);

    robot.CloseRPC();
    return 0;
}

6.42. Query robot error code

/**
 * @brief Query robot error code
 * @param [out] maincode Main error code
 * @param [out] subcode Sub error code
 * @return Error code
 */
int GetRobotErrorCode(int[] maincode, int[] subcode);

6.43. Error state clear

/**
* @brief Error state clear
* @return Error code
*/
int ResetAllError();

6.44. Robot fault state get and clear error code example

public static int TestGetError(Robot robot)
{
    int[] maincode={0}, subcode={0};
    robot.GetRobotErrorCode(maincode, subcode);

    robot.ResetAllError();

    robot.Sleep(1000);

    robot.GetRobotErrorCode(maincode, subcode);
    return 0;
}

6.45. Set wide voltage control box temperature and fan speed monitoring parameters

New in version Java: SDK-v1.0.6-3.8.3

/**
* @brief Set wide voltage control box temperature and fan speed monitoring parameters
* @param [in] enable 0-disable monitoring; 1-enable monitoring
* @param [in] period Monitoring period(s), range 1-100
* @return Error code
*/
int SetWideBoxTempFanMonitorParam(int enable, int period);

6.46. Get wide voltage control box temperature and fan speed monitoring parameters

New in version Java: SDK-v1.0.6-3.8.3

/**
* @brief Get wide voltage control box temperature and fan speed monitoring parameters
* @return List[0]-Error code,List[1]-enable 0-disable monitoring; 1-enable monitoring,List[2]-period Monitoring period(s), range 1-100
*/
List<Number> GetWideBoxTempFanMonitorParam()

6.47. Wide voltage control box temperature and fan current state get code example

public static void TestWideVoltageCtrlBoxtemp(Robot robot)
{
    robot.SetWideBoxTempFanMonitorParam(1, 2);
    List<Number> list=robot.GetWideBoxTempFanMonitorParam();
    System.out.println("GetWideBoxTempFanMonitorParam enable is:"+list.get(1)+", period is:"+list.get(2));
    ROBOT_STATE_PKG pkg=new ROBOT_STATE_PKG();
    for (int i = 0; i < 100; i++)
    {
        pkg=robot.GetRobotRealTimeState();
        System.out.println("robot ctrl box temp is:"+pkg.wideVoltageCtrlBoxTemp+",fan current is:"+pkg.wideVoltageCtrlBoxFanCurrent);
        robot.Sleep(100);
    }

    int rtn = robot.SetWideBoxTempFanMonitorParam(0, 2);

    list=robot.GetWideBoxTempFanMonitorParam();
    for (int i = 0; i < 100; i++)
    {
        pkg=robot.GetRobotRealTimeState();
        System.out.println("robot ctrl box temp is:"+pkg.wideVoltageCtrlBoxTemp+" ,fan current is:"+pkg.wideVoltageCtrlBoxFanCurrent);
        robot.Sleep(100);
    }

    robot.CloseRPC();
    robot.Sleep(2000);
    return 0;
}

6.48. Set Focus Calibration Point

New in version Java: SDK-v1.0.7-3.8.4

/**
* @brief Set focus calibration point
* @param [in] pointNum Focus calibration point number (1-8)
* @param [in] point    Calibration point coordinates
* @return Error code
*/
int SetFocusCalibPoint(int pointNum, DescPose point)

6.49. Compute Focus Calibration Result

New in version Java: SDK-v1.0.7-3.8.4

/**
* @brief Compute focus calibration result
* @param [in] pointNum  Number of calibration points
* @param [in] resultPos Calibration result XYZ
* @param [out] accuracy  Calibration accuracy error
* @return Error code
*/
int ComputeFocusCalib(int pointNum, DescTran resultPos, double[] accuracy)

6.50. Start focus following

New in version Java: SDK-v1.0.7-3.8.4

/**
* @brief Start focus following
* @param [in] kp       Proportional parameter (default: 50.0)
* @param [in] kpredict Feedforward parameter (default: 19.0)
* @param [in] aMax     Maximum angular acceleration limit (default: 1440°/s²)
* @param [in] vMax     Maximum angular velocity limit (default: 180°/s)
* @param [in] type     Lock X-axis direction (0-Reference input vector; 1-Horizontal; 2-Vertical)
* @return Error code
*/
int FocusStart(double kp, double kpredict, double aMax, double vMax, int type)

6.51. Stop Focus Following

New in version Java: SDK-v1.0.7-3.8.4

/**
* @brief Stop focus following
* @return Error code
*/
int FocusEnd()

6.52. Set Focus Position

New in version Java: SDK-v1.0.7-3.8.4

/**
* @brief Set focus position
* @param pos Focus position XYZ
* @return Error code
*/
public int SetFocusPosition(DescTran pos)

6.53. Focus Following Code Example

public static void TestFocus(Robot robot){
    DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
    JointPos p1Joint = new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);

    DescPose p2Desc = new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
    JointPos p2Joint = new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);

    DescPose p3Desc = new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
    JointPos p3Joint = new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);

    DescPose p4Desc = new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
    JointPos p4Joint = new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);

    DescPose p5Desc = new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
    JointPos p5Joint = new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);

    DescPose p6Desc = new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
    JointPos p6Joint = new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);

    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
    DescPose offdese = new DescPose(0, 0, 100, 0, 0, 0);

    robot.GetForwardKin(p1Joint, p1Desc);
    robot.GetForwardKin(p2Joint,  p2Desc);
    robot.GetForwardKin(p3Joint,  p3Desc);
    robot.GetForwardKin(p4Joint,  p4Desc);
    robot.GetForwardKin(p5Joint,  p5Desc);
    robot.GetForwardKin(p6Joint,  p6Desc);

    robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.SetTcp4RefPoint(1);
    robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.SetTcp4RefPoint(2);
    robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.SetTcp4RefPoint(3);
    robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.SetTcp4RefPoint(4);

    DescPose coordRtn = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    int rtn = robot.ComputeTcp4( coordRtn);

    robot.SetToolCoord(1, coordRtn, 0, 0, 1, 0);

    robot.GetForwardKin(p1Joint, p1Desc);
    robot.GetForwardKin(p2Joint, p2Desc);
    robot.GetForwardKin(p3Joint, p3Desc);

    robot.SetFocusCalibPoint(1, p1Desc);
    robot.SetFocusCalibPoint(2, p2Desc);
    robot.SetFocusCalibPoint(3, p3Desc);

    DescTran resultPos = new DescTran(0.0, 0.0, 0.0);
    double[] accuracy = {0.0};
    rtn = robot.ComputeFocusCalib(3,  resultPos,  accuracy);
    rtn = robot.SetFocusPosition(resultPos);

    robot.GetForwardKin(p5Joint,  p5Desc);
    robot.GetForwardKin(p6Joint,  p6Desc);

    robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
    robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);

    robot.FocusStart(50, 19, 710, 90, 0);
    robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
    robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
    robot.FocusEnd();
}

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