top of page
4.61. Robot Specified Pose Speed Example
int TestAngularSpeed(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.AngularSpeedStart(50);
cout << "AngularSpeedStart 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.AngularSpeedEnd();
cout << "AngularSpeedEnd rtn is " << rtn << endl;
robot.CloseRPC();
return 0;
}
4.62. Start Singular Pose Protection
New in version C++SDK-v2.1.5.0.
/**
* @brief Start singular pose protection
* @param [in] protectMode Singular protection mode, 0: Joint mode; 1-Cartesian mode
* @param [in] minShoulderPos Shoulder singular adjustment range (mm), default 100
* @param [in] minElbowPos Elbow singular adjustment range (mm), default 50
* @param [in] minWristPos Wrist singular adjustment range (°), default 10
* @return Error code
*/
errno_t SingularAvoidStart(int protectMode, double minShoulderPos, double minElbowPos, double minWristPos);
4.63. Stop Singular Pose Protection
New in version C++SDK-v2.1.5.0.
/**
* @brief Stop singular pose protection
* @return Error code
*/
errno_t SingularAvoidEnd();
4.64. Robot Singular Pose Protection Example
int TestAngularSpeed(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.SingularAvoidStart(2, 10, 5, 5);
cout << "SingularAvoidStart 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.SingularAvoidEnd();
cout << "SingularAvoidEnd rtn is " << rtn << endl;
robot.CloseRPC();
return 0;
}
4.65. Clear the motion command queue
/**
* @brief Clear the motion command queue
* @return error code
*/
errno_t MotionQueueClear();
4.66. Move to Intersecting Line Start Point
/**
* @brief Move to intersecting line start point
* @param [in] mainPoint Cartesian poses of 6 taught points on the main pipe
* @param [in] mainExaxisPos Extended axis positions for 6 taught points on the main pipe
* @param [in] piecePoint Cartesian poses of 6 taught points on the branch pipe
* @param [in] pieceExaxisPos Extended axis positions for 6 taught points on the branch pipe
* @param [in] extAxisFlag Whether to enable extended axis; 0-Disable; 1-Enable
* @param [in] exaxisPos Start point extended axis position
* @param [in] tool Tool coordinate system number
* @param [in] wobj Workpiece coordinate system number
* @param [in] vel Velocity percentage
* @param [in] acc Acceleration percentage
* @param [in] ovl Velocity scaling factor
* @param [in] oacc Acceleration scaling factor
* @param [in] moveType Motion type; 0-PTP; 1-LIN
* @param [in] moveDirection Motion direction; 0-Clockwise; 1-Counterclockwise
* @param [in] offset Offset value
* @return Error code
*/
errno_t MoveToIntersectLineStart(DescPose mainPoint[6], ExaxisPos mainExaxisPos[6], DescPose piecePoint[6], ExaxisPos pieceExaxisPos[6], int extAxisFlag, ExaxisPos exaxisPos, int tool, int wobj, double vel, double acc, double ovl, double oacc, int moveType, int moveDirection, DescPose offset);
4.67. Intersecting Line Motion
/**
* @brief Intersecting line motion
* @param [in] mainPoint Cartesian poses of 6 taught points on the main pipe
* @param [in] mainExaxisPos Extended axis positions for 6 taught points on the main pipe
* @param [in] piecePoint Cartesian poses of 6 taught points on the branch pipe
* @param [in] pieceExaxisPos Extended axis positions for 6 taught points on the branch pipe
* @param [in] extAxisFlag Whether to enable extended axis; 0-Disable; 1-Enable
* @param [in] exaxisPos Start point extended axis positions
* @param [in] tool Tool coordinate system number
* @param [in] wobj Workpiece coordinate system number
* @param [in] vel Velocity percentage
* @param [in] acc Acceleration percentage
* @param [in] ovl Velocity scaling factor
* @param [in] oacc Acceleration scaling factor
* @param [in] moveDirection Motion direction; 0-Clockwise; 1-Counterclockwise
* @param [in] offset Offset value
* @return Error code
*/
errno_t MoveIntersectLine(DescPose mainPoint[6], ExaxisPos mainExaxisPos[6], DescPose piecePoint[6], ExaxisPos pieceExaxisPos[6], int extAxisFlag, ExaxisPos exaxisPos[4], int tool, int wobj, double vel, double acc, double ovl, double oacc, int moveDirection, DescPose offset);
4.68. Robot Intersecting Line Motion Code Example
void TestIntersectLineMove()
{
ROBOT_STATE_PKG pkg = {};
FRRobot robot;
robot.LoggerInit();
robot.SetLoggerLevel(3);
int rtn = robot.RPC("192.168.58.2");
if (rtn != 0)
{
return ;
}
robot.SetReConnectParam(true, 30000, 500);
DescPose mainPoint[6] = {};
DescPose piecePoint[6] = {};
ExaxisPos mainExaxisPos[6] = {};
ExaxisPos pieceExaxisPos[6] = {};
int extAxisFlag = 1;
ExaxisPos exaxisPos[4] = {};
DescPose offset = { 0.0, 2.0 ,30.0, -2.0, 0.0, 0.0 };
mainPoint[0] = {490.004, -383.194, 402.735, -9.332, -1.528, 69.594};
mainPoint[1] = {444.950, -407.117, 389.011, -5.546, -2.196, 65.279};
mainPoint[2] = {445.168, -463.605, 355.759, -1.544, -10.886, 57.104};
mainPoint[3] = {507.529, -485.385, 343.013, -0.786, -4.834, 61.799};
mainPoint[4] = {554.390, -442.647, 367.701, -4.761, -10.181, 64.925};
mainPoint[5] = {532.552, -394.003, 396.467, -13.732, -13.592, 67.411};
mainExaxisPos[0] = { -29.996, 0.000, 0.000, 0.000 };
mainExaxisPos[1] = { -29.996, 0.000, 0.000, 0.000 };
mainExaxisPos[2] = { -29.996, 0.000, 0.000, 0.000 };
mainExaxisPos[3] = { -29.996, 0.000, 0.000, 0.000 };
mainExaxisPos[4] = { -29.996, 0.000, 0.000, 0.000 };
mainExaxisPos[5] = { -29.996, 0.000, 0.000, 0.000 };
piecePoint[0] = { 505.571, -192.408, 316.759, 38.098, 37.051, 139.447 };
piecePoint[1] = {533.837, -201.558, 332.340, 34.644, 42.339, 137.748};
piecePoint[2] = {530.386, -225.085, 373.808, 35.431, 45.111, 137.560};
piecePoint[3] = {485.646, -229.195, 383.778, 33.870, 45.173, 137.064};
piecePoint[4] = {460.551, -212.161, 354.256, 28.856, 45.602, 135.930};
piecePoint[5] = {474.217, -197.124, 324.611, 42.469, 41.133, 148.167};
pieceExaxisPos[0] = { -29.996, -0.000, 0.000, 0.000 };
pieceExaxisPos[1] = { -29.996, -0.000, 0.000, 0.000 };
pieceExaxisPos[2] = { -29.996, -0.000, 0.000, 0.000 };
pieceExaxisPos[3] = { -29.996, -0.000, 0.000, 0.000 };
pieceExaxisPos[4] = { -29.996, -0.000, 0.000, 0.000 };
pieceExaxisPos[5] = { -29.996, -0.000, 0.000, 0.000 };
exaxisPos[0] = {-29.996, -0.000, 0.000, 0.000};
exaxisPos[1] = {-44.994, 90.000, 0.000, 0.000};
exaxisPos[2] = {-59.992, 0.002, 0.000, 0.000};
exaxisPos[3] = {-44.994, -89.997, 0.000, 0.000};
int tool = 2;
int wobj = 0;
double vel = 100.0;
double acc = 100.0;
double ovl = 12.0;
double oacc = 12.0;
int moveType = 1;
int moveDirection = 1;
rtn = robot.MoveToIntersectLineStart(mainPoint, mainExaxisPos, piecePoint, pieceExaxisPos, extAxisFlag, exaxisPos[0], tool, wobj, vel, acc, ovl, oacc, moveType, moveDirection, offset);
printf("MoveToIntersectLineStart rtn is %d\n", rtn);
rtn = robot.MoveIntersectLine(mainPoint, mainExaxisPos, piecePoint, pieceExaxisPos, extAxisFlag, exaxisPos, tool, wobj, vel, acc, 5.0, 5.0, moveDirection, offset);
printf("MoveIntersectLine rtn is %d\n", rtn);
robot.CloseRPC();
return ;
}
4.69. Stationary Air Motion
/**
* @brief Stationary Air Motion
* @return Error code
*/
errno_t MoveStationary();
4.70. Stationary Air Motion Code Example
int TestLaserStationary(void)
{
ROBOT_STATE_PKG pkg = {};
FRRobot robot;
robot.LoggerInit();
robot.SetLoggerLevel(1);
int rtn = robot.RPC("192.168.58.2");
if (rtn != 0)
{
return 0;
}
robot.SetReConnectParam(true, 30000, 500);
rtn = robot.LaserSensorRecordandReplay(0, 10, 1, 0, 0.1, 1, 0, 10, 100);
printf("LaserSensorRecordandReplay rtn is %d\n", rtn);
rtn = robot.MoveStationary();
printf("MoveStationary rtn is %d\n", rtn);
rtn = robot.LaserSensorRecord1(0, 10);
printf("LaserSensorRecordandReplay rtn is %d\n", rtn);
robot.CloseRPC();
robot.Sleep(9999999);
return 0;
}bottom of page