#include "intelligent_winding_robot_ctrl.hpp" #include #include using namespace std; using namespace iflytop; #define TAG "IntelligentWindingRobotCtrl" #define DO(exptr) \ { \ int32_t ret = exptr; \ if (ret != 0) { \ return ret; \ } \ } void IntelligentWindingRobotCtrl::processError(int32_t err) { ZLOGE(TAG, "processError: %d", err); } void IntelligentWindingRobotCtrl::wait_module_idle(int32_t moduleid) { zos_delay(100); while (true) { int32_t status = 0; int32_t ecode = m_dm->module_get_status(moduleid, &status); if (ecode != 0) { processError(ecode); break; }; ZLOGI(TAG, "wait_module_idle %d %d....", moduleid, status); if (status == 0) break; if (status == 2) { processError(err::kfail); break; }; zos_delay(1000); } } int32_t IntelligentWindingRobotCtrl::initialize_device() { return 0; } // 排废舵机 int32_t IntelligentWindingRobotCtrl::paifei_duoji_moveto_reset() { ZLOGI(TAG, "paifei_duoji_moveto_reset %d %d %d", 15, cfg.paifei_duoji_reset_pos, 330); DO(m_dm->motor_move_to(15, cfg.paifei_duoji_reset_pos, 2000, 0)); wait_module_idle(15); return 0; } int32_t IntelligentWindingRobotCtrl::paifei_duoji_moveto_press() { ZLOGI(TAG, "paifei_duoji_moveto_press %d %d %d", 15, cfg.paifei_duoji_press_pos, cfg.paifei_duoji_press_torque); DO(m_dm->motor_move_to_with_torque(15, cfg.paifei_duoji_press_pos, cfg.paifei_duoji_press_torque)); wait_module_idle(15); } /** * @brief 绕线探测舵机 */ int32_t IntelligentWindingRobotCtrl::raoxiantance_duoji_move_to_reset() { ZLOGI(TAG, "raoxiantance_duoji_move_to_reset %d %d %d", 14, cfg.raoxiantance_duoji_reset_pos, 330); DO(m_dm->motor_move_to(14, cfg.raoxiantance_duoji_reset_pos, 2000, 0)); wait_module_idle(14); return 0; } int32_t IntelligentWindingRobotCtrl::raoxiantance_duoji_move_to_get_thickness(int32_t* thickness) { ZLOGI(TAG, "raoxiantance_duoji_move_to_get_thickness %d %d", 14, cfg.raoxiantance_duoji_tance_zero_pos); DO(m_dm->motor_move_to_with_torque(14, cfg.raoxiantance_duoji_tance_zero_pos, 200)); zos_delay(2000); int32_t nowpos = 0; DO(m_dm->motor_read_pos(14, &nowpos)); *thickness = cfg.raoxiantance_duoji_tance_zero_pos - nowpos; DO(raoxiantance_duoji_move_to_reset()); return 0; } /** * @brief 压线舵机 */ int32_t IntelligentWindingRobotCtrl::yaxian_duoji_move_to_reset() { ZLOGI(TAG, "yaxian_duoji_move_to_reset %d %d %d", 13, cfg.yaxian_duoji_reset_pos, 330); DO(m_dm->motor_move_to(13, cfg.yaxian_duoji_reset_pos, 2000, 0)); wait_module_idle(13); return 0; } int32_t IntelligentWindingRobotCtrl::yaxian_duoji_move_to_press_pos() { ZLOGI(TAG, "yaxian_duoji_move_to_press_pos %d %d %d", 13, cfg.yaxian_duoji_press_pos, cfg.yaxian_duoji_press_torque); DO(m_dm->motor_move_to_with_torque(13, cfg.yaxian_duoji_press_pos, cfg.yaxian_duoji_press_torque)); wait_module_idle(13); return 0; } int32_t IntelligentWindingRobotCtrl::yaxian_duoji_move_to_wait_for_press_pos() { ZLOGI(TAG, "yaxian_duoji_move_to_wait_for_press_pos %d %d %d", 13, cfg.yaxian_duoji_wait_for_press_pos, cfg.yaxian_duoji_press_torque); DO(m_dm->motor_move_to_with_torque(13, cfg.yaxian_duoji_wait_for_press_pos, cfg.yaxian_duoji_press_torque)); wait_module_idle(13); return 0; } /** * @brief 线拉紧舵机 */ int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_reset() { ZLOGI(TAG, "xianlajin_duoji_move_to_reset %d %d %d", 12, cfg.xianlajin_duoji_reset_pos, 330); DO(m_dm->motor_move_to(16, cfg.xianlajin_duoji_reset_pos, 2000, 0)); wait_module_idle(16); return 0; } // 零位 int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_line_entry_pos() { ZLOGI(TAG, "xianlajin_duoji_move_to_line_entry_pos %d %d %d", 16, cfg.xianlajin_duoji_line_entry_pos, 330); DO(m_dm->motor_move_to(16, cfg.xianlajin_duoji_line_entry_pos, 2000, 0)); wait_module_idle(16); return 0; } // 入线位 int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_tight_line_pos() { ZLOGI(TAG, "xianlajin_duoji_move_to_tight_line_pos %d %d %d", 16, cfg.xianlajin_duoji_tight_line_pos, 330); DO(m_dm->motor_move_to(16, cfg.xianlajin_duoji_tight_line_pos, 2000, 0)); wait_module_idle(16); return 0; } // 拉线位置 int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_loose_line_pos() { ZLOGI(TAG, "xianlajin_duoji_move_to_loose_line_pos %d %d %d", 16, cfg.xianlajin_duoji_loose_line_pos, 330); DO(m_dm->motor_move_to(16, cfg.xianlajin_duoji_loose_line_pos, 2000, 0)); wait_module_idle(16); return 0; } // 放线位置 /** * @brief 夹线舵机12 */ int32_t IntelligentWindingRobotCtrl::jiaxian_duoji_move_to_reset_pos() { ZLOGI(TAG, "jiaxian_duoji_move_to_reset_pos %d %d %d", 12, cfg.jiaxian_duoji_reset_pos, 330); DO(m_dm->motor_move_to(12, cfg.jiaxian_duoji_reset_pos, 2000, 0)); wait_module_idle(12); return 0; } int32_t IntelligentWindingRobotCtrl::jiaxian_duoji_move_to_clamp_pos() { ZLOGI(TAG, "jiaxian_duoji_move_to_clamp_pos %d %d %d", 12, cfg.jiaxian_duoji_clamp_pos, cfg.jiaxian_duoji_clamp_torque); DO(m_dm->motor_move_to_with_torque(12, cfg.jiaxian_duoji_clamp_pos, cfg.jiaxian_duoji_clamp_torque)); wait_module_idle(12); return 0; } /** * @brief 剪刀 */ int32_t IntelligentWindingRobotCtrl::scissors_move_reset_pos() { // ZLOGI(TAG, "scissors_move_reset_pos %d", 11); ZLOGI(TAG, "scissors_move_reset_pos"); return 0; } // block int32_t IntelligentWindingRobotCtrl::scissors_cut() { ZLOGI(TAG, "scissors_cut %d", 22); DO(m_dm->motor_move_by(22, 4095, 0, 0)); wait_module_idle(22); return 0; } // block /** * @brief 机械臂夹线舵机 */ int32_t IntelligentWindingRobotCtrl::arm_jiaxian_duoji_move_to_reset_pos() { ZLOGI(TAG, "arm_jiaxian_duoji_move_to_reset_pos"); DO(m_dm->motor_move_to(11, cfg.arm_jiaxian_duoji_reset_pos, 2000, 0)); wait_module_idle(11); return 0; } int32_t IntelligentWindingRobotCtrl::arm_jiaxian_duoji_move_to_clamp_pos() { ZLOGI(TAG, "arm_jiaxian_duoji_move_to_clamp_pos"); DO(m_dm->motor_move_to_with_torque(11, cfg.arm_jiaxian_duoji_clamp_direction, cfg.arm_jiaxian_duoji_clamp_torque)); wait_module_idle(11); return 0; } /** * @brief 机械臂钩爪 */ int32_t IntelligentWindingRobotCtrl::arm_hook_claws_reset() { ZLOGI(TAG, "arm_hook_claws_reset"); DO(m_dm->motor_move_to_zero_backward(21, 0, 0, 0, 0)); wait_module_idle(21); return 0; } int32_t IntelligentWindingRobotCtrl::arm_hook_claws_move_to_half_pos() { ZLOGI(TAG, "arm_hook_claws_move_to_half_pos"); DO(m_dm->motor_move_to(21, cfg.arm_hook_claws_half_pos, 0, 0)); wait_module_idle(21); return 0; } int32_t IntelligentWindingRobotCtrl::arm_hook_claws_move_to_full_pos() { ZLOGI(TAG, "arm_hook_claws_move_to_full_pos"); DO(m_dm->motor_move_to(21, cfg.arm_hook_claws_full_pos, 0, 0)); wait_module_idle(21); return 0; } int32_t IntelligentWindingRobotCtrl::main_shaft_run() { ZLOGI(TAG, "main_shaft_run"); DO(m_dm->motor_rotate_acctime(2, 1, 1000, 10000)); return 0; } int32_t IntelligentWindingRobotCtrl::main_shaft_stop() { ZLOGI(TAG, "main_shaft_stop"); DO(m_dm->module_stop(2)); return 0; } /** * @brief XY平台 */ int32_t IntelligentWindingRobotCtrl::xy_platform_reset() { return 0; } /** * @brief Z轴 */ int32_t IntelligentWindingRobotCtrl::z_axis_reset() { return 0; } int32_t IntelligentWindingRobotCtrl::z_axis_move_to(int32_t pos) { return 0; } int32_t IntelligentWindingRobotCtrl::xy_move_to_zero() { return 0; } // 移动到零位 int32_t IntelligentWindingRobotCtrl::xy_take_clip(int32_t index) { return 0; } // 取弹夹 int32_t IntelligentWindingRobotCtrl::xy_take_line() { return 0; } // 取线 int32_t IntelligentWindingRobotCtrl::xy_take_back_clip() { return 0; } // 放弹夹 int32_t IntelligentWindingRobotCtrl::xy_remove_line() { return 0; } // 移除线 int32_t IntelligentWindingRobotCtrl::do_reset_device() {} int32_t IntelligentWindingRobotCtrl::do_winding(int32_t index) {} /** * @brief */ int32_t IntelligentWindingRobotCtrl::start_winding() { return 0; } int32_t IntelligentWindingRobotCtrl::stop_winding() { return 0; } int32_t IntelligentWindingRobotCtrl::reset_and_check_device() { return 0; } int32_t IntelligentWindingRobotCtrl::device_reset() { // Z轴复位 zreset(); arm_hook_claws_reset(); arm_jiaxian_duoji_move_to_reset_pos(); xy_reset(); ZLOGI(TAG, "device_reset finished...."); } int32_t IntelligentWindingRobotCtrl::disable_all_motor() { m_dm->motor_enable(2, 0); m_dm->xymotor_enable(XYRobot_ID, 0); m_dm->motor_enable(11, 0); m_dm->motor_enable(12, 0); m_dm->motor_enable(13, 0); m_dm->motor_enable(14, 0); m_dm->motor_enable(15, 0); m_dm->motor_enable(16, 0); m_dm->motor_enable(21, 0); m_dm->motor_enable(22, 0); m_dm->motor_enable(23, 0); return 0; } int32_t IntelligentWindingRobotCtrl::xy_get_point(int32_t clip_index, int32_t& x, int32_t& y) { // x = 0; // y = 0; int clip_x_off = clip_index / cfg.clip_each_line_num; int clip_y_off = clip_index % cfg.clip_each_line_num; float eachx = (cfg.xy_platform_takeline_clipXX_pos_x - cfg.xy_platform_takeline_clip00_pos_x) / (cfg.clip_line - 1); float eachy = (cfg.xy_platform_takeline_clipXX_pos_y - cfg.xy_platform_takeline_clip00_pos_y) / (cfg.clip_each_line_num - 1); x = cfg.xy_platform_takeline_clip00_pos_x + eachx * clip_x_off; y = cfg.xy_platform_takeline_clip00_pos_y + eachy * clip_y_off; return 0; } int32_t IntelligentWindingRobotCtrl::zmove_to(int32_t pos) { ZLOGI(TAG, "zmove_to %d", pos); int32_t nowpos = 0; m_dm->motor_read_pos(ZMOTOR_ID, &nowpos); if (pos >= nowpos) { m_dm->motor_move_to(ZMOTOR_ID, pos, 450, 600); } else { m_dm->motor_move_to(ZMOTOR_ID, pos, 1000, 600); } if(pos == 0){ zreset(); } wait_module_idle(ZMOTOR_ID); return 0; } int32_t IntelligentWindingRobotCtrl::zreset() { ZLOGI(TAG, "zreset"); m_dm->motor_enable(ZMOTOR_ID, 1); m_dm->motor_move_to_zero_backward(4, 450, 300, 2000, 0); wait_module_idle(ZMOTOR_ID); return 0; } int32_t IntelligentWindingRobotCtrl::xymove_to(int32_t x, int32_t y) { ZLOGI(TAG, "xymove_to %d %d", x, y); m_dm->xymotor_move_to(XYRobot_ID, x, y, 0); wait_module_idle(XYRobot_ID); return 0; } int32_t IntelligentWindingRobotCtrl::xy_reset() { ZLOGI(TAG, "xy_reset"); m_dm->xymotor_move_to_zero(XYRobot_ID); wait_module_idle(XYRobot_ID); return 0; } int32_t IntelligentWindingRobotCtrl::xy_run_to_clip_pos_test(int32_t clip_index) { ZLOGI(TAG, "xy_run_to_clip_pos_test %d", clip_index); if (clip_index >= cfg.clip_line * cfg.clip_each_line_num) { ZLOGE(TAG, "clip_index %d out of range", clip_index); return err::kparam_out_of_range; } zreset(); arm_jiaxian_duoji_move_to_reset_pos(); arm_hook_claws_reset(); int32_t x = 0; int32_t y = 0; xy_get_point(clip_index, x, y); xymove_to(x, y); zmove_to(cfg.z_axis_take_clip_pos); arm_hook_claws_move_to_full_pos(); zmove_to(0); zmove_to(cfg.z_axis_take_clip_pos); arm_hook_claws_reset(); zmove_to(0); } int32_t IntelligentWindingRobotCtrl::setcfg(const char* cfgname, int32_t cfgvalue) { #if 0 if (strcmp(cfgname, "paifei_duoji_reset_pos") == 0) cfg.paifei_duoji_reset_pos = cfgvalue; else if (strcmp(cfgname, "paifei_duoji_press_pos") == 0) cfg.paifei_duoji_press_pos = cfgvalue; else if (strcmp(cfgname, "paifei_duoji_press_torque") == 0) cfg.paifei_duoji_press_torque = cfgvalue; else if (strcmp(cfgname, "raoxiantance_duoji_reset_pos") == 0) cfg.raoxiantance_duoji_reset_pos = cfgvalue; else if (strcmp(cfgname, "raoxiantance_duoji_tance_zero_pos") == 0) cfg.raoxiantance_duoji_tance_zero_pos = cfgvalue; else if (strcmp(cfgname, "yaxian_duoji_reset_pos") == 0) cfg.yaxian_duoji_reset_pos = cfgvalue; else if (strcmp(cfgname, "yaxian_duoji_press_pos") == 0) cfg.yaxian_duoji_press_pos = cfgvalue; else if (strcmp(cfgname, "yaxian_duoji_press_torque") == 0) cfg.yaxian_duoji_press_torque = cfgvalue; else if (strcmp(cfgname, "yaxian_duoji_wait_for_press_pos") == 0) cfg.yaxian_duoji_wait_for_press_pos = cfgvalue; else if (strcmp(cfgname, "xianlajin_duoji_reset_pos") == 0) cfg.xianlajin_duoji_reset_pos = cfgvalue; else if (strcmp(cfgname, "xianlajin_duoji_line_entry_pos") == 0) cfg.xianlajin_duoji_line_entry_pos = cfgvalue; else if (strcmp(cfgname, "xianlajin_duoji_tight_line_pos") == 0) cfg.xianlajin_duoji_tight_line_pos = cfgvalue; else if (strcmp(cfgname, "xianlajin_duoji_loose_line_pos") == 0) cfg.xianlajin_duoji_loose_line_pos = cfgvalue; else if (strcmp(cfgname, "jiaxian_duoji_reset_pos") == 0) cfg.jiaxian_duoji_reset_pos = cfgvalue; else if (strcmp(cfgname, "jiaxian_duoji_clamp_pos") == 0) cfg.jiaxian_duoji_clamp_pos = cfgvalue; else if (strcmp(cfgname, "jiaxian_duoji_clamp_torque") == 0) cfg.jiaxian_duoji_clamp_torque = cfgvalue; else if (strcmp(cfgname, "arm_jiaxian_duoji_reset_pos") == 0) cfg.arm_jiaxian_duoji_reset_pos = cfgvalue; else if (strcmp(cfgname, "arm_jiaxian_duoji_clamp_pos") == 0) cfg.arm_jiaxian_duoji_clamp_pos = cfgvalue; else if (strcmp(cfgname, "arm_jiaxian_duoji_clamp_torque") == 0) cfg.arm_jiaxian_duoji_clamp_torque = cfgvalue; else if (strcmp(cfgname, "scissors_reset_pos") == 0) cfg.scissors_reset_pos = cfgvalue; else if (strcmp(cfgname, "scissors_cut_pos") == 0) cfg.scissors_cut_pos = cfgvalue; else if (strcmp(cfgname, "arm_hook_claws_half_pos") == 0) cfg.arm_hook_claws_half_pos = cfgvalue; else if (strcmp(cfgname, "arm_hook_claws_full_pos") == 0) cfg.arm_hook_claws_full_pos = cfgvalue; return 0; #endif return 0; } int32_t IntelligentWindingRobotCtrl::dumpcfg() { #if 0 ZLOGI(TAG, "paifei_duoji_reset_pos %d", cfg.paifei_duoji_reset_pos); ZLOGI(TAG, "paifei_duoji_press_pos %d", cfg.paifei_duoji_press_pos); ZLOGI(TAG, "paifei_duoji_press_torque %d", cfg.paifei_duoji_press_torque); ZLOGI(TAG, "raoxiantance_duoji_reset_pos %d", cfg.raoxiantance_duoji_reset_pos); ZLOGI(TAG, "raoxiantance_duoji_tance_zero_pos %d", cfg.raoxiantance_duoji_tance_zero_pos); ZLOGI(TAG, "yaxian_duoji_reset_pos %d", cfg.yaxian_duoji_reset_pos); ZLOGI(TAG, "yaxian_duoji_press_pos %d", cfg.yaxian_duoji_press_pos); ZLOGI(TAG, "yaxian_duoji_press_torque %d", cfg.yaxian_duoji_press_torque); ZLOGI(TAG, "yaxian_duoji_wait_for_press_pos %d", cfg.yaxian_duoji_wait_for_press_pos); ZLOGI(TAG, "xianlajin_duoji_reset_pos %d", cfg.xianlajin_duoji_reset_pos); ZLOGI(TAG, "xianlajin_duoji_line_entry_pos %d", cfg.xianlajin_duoji_line_entry_pos); ZLOGI(TAG, "xianlajin_duoji_tight_line_pos %d", cfg.xianlajin_duoji_tight_line_pos); ZLOGI(TAG, "xianlajin_duoji_loose_line_pos %d", cfg.xianlajin_duoji_loose_line_pos); ZLOGI(TAG, "jiaxian_duoji_reset_pos %d", cfg.jiaxian_duoji_reset_pos); ZLOGI(TAG, "jiaxian_duoji_clamp_pos %d", cfg.jiaxian_duoji_clamp_pos); ZLOGI(TAG, "jiaxian_duoji_clamp_torque %d", cfg.jiaxian_duoji_clamp_torque); ZLOGI(TAG, "arm_jiaxian_duoji_reset_pos %d", cfg.arm_jiaxian_duoji_reset_pos); ZLOGI(TAG, "arm_jiaxian_duoji_clamp_pos %d", cfg.arm_jiaxian_duoji_clamp_pos); ZLOGI(TAG, "arm_jiaxian_duoji_clamp_torque %d", cfg.arm_jiaxian_duoji_clamp_torque); ZLOGI(TAG, "scissors_reset_pos %d", cfg.scissors_reset_pos); ZLOGI(TAG, "scissors_cut_pos %d", cfg.scissors_cut_pos); ZLOGI(TAG, "arm_hook_claws_half_pos %d", cfg.arm_hook_claws_half_pos); ZLOGI(TAG, "arm_hook_claws_full_pos %d", cfg.arm_hook_claws_full_pos); #endif return 0; } #if 1 int32_t IntelligentWindingRobotCtrl::initialize(ZModuleDeviceManager* dm, ICmdParser* cmdparse) { m_dm = dm; m_cmdparse = cmdparse; cfg.xy_platform_takeline_clip00_pos_x = 1736; cfg.xy_platform_takeline_clip00_pos_y = 16853; cfg.xy_platform_takeline_clipXX_pos_x = 52307; cfg.xy_platform_takeline_clipXX_pos_y = 31993; cfg.clip_line = 12; cfg.clip_each_line_num = 5; cfg.arm_jiaxian_duoji_reset_pos = 2619; cfg.arm_jiaxian_duoji_clamp_torque = 330; cfg.arm_jiaxian_duoji_clamp_direction = -1; cfg.z_axis_take_clip_pos = 6924; cfg.arm_hook_claws_full_pos = 2458; cfg.arm_hook_claws_half_pos = 2294; regcb(); return 0; } #endif #define PARAM int32_t paramN, const char **paraV, ICmdParserACK *ack void IntelligentWindingRobotCtrl::regcb() { // device_reset m_cmdparse->regCMD("device_reset", "()", 0, [this](PARAM) { return device_reset(); }); m_cmdparse->regCMD("xy_run_to_clip_pos_test", "()", 1, [this](PARAM) { return xy_run_to_clip_pos_test(atoi(paraV[0])); }); m_cmdparse->regCMD("disable_all_motor", "()", 0, [this](PARAM) { return disable_all_motor(); }); #if 0 m_cmdparse->regCMD("app_paifei_duoji_moveto_reset", "()", 0, [this](PARAM) { return paifei_duoji_moveto_reset(); }); m_cmdparse->regCMD("app_paifei_duoji_moveto_press", "()", 0, [this](PARAM) { return paifei_duoji_moveto_press(); }); m_cmdparse->regCMD("app_raoxiantance_duoji_move_to_reset", "()", 0, [this](PARAM) { return raoxiantance_duoji_move_to_reset(); }); m_cmdparse->regCMD("app_raoxiantance_duoji_move_to_get_thickness", "()", 0, [this](PARAM) { int32_t thickness = 0; int32_t err = raoxiantance_duoji_move_to_get_thickness(ack->getAck(1)); ack->acktype = ICmdParserACK::kAckType_int32; ack->rawlen = sizeof(int32_t); }); m_cmdparse->regCMD("app_yaxian_duoji_move_to_reset", "()", 0, [this](PARAM) { return yaxian_duoji_move_to_reset(); }); m_cmdparse->regCMD("app_yaxian_duoji_move_to_press_pos", "()", 0, [this](PARAM) { return yaxian_duoji_move_to_press_pos(); }); m_cmdparse->regCMD("app_yaxian_duoji_move_to_wait_for_press_pos", "()", 0, [this](PARAM) { return yaxian_duoji_move_to_wait_for_press_pos(); }); m_cmdparse->regCMD("app_xianlajin_duoji_move_to_reset", "()", 0, [this](PARAM) { return xianlajin_duoji_move_to_reset(); }); m_cmdparse->regCMD("app_xianlajin_duoji_move_to_line_entry_pos", "()", 0, [this](PARAM) { return xianlajin_duoji_move_to_line_entry_pos(); }); m_cmdparse->regCMD("app_xianlajin_duoji_move_to_tight_line_pos", "()", 0, [this](PARAM) { return xianlajin_duoji_move_to_tight_line_pos(); }); m_cmdparse->regCMD("app_xianlajin_duoji_move_to_loose_line_pos", "()", 0, [this](PARAM) { return xianlajin_duoji_move_to_loose_line_pos(); }); m_cmdparse->regCMD("app_jiaxian_duoji_move_to_reset_pos", "()", 0, [this](PARAM) { return jiaxian_duoji_move_to_reset_pos(); }); m_cmdparse->regCMD("app_jiaxian_duoji_move_to_clamp_pos", "()", 0, [this](PARAM) { return jiaxian_duoji_move_to_clamp_pos(); }); m_cmdparse->regCMD("app_scissors_move_reset_pos", "()", 0, [this](PARAM) { return scissors_move_reset_pos(); }); m_cmdparse->regCMD("app_scissors_cut", "()", 0, [this](PARAM) { return scissors_cut(); }); m_cmdparse->regCMD("app_arm_jiaxian_duoji_move_to_reset_pos", "()", 0, [this](PARAM) { return arm_jiaxian_duoji_move_to_reset_pos(); }); m_cmdparse->regCMD("app_arm_jiaxian_duoji_move_to_clamp_pos", "()", 0, [this](PARAM) { return arm_jiaxian_duoji_move_to_clamp_pos(); }); m_cmdparse->regCMD("app_arm_hook_claws_reset", "()", 0, [this](PARAM) { return arm_hook_claws_reset(); }); m_cmdparse->regCMD("app_arm_hook_claws_move_to_half_pos", "()", 0, [this](PARAM) { return arm_hook_claws_move_to_half_pos(); }); m_cmdparse->regCMD("app_arm_hook_claws_move_to_full_pos", "()", 0, [this](PARAM) { return arm_hook_claws_move_to_full_pos(); }); m_cmdparse->regCMD("app_main_shaft_run", "()", 0, [this](PARAM) { return main_shaft_run(); }); m_cmdparse->regCMD("app_main_shaft_stop", "()", 0, [this](PARAM) { return main_shaft_stop(); }); m_cmdparse->regCMD("app_xy_platform_reset", "()", 0, [this](PARAM) { return xy_platform_reset(); }); m_cmdparse->regCMD("app_z_axis_reset", "()", 0, [this](PARAM) { return z_axis_reset(); }); m_cmdparse->regCMD("app_z_axis_move_to", "(int32_t pos)", 1, [this](PARAM) { return z_axis_move_to(atoi(paraV[0])); }); m_cmdparse->regCMD("app_xy_reset", "()", 0, [this](PARAM) { return xy_reset(); }); m_cmdparse->regCMD("app_xy_move_to_zero", "()", 0, [this](PARAM) { return xy_move_to_zero(); }); m_cmdparse->regCMD("app_xy_take_clip", "(int32_t index)", 1, [this](PARAM) { return xy_take_clip(atoi(paraV[0])); }); m_cmdparse->regCMD("app_xy_take_line", "()", 0, [this](PARAM) { return xy_take_line(); }); m_cmdparse->regCMD("app_xy_take_back_clip", "()", 0, [this](PARAM) { return xy_take_back_clip(); }); m_cmdparse->regCMD("app_xy_remove_line", "()", 0, [this](PARAM) { return xy_remove_line(); }); m_cmdparse->regCMD("app_start_winding", "()", 0, [this](PARAM) { return start_winding(); }); m_cmdparse->regCMD("app_stop_winding", "()", 0, [this](PARAM) { return stop_winding(); }); m_cmdparse->regCMD("app_reset_and_check_device", "()", 0, [this](PARAM) { return reset_and_check_device(); }); m_cmdparse->regCMD("app_setcfg", "(const char* cfgname, int32_t cfgvalue)", 2, [this](PARAM) { return setcfg(paraV[0], atoi(paraV[1])); }); m_cmdparse->regCMD("app_dumpcfg", "()", 0, [this](PARAM) { return dumpcfg(); }); #endif }