top of page
6.45. Obtain wide voltage control box temperature and fan current monitoring parameters
/**
* @brief Obtain wide voltage control box temperature and fan current monitoring parameters
*@param [ in ] enable 0-do not enable monitoring; 1-enable monitoring
*@param [ in ] period (s) , range 1-100
*@return error code
*/
errno_t GetWideBoxTempFanMonitorParam(int &enable, int &period);
6.46. Wide voltage control box temperature and fan current state acquisition code example
int TestWideVoltageCtrlBoxtemp(void)
{
ROBOT_STATE_PKG pkg = {};
FRRobot robot;
robot.LoggerInit();
robot.SetLoggerLevel(1);
int rtn = robot.RPC("192.168.58.2");
printf("robot rpc rtn is %d\n", rtn);
if (rtn != 0)
{
return -1;
}
robot.SetReConnectParam(true, 30000, 500);
robot.SetWideBoxTempFanMonitorParam(1, 2);
int enable = 0;
int period = 0;
robot.GetWideBoxTempFanMonitorParam(enable, period);
printf("GetWideBoxTempFanMonitorParam enable is %d period is %d\n", enable, period);
for (int i = 0; i < 100; i++)
{
robot.GetRobotRealTimeState(&pkg);
printf("robot ctrl box temp is %f, fan current is %d\n", pkg.wideVoltageCtrlBoxTemp, pkg.wideVoltageCtrlBoxFanCurrent);
robot.Sleep(100);
}
rtn = robot.SetWideBoxTempFanMonitorParam(0, 2);
printf("SetWideBoxTempFanMonitorParam rtn is %d\n", rtn);
enable = 0;
period = 0;
robot.GetWideBoxTempFanMonitorParam(enable, period);
printf("GetWideBoxTempFanMonitorParam enable is %d period is %d\n", enable, period);
for (int i = 0; i < 100; i++)
{
robot.GetRobotRealTimeState(&pkg);
printf("robot ctrl box temp is %f, fan current is %d\n", pkg.wideVoltageCtrlBoxTemp, pkg.wideVoltageCtrlBoxFanCurrent);
robot.Sleep(100);
}
robot.CloseRPC();
robot.Sleep(2000);
return 0;
}
6.47. Calculate Focus Calibration Results
/**
* @brief Calculate focus calibration results
* @param [in] pointNum Number of calibration points
* @param [out] resultPos Calibration result XYZ
* @param [out] accuracy Calibration accuracy error
* @return Error code
*/
errno_t ComputeFocusCalib(int pointNum, DescTran& resultPos, float& accuracy);
6.48. Set Focus Position
/**
* @brief Set focus position
* @param [in] pos Focus position XYZ
* @return Error code
*/
errno_t SetFocusPosition(DescTran pos);
6.49. Enable Focus Following
/**
* @brief Enable 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 X-axis locking mode (0-reference input vector; 1-horizontal; 2-vertical)
* @return Error code
*/
errno_t FocusStart(double kp, double kpredict, double aMax, double vMax, int type);
6.50. Disable Focus Following
/**
* @brief Disable focus following
* @return Error code
*/
errno_t FocusEnd();
6.51. Robot Focus Following Code Example
int TestFocus()
{
ROBOT_STATE_PKG pkg = {};
FRRobot robot;
robot.LoggerInit();
robot.SetLoggerLevel(1);
int rtn = robot.RPC("192.168.58.2");
if (rtn != 0)
{
return -1;
}
robot.SetReConnectParam(true, 30000, 500);
DescPose p1Desc(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
JointPos p1Joint(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
DescPose p2Desc(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
JointPos p2Joint(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
DescPose p3Desc(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
JointPos p3Joint(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
DescPose p4Desc(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
JointPos p4Joint(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
DescPose p5Desc(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
JointPos p5Joint(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
DescPose p6Desc(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
JointPos p6Joint(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
ExaxisPos exaxisPos(0, 0, 0, 0);
DescPose offdese(0, 0, 100, 0, 0, 0);
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 = {};
rtn = robot.ComputeTcp4(&coordRtn);
printf("4 Point ComputeTool %d coord is %f %f %f %f %f %f \n", rtn, coordRtn.tran.x, coordRtn.tran.y, coordRtn.tran.z, coordRtn.rpy.rx, coordRtn.rpy.ry, coordRtn.rpy.rz);
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 = {};
float accuracy = 0.0;
rtn = robot.ComputeFocusCalib(3, resultPos, accuracy);
printf("ComputeFocusCalib coord is %d %f %f %f accuracy is %f\n", rtn, resultPos.x, resultPos.y, resultPos.z, 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);
robot.MoveL(&p6Joint, &p6Desc, 1, 0, 10, 100, 100, -1, 0, &exaxisPos, 0, 1, &offdese);
robot.FocusStart(50, 19, 710, 90, 0);
robot.MoveL(&p5Joint, &p5Desc, 1, 0, 10, 100, 100, -1, 0, &exaxisPos, 0, 1, &offdese);
robot.MoveL(&p6Joint, &p6Desc, 1, 0, 10, 100, 100, -1, 0, &exaxisPos, 0, 1, &offdese);
robot.FocusEnd();
robot.CloseRPC();
return 0;
}
6.52. Open the joint torque sensor sensitivity calibration function
/**
* @brief Open the joint torque sensor sensitivity calibration function
* @param [ in ] status 0-off; 1-on
* @return error code
*/
errno_t JointSensitivityEnable(int status);
6.53. Data acquisition of joint torque sensor sensitivity
/**
* @brief Data acquisition of joint torque sensor sensitivity
* @return error code
*/
errno_t JointSensitivityCollect();bottom of page