top of page
4.55. FIR Filter Example
int TestFIR(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);
JointPos startjointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
JointPos midjointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255);
JointPos endjointPos(-29.777, -84.536, 109.275, -114.075, -86.655, 74.257);
DescPose startdescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
DescPose middescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
DescPose enddescPose(-487.434, 154.362, 308.576, 176.600, 0.268, -14.061);
ExaxisPos exaxisPos(0, 0, 0, 0);
DescPose offdese(0, 0, 0, 0, 0, 0);
rtn = robot.PtpFIRPlanningStart(1000, 1000);
cout << "PtpFIRPlanningStart rtn is " << rtn << endl;
robot.MoveJ(&startjointPos, &startdescPose, 0, 0, 100, 100, 100, &exaxisPos, -1, 0, &offdese);
robot.MoveJ(&endjointPos, &enddescPose, 0, 0, 100, 100, 100, &exaxisPos, -1, 0, &offdese);
robot.PtpFIRPlanningEnd();
cout << "PtpFIRPlanningEnd rtn is " << rtn << endl;
robot.LinArcFIRPlanningStart(1000, 1000, 1000, 1000);
cout << "LinArcFIRPlanningStart rtn is " << rtn << endl;
robot.MoveL(&startjointPos, &startdescPose, 0, 0, 100, 100, 100, -1, &exaxisPos, 0, 0, &offdese, 1, 1);
robot.MoveC(&midjointPos, &middescPose, 0, 0, 100, 100, &exaxisPos, 0, &offdese, &endjointPos, &enddescPose, 0, 0, 100, 100, &exaxisPos, 0, &offdese, 100, -1);
robot.LinArcFIRPlanningEnd();
cout << "LinArcFIRPlanningEnd rtn is " << rtn << endl;
robot.CloseRPC();
return 0;
}
4.56. Acceleration Smoothing Start
New in version C++SDK-v2.2.1-3.8.1.
/**
* @brief Acceleration smoothing start
* @param [in] saveFlag Whether to save after power off
* @return Error code
*/
errno_t AccSmoothStart(bool saveFlag);
4.57. Acceleration Smoothing End
New in version C++SDK-v2.2.1-3.8.1.
/**
* @brief Acceleration smoothing end
* @param [in] saveFlag Whether to save after power off
* @return Error code
*/
errno_t AccSmoothEnd(bool saveFlag);
4.58. Acceleration Smoothing Example
int TestAccSmooth(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);
JointPos startjointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
JointPos endjointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255);
DescPose startdescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
DescPose enddescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
ExaxisPos exaxisPos(0, 0, 0, 0);
DescPose offdese(0, 0, 0, 0, 0, 0);
rtn = robot.AccSmoothStart(0);
cout << "AccSmoothStart rtn is " << rtn << endl;
robot.MoveJ(&startjointPos, &startdescPose, 0, 0, 100, 100, 100, &exaxisPos, -1, 0, &offdese);
robot.MoveJ(&endjointPos, &enddescPose, 0, 0, 100, 100, 100, &exaxisPos, -1, 0, &offdese);
rtn = robot.AccSmoothEnd(0);
cout << "AccSmoothEnd rtn is " << rtn << endl;
robot.CloseRPC();
return 0;
}
4.59. Specified Pose Speed Start
New in version C++SDK-v2.1.5.0.
/**
* @brief Specified pose speed start
* @param [in] ratio Pose speed percentage [0-300]
* @return Error code
*/
errno_t AngularSpeedStart(int ratio);
4.60. Specified Pose Speed End
New in version C++SDK-v2.1.5.0.
/**
* @brief Specified pose speed end
* @return Error code
*/
errno_t AngularSpeedEnd();bottom of page