Skip to main content

NRC_SetServoMapRelation(std::vector<int> servoMap,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: syncServoMap = {0 ,0 ,0}

One external axis: syncServoMap = {7 ,0 ,0}

Two external axes: syncServoMap = {7 ,8 ,0}

In the future, this function will be replaced by NRC_SetAllServoMapRelation

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
syncServoMapstd::vector < int>External axis servo mapping relationship, the number is 3, the value is the number of servo connected to each axis, if there are less than 3 external axes, the corresponding value is 0

Sample code

std::vector`<int>` servoMap = { 0, 0, 0, 0, 0, 0 };//Robot mapping
std::vector<std::vector`<int>`> syncServoMap={7 ,8 ,0};
NRC_SetServoMapRelation(servoMap,syncServoMap);//Set servo mapping relationship