xarm_move_step

1. Introduction

Button: [Live Control] - X+ / X- / Y+ / Y- / Z+ / Z-

long-press: keep moving in a certain direction until the button is released.

short-press: move a step in a certain direction.

2. Request & Response

{
    "cmd": "xarm_move_step",
    "data": {
        "isLoop": true,
        "direction": "joint-angle-increase",
        "isMoveTool": true,
        "acc": 500,
        "axis": 3
    },
    "id": "1"
}

3. Code Example

background

if direction == 'position-x-increase' or direction == 'position-x-decrease':
    self._xarm_sync_tcp(0)
    x = GLOBAL.XArm.xarm_position_step if direction == 'position-x-increase' else -GLOBAL.XArm.xarm_position_step
    if isMoveTool:
        code = GLOBAL.XArm.xarm.set_tool_position(x=x, speed=tcp_speed)
    else:
        code = GLOBAL.XArm.xarm.set_position(x=x, relative=True, speed=tcp_speed)

front_end

moveStep(direction, isLoop) {
      window.CommandsRobotSocket.moveStep({ 'direction': direction, 'isLoop': isLoop, 'isMoveTool': this.isToolCoord });
},

moveStep = (data, callback) => {
  const params = window.GlobalConstant.INIT_CMD_PARAMS_COMMON_DATA();
  Object.assign(params.data, data);
  Object.assign(params.data, {
    mode: self.model.robot.state.info.xarm_mode,
  });
  self.sendCmd(window.GlobalConstant.MOVE_STEP_START, params, (dict) => {
    if (callback) {
      callback(dict);
    }
  });
}

Last updated