Initialize the parameter of the robot before running the Blockly project.
mode = GLOBAL.XArm.xarm.mode
if mode == 2:
return response(client, cmd_id, 105)
yield self.xarm_check_tcp(None, cmd_id, data)
yield self.xarm_set_ready(None, cmd_id, data)
self._xarm_set_params(**{
'Q': GLOBAL.XArm.xarm_tcp_acc,
'Q2': GLOBAL.XArm.xarm_joint_acc,
})
self.setBlocklyInit = (callback) => {
window.GlobalUtil.model.robot.event.GPIOEvent.reset(true);
window.GlobalUtil.model.robot.state.local.acceleration = window.GlobalUtil.model.robot.state.remote.defaultTcpAcc;
window.GlobalUtil.model.robot.state.local.angle_acceleration = window.GlobalUtil.model.robot.state.remote.defaultJointAcc;
const params = window.GlobalConstant.INIT_CMD_PARAMS_COMMON_DATA();
Object.assign(params.data, {
mode: self.model.robot.state.info.xarm_mode,
});
self.sendCmd(window.GlobalConstant.SET_BLOCKLY_INIT, params, (dict) => {
self.codeHandle(dict, 'set blockly init', true);
if (callback) {
callback(dict);
}
});
}