switch_mode_lite6

1. Introduction

Switch the mode of Lite6.

Button: Manual mode.

2. Request & Response

{
    "cmd": "switch_mode_lite6",
    "data": {
        "mode": 2,
        "version": "lite6",
        "status": 1
    },
    "id": "1"
}

3. Code Example

background

if current_tgpio == '' and value == 1:
    xarm.set_mode(mode, 1)
    if xarm.error_code == 0:
        xarm.set_state(0)
    self._xarm_sync()
elif current_tgpio != value:
    GLOBAL.XArm.lite6_ti2_status = value
    mode_param = (2, 1) if value == 1 else (0,)
    xarm.set_mode(*mode_param)
    if xarm.error_code == 0:
        xarm.set_state(0)

front_end

self.switch_mode_lite6 = (mode, callback) => {
  const params = window.GlobalConstant.INIT_CMD_PARAMS_COMMON_DATA();
  Object.assign(params.data, {
    mode: mode,
    status: mode === 2 ? 1 : 0
  });
  self.sendCmd(window.GlobalConstant.SWITCH_MODE_LITE6, params, (dict) => {
    if (callback) {
      callback(dict);
    }
  });
};

Last updated