Switch the mode of Lite6.
Button: Manual mode.
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)
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);
}
});
};