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"
}

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