xarm_move_joint
1. Introduction
Button:
1) Back to the initial position.
2) Joint motion in Live Control and Blockly module.
2. Request & Response
{
"cmd": "xarm_move_joint",
"data": {
"I": "0",
"J": "0",
"K": "0",
"L": "0",
"M": "0",
"N": "0",
"O": "0",
"R": 0,
"F": "0",
"Q": "300",
"isControl": true,
"isClickMove": false,
"wait": false
},
"id": "5"
}
Name | Type | Required fields | Description |
---|---|---|---|
I | String | Yes | Joint angle of Joint1 |
J | String | Yes | Joint angle of Joint2 |
k | String | Yes | Joint angle of Joint3 |
M | String | Yes | Joint angle of Joint4 |
N | String | Yes | Joint angle of Joint5 |
O | String | Yes | Joint angle of Joint6 |
R | String | Yes | Joint angle of Joint7 |
wait | bool | No | wait or not |
isControl | bool | Yes | whether start the program by Blockly or not |
isClickMove | bool | Yes | whether click 'Move' in Blockly or not |
Module | String | No | whether the wait=True in Blockly or not |
code=0->success;
code!=0->Failed, refer to xarm_api_code;
3. Code Example
background
GLOBAL.XArm.xarm_printed = True
ret = yield self._wait_until_cmdnum_lt_max()
if ret is not None:
return response(client, id, ret)
self.last_move_client = client
code = GLOBAL.XArm.xarm.set_servo_angle(angle=angles, speed=mvvelo, mvacc=mvacc, mvtime=mvtime,is_radian=False, wait=False, radius=radius)
front_end
self.moveJoint = (positions, index, isWait, callback, isControl, modName, isClickMove) => {
if (modName === 'blockly' && isControl === false && !window.Blockly.Running) {
return;
}
const JOINT_LIST = ['I', 'J', 'K', 'L', 'M', 'N', 'O', 'R'];
const sendData = isWait === true ? { wait: true } : {};
if (index >= 0) {
sendData[JOINT_LIST[index]] = Number(positions[0]);
}
else {
JOINT_LIST.forEach((value, index) => {
sendData[value] = Number(positions[index]);
});
}
const params = window.GlobalConstant.INIT_CMD_PARAMS_COMMON_DATA();
Object.assign(params.data, {
F: Number(self.model.robot.state.local.angle_speed),
Q: Number(self.model.robot.state.local.angle_acceleration),
isControl: isControl === true ? true : false,
module: modName,
isClickMove: isClickMove,
mode: self.model.robot.state.info.xarm_mode,
wait: isWait,
});
Object.assign(params.data, sendData);
self.sendCmd(window.GlobalConstant.MOVE_JOINT, params, (dict) => {
self.codeHandle(dict, 'move joint', isControl !== true);
if (callback) {
callback(dict);
}
});
};
Last updated