top of page
6.24. Get Robot Default Speed
/**
* @brief Get robot default speed
* @param [out] vel Speed in mm/s
* @return Error code
*/
errno_t GetDefaultTransVel(float *vel);
6.25. Set End Load Weight
Changed in version C++SDK-v2.1.8-3.7.8.
/**
* @brief Set end load weight
* @param [in] loadNum Load number
* @param [in] weight Load weight in kg
* @return Error code
*/
errno_t SetLoadWeight(int loadNum = 0, float weight);
6.26. Set End Effector Payload Center of Gravity Coordinates
New in version C++SDK-v3.8.6.
/**
* @brief Set End Effector Payload Center of Gravity Coordinates
* @param [in] loadNum Payload number
* @param [in] coord Center of gravity coordinates, unit mm
* @return Error code
*/
errno_t SetLoadCoord(int loadNum, DescTran* coord);
6.27. Get Current Load Weight
/**
* @brief Get current load weight
* @param [in] flag 0-blocking, 1-non-blocking
* @param [out] weight Load weight in kg
* @return Error code
*/
errno_t GetTargetPayload(uint8_t flag, float *weight);
6.28. Get Current Load Center of Gravity
/**
* @brief Get current load center of gravity
* @param [in] flag 0-blocking, 1-non-blocking
* @param [out] cog Load center of gravity in mm
* @return Error code
*/
errno_t GetTargetPayloadCog(uint8_t flag, DescTran *cog);
6.29. Set Robot Installation Method
/**
* @brief Set robot installation method
* @param [in] install Installation method: 0-standard, 1-wall-mounted, 2-ceiling-mounted
* @return Error code
*/
errno_t SetRobotInstallPos(uint8_t install);
6.30. Set Robot Installation Angle
/**
* @brief Set robot installation angle (free installation)
* @param [in] yangle Tilt angle
* @param [in] zangle Rotation angle
* @return Error code
*/
errno_t SetRobotInstallAngle(double yangle, double zangle);
6.31. Get Robot Installation Angle
/**
* @brief Get robot installation angle
* @param [out] yangle Tilt angle
* @param [out] zangle Rotation angle
* @return Error code
*/
errno_t GetRobotInstallAngle(float *yangle, float *zangle);
6.32. Set System Variable Value
/**
* @brief Set system variable value
* @param [in] id Variable number, range [1~20]
* @param [in] value Variable value
* @return Error code
*/
errno_t SetSysVarValue(int id, float value);
6.33. Get System Variable Value
/**
* @brief Get system variable value
* @param [in] id System variable number, range [1~20]
* @param [out] value System variable value
* @return Error code
*/
errno_t GetSysVarValue(int id, float *value);
6.34. Robot Common Settings Example
int TestLoadInstall(void)
{
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);
for (int i = 1; i < 100; i++)
{
robot.SetSpeed(i);
robot.SetOaccScale(i);
robot.Sleep(30);
}
float defaultVel = 0.0;
robot.GetDefaultTransVel(&defaultVel);
printf("GetDefaultTransVel is %f\n", defaultVel);
for (int i = 1; i < 21; i++)
{
robot.SetSysVarValue(i, i + 0.5);
robot.Sleep(100);
}
for (int i = 1; i < 21; i++)
{
float value = 0;
robot.GetSysVarValue(i, &value);
printf("sys value %d is :%f\n", i, value);
robot.Sleep(100);
}
robot.SetLoadWeight(0, 2.5);
DescTran loadCoord = {};
loadCoord.x = 3.0;
loadCoord.y = 4.0;
loadCoord.z = 5.0;
robot.SetLoadCoord(&loadCoord);
robot.Sleep(1000);
float getLoad = 0.0;
robot.GetTargetPayload(0, &getLoad);
DescTran getLoadTran = {};
robot.GetTargetPayloadCog(0, &getLoadTran);
printf("get load is %f; get load cog is %f %f %f\n", getLoad, getLoadTran.x, getLoadTran.y, getLoadTran.z);
robot.SetRobotInstallPos(0);
robot.SetRobotInstallAngle(15.0, 25.0);
float anglex = 0.0;
float angley = 0.0;
robot.GetRobotInstallAngle(&anglex, &angley);
printf("GetRobotInstallAngle x: %f; y: %f\n", anglex, angley);
robot.CloseRPC();
return 0;
}
6.35. Joint Friction Compensation Switch
/**
* @brief Joint friction compensation switch
* @param [in] state 0-off, 1-on
* @return Error code
*/
errno_t FrictionCompensationOnOff(uint8_t state);
6.36. Set Joint Friction Compensation Coefficient - Standard Installation
/**
* @brief Set joint friction compensation coefficient - standard installation
* @param [in] coeff Six joint compensation coefficients, range [0~1]
* @return Error code
*/
errno_t SetFrictionValue_level(float coeff[6]);
6.37. Set Joint Friction Compensation Coefficient - Wall Installation
/**
* @brief Set joint friction compensation coefficient - wall installation
* @param [in] coeff Six joint compensation coefficients, range [0~1]
* @return Error code
*/
errno_t SetFrictionValue_wall(float coeff[6]);
6.38. Set Joint Friction Compensation Coefficient - Ceiling Installation
/**
* @brief Set joint friction compensation coefficient - ceiling installation
* @param [in] coeff Six joint compensation coefficients, range [0~1]
* @return Error code
*/
errno_t SetFrictionValue_ceiling(float coeff[6]);
6.39. 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
*/
errno_t SetFrictionValue_freedom(float coeff[6]);
6.40. Robot Joint Friction Compensation Example
int TestFriction(void)
{
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);
float lcoeff[6] = { 0.9,0.9,0.9,0.9,0.9,0.9 };
float wcoeff[6] = { 0.4,0.4,0.4,0.4,0.4,0.4 };
float ccoeff[6] = { 0.6,0.6,0.6,0.6,0.6,0.6 };
float fcoeff[6] = { 0.5,0.5,0.5,0.5,0.5,0.5 };
rtn = robot.FrictionCompensationOnOff(1);
printf("FrictionCompensationOnOff rtn is %d\n", rtn);
rtn = robot.SetFrictionValue_level(lcoeff);
printf("SetFrictionValue_level rtn is %d\n", rtn);
rtn = robot.SetFrictionValue_wall(wcoeff);
printf("SetFrictionValue_wall rtn is %d\n", rtn);
rtn = robot.SetFrictionValue_ceiling(ccoeff);
printf("SetFrictionValue_ceiling rtn is %d\n", rtn);
rtn = robot.SetFrictionValue_freedom(fcoeff);
printf("SetFrictionValue_freedom rtn is %d\n", rtn);
robot.CloseRPC();
return 0;
}
6.41. Query Robot Error Code
/**
* @brief Query robot error code
* @param [out] maincode Main error code
* @param [out] subcode Sub error code
* @return Error code
*/
errno_t GetRobotErrorCode(int *maincode, int *subcode);
6.42. Error State Clear
/**
* @brief Error state clear
* @return Error code
*/
errno_t ResetAllError();
6.43. Robot Fault State Acquisition and Error Clear Example
int TestGetError(void)
{
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);
int maincode, subcode;
robot.GetRobotErrorCode(&maincode, &subcode);
printf("robot maincode is %d; subcode is %d\n", maincode, subcode);
robot.ResetAllError();
robot.Sleep(1000);
robot.GetRobotErrorCode(&maincode, &subcode);
printf("robot maincode is %d; subcode is %d\n", maincode, subcode);
robot.CloseRPC();
return 0;
}
6.44. Set wide voltage control box temperature and fan current monitoring parameters
/**
*@brief setting 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 SetWideBoxTempFanMonitorParam(int enable, int period);bottom of page