xarm_set_simulation_robot

1. Introduction

Switch to simulated mode.

Button: [Live Control] - Real/Sim

2. Request & Response

{
    "cmd": "xarm_set_simulation_robot",
    "data": {
        "on_off": true
    },
    "id": "1"
}

3. Code Example

background

on_off = data.get('on_off')
code = GLOBAL.XArm.xarm.set_simulation_robot(on_off)
GLOBAL.XArm.xarm.get_position()
GLOBAL.XArm.xarm.get_servo_angle()
yield self._xarm_sync()
response(client, cmd_id, code)

front_end

self.set_simulation_robot = (on_off, callback) => {
  const params = window.GlobalConstant.INIT_CMD_PARAMS_COMMON_DATA();
  Object.assign(params.data, {
    on_off: on_off,
  });
  self.sendCmd(window.GlobalConstant.SET_SIMULATION_ROBOT, params, (dict) => {
    if (callback) {
      callback(dict);
    }
  });
}

Last updated