Skip to main content

NRC_SetAllServoMapRelation(std::vector<int> servoMap,int syncGroupSum, int syncType[], std::vector<std::vector<int>> syncServoMap)

Set servo mapping relationship

Description:

If the robot axes are corresponding to the servos as follows:

axis 1 is connected to servo 2

axis 2 is connected to servo 3

axis 3 is connected to servo 1

axis 4 is connected to servo 4

axis 5 is connected to servo 6

axis 6 is connected to servo 5

then the value of servoMap is { 2, 3, 1, 4, 6, 5 }

Correspondence between the number of external axes and the servos:

No external axes: syncGroupSum = 0

One single-axis positioner: syncGroupSum = 1, syncType = {1,0,0}, syncServoMap = {{7}}

Two dual-axis positioners and one ground rail: syncGroupSum = 3, syncType = {2,2,3}, syncServoMap = {{7,8},{9,10},{11}}

Type

int=>Set servo mapping relationship

Return valueDescription
0The function is called successfully
-101Invalid input parameter
-102The target object does not exist. This typically occurs when the system initialization is incomplete, and calling other functions may return this value
-103The target object is currently in an inoperable state

Parameter Option

ParameterTypeDescription
servoMapstd::vector < int>Servo mapping relationship, the number is the total number of robot axes set, and the value is the number of the servo connected to each axis
syncGroupSumintThe maximum number of external axis groups, with a maximum of 3, supporting up to two dual-axis positioners and one ground rail
syncType[]intThe type of external axis group, 0: none, 1: single-axis positioner, 2: dual-axis positioner, 3: ground rail
syncServoMapstd::vector < int>The mapping relationship between the external axes and servos

Sample code

std::vector`<int>` servoMap = { 0, 0, 0, 0, 0, 0 };//Robot mapping
int syncGroupNum = 2;
int syncType[]={2,1,0};
std::vector<std::vector`<int>`> syncServoMap={{0,0},{0,0},{0,0}};
NRC_SetAllServoMapRelation(servoMap,syncGroupNum, syncType, syncServoMap);//Set servo mapping relationship