From 63ac046b356e9756bb3e82b3a68ea67d04ce1bcb Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 27 Sep 2023 15:36:29 +0800 Subject: [PATCH] update --- components/tmc/basic/tmc_ic_interface.hpp | 2 +- components/tmc/ic/ztmc4361A.cpp | 26 +++++++++++----------- components/tmc/ic/ztmc4361A.hpp | 4 ++-- components/tmc/ic/ztmc5130.cpp | 17 +++++++++----- components/tmc/ic/ztmc5130.hpp | 4 ++++ .../xy_robot_ctrl_module/xy_robot_ctrl_module.cpp | 20 ++++++++++++----- .../xy_robot_ctrl_module/xy_robot_ctrl_module.hpp | 5 +++-- components/zcancmder/cmd/basic_bean.hpp | 22 ++++++++++++++++++ components/zcancmder/cmd/c1006_module_cmd.hpp | 2 ++ .../zcancmder_module/zcan_xy_robot_module.cpp | 23 +++++++++++++++++++ 10 files changed, 97 insertions(+), 28 deletions(-) diff --git a/components/tmc/basic/tmc_ic_interface.hpp b/components/tmc/basic/tmc_ic_interface.hpp index 570c54d..bc738e0 100644 --- a/components/tmc/basic/tmc_ic_interface.hpp +++ b/components/tmc/basic/tmc_ic_interface.hpp @@ -58,7 +58,7 @@ class IStepperMotor { virtual bool isStoped() = 0; virtual void setIHOLD_IRUN(uint8_t ihold, uint8_t irun, uint16_t iholddelay) = 0; - virtual void setDistanceK(float distanceK) = 0; + virtual void setScale(float scale) = 0; virtual void enable(bool enable) = 0; }; diff --git a/components/tmc/ic/ztmc4361A.cpp b/components/tmc/ic/ztmc4361A.cpp index 832496a..04a6550 100644 --- a/components/tmc/ic/ztmc4361A.cpp +++ b/components/tmc/ic/ztmc4361A.cpp @@ -141,7 +141,7 @@ void TMC4361A::setAcceleration(float accelerationpps2) { * AMAX [pps2] = AMAX / 237 ?? fCLK^2 */ - accelerationpps2 *= m_distanceK; + accelerationpps2 *= m_scale; int32_t acc = (int32_t)accelerationpps2; writeInt(TMC4361A_AMAX, acc << 2); } @@ -156,7 +156,7 @@ void TMC4361A::setDeceleration(float accelerationpps2) { * a[?v per clk_cycle]= AMAX / 2^37 * AMAX [pps2] = AMAX / 237 ?? fCLK^2 */ - accelerationpps2 *= m_distanceK; + accelerationpps2 *= m_scale; int32_t acc = (int32_t)accelerationpps2; writeInt(TMC4361A_DMAX, acc << 2); } @@ -201,7 +201,7 @@ void TMC4361A::initialize(cfg_t *cfg) { driverIC_setIHOLD_IRUN(1, 3, 0); } -void TMC4361A::setDistanceK(float distanceK) { m_distanceK = distanceK; } +void TMC4361A::setScale(float scale) { m_scale = scale; } uint8_t TMC4361A::reset() { // Pulse the low-active hardware reset pin @@ -247,13 +247,13 @@ uint8_t TMC4361A::reset() { } uint8_t TMC4361A::restore() { return 1; } -int32_t TMC4361A::getXACTUAL() { return readInt(TMC4361A_XACTUAL) / m_distanceK; } -void TMC4361A::setXACTUAL(int32_t value) { writeInt(TMC4361A_XACTUAL, value * m_distanceK); } -int32_t TMC4361A::getVACTUAL() { return readInt(TMC4361A_VACTUAL) / m_distanceK; } -int32_t TMC4361A::getXTARGET() { return readInt(TMC4361A_X_TARGET) / m_distanceK; } -int32_t TMC4361A::getENC_POS() { return readInt(TMC4361A_ENC_POS) / m_distanceK; } -void TMC4361A::setENC_POS(int32_t value) { writeInt(TMC4361A_ENC_POS, value * m_distanceK); } -int32_t TMC4361A::getENC_POS_DEV() { return readInt(TMC4361A_ENC_POS_DEV_RD) / m_distanceK; } +int32_t TMC4361A::getXACTUAL() { return readInt(TMC4361A_XACTUAL) / m_scale; } +void TMC4361A::setXACTUAL(int32_t value) { writeInt(TMC4361A_XACTUAL, value * m_scale); } +int32_t TMC4361A::getVACTUAL() { return readInt(TMC4361A_VACTUAL) / m_scale; } +int32_t TMC4361A::getXTARGET() { return readInt(TMC4361A_X_TARGET) / m_scale; } +int32_t TMC4361A::getENC_POS() { return readInt(TMC4361A_ENC_POS) / m_scale; } +void TMC4361A::setENC_POS(int32_t value) { writeInt(TMC4361A_ENC_POS, value * m_scale); } +int32_t TMC4361A::getENC_POS_DEV() { return readInt(TMC4361A_ENC_POS_DEV_RD) / m_scale; } void TMC4361A::enableIC(bool enable) { SET_PIN(m_ennPin, !enable); SET_PIN(m_driverIC_ennPin, !enable); @@ -266,15 +266,15 @@ int32_t tmc4361A_discardVelocityDecimals(int32_t value) { return value << 8; } void TMC4361A::rotate(int32_t velocity) { - velocity *= m_distanceK; + velocity *= m_scale; m_motor_mode = kvelmode; PRV_FIELD_WRITE(TMC4361A_RAMPMODE, TMC4361A_OPERATION_MODE_MASK, TMC4361A_OPERATION_MODE_SHIFT, 0); writeInt(TMC4361A_VMAX, tmc4361A_discardVelocityDecimals(velocity)); } void TMC4361A::stop() { rotate(0); } void TMC4361A::moveTo(int32_t position, uint32_t velocityMax) { - position *= m_distanceK; - velocityMax *= m_distanceK; + position *= m_scale; + velocityMax *= m_scale; m_motor_mode = kposmode; PRV_FIELD_WRITE(TMC4361A_RAMPMODE, TMC4361A_OPERATION_MODE_MASK, TMC4361A_OPERATION_MODE_SHIFT, 1); diff --git a/components/tmc/ic/ztmc4361A.hpp b/components/tmc/ic/ztmc4361A.hpp index 4b618a0..e0b115e 100644 --- a/components/tmc/ic/ztmc4361A.hpp +++ b/components/tmc/ic/ztmc4361A.hpp @@ -74,7 +74,7 @@ class TMC4361A : public IStepperMotor { motor_mode_t m_motor_mode = kvelmode; - float m_distanceK = 1.0; + float m_scale = 1.0; public: TMC4361A(/* args */); @@ -116,7 +116,7 @@ class TMC4361A : public IStepperMotor { virtual void setIHOLD_IRUN(uint8_t ihold, uint8_t irun, uint16_t iholddelay) { driverIC_setIHOLD_IRUN(ihold, irun, iholddelay); } virtual void setMotorShaft(bool reverse) { driverIC_setMotorShaft(reverse); } - virtual void setDistanceK(float distanceK); + virtual void setScale(float scale); /******************************************************************************* * 驱动器初始化方法 * diff --git a/components/tmc/ic/ztmc5130.cpp b/components/tmc/ic/ztmc5130.cpp index 26585ed..ebb775c 100644 --- a/components/tmc/ic/ztmc5130.cpp +++ b/components/tmc/ic/ztmc5130.cpp @@ -1,4 +1,5 @@ #include "ztmc5130.hpp" + #include "sdk/os/zos.hpp" #ifdef HAL_SPI_MODULE_ENABLED @@ -92,11 +93,11 @@ uint8_t TMC5130::reset() { } return 0; } -int32_t TMC5130::getXACTUAL() { return readInt(TMC5130_XACTUAL); } -void TMC5130::setXACTUAL(int32_t value) { writeInt(TMC5130_XACTUAL, value); } -int32_t TMC5130::getVACTUAL() { return readInt(TMC5130_VACTUAL); } -void TMC5130::setAcceleration(float accelerationpps2) { writeInt(TMC5130_AMAX, (int32_t)(accelerationpps2)); } // 设置最大加速度 -void TMC5130::setDeceleration(float accelerationpps2) { writeInt(TMC5130_DMAX, (int32_t)(accelerationpps2)); } // 设置最大减速度 +int32_t TMC5130::getXACTUAL() { return readInt(TMC5130_XACTUAL) / m_scale; } +void TMC5130::setXACTUAL(int32_t value) { writeInt(TMC5130_XACTUAL, value * m_scale); } +int32_t TMC5130::getVACTUAL() { return readInt(TMC5130_VACTUAL) / m_scale; } +void TMC5130::setAcceleration(float accelerationpps2) { writeInt(TMC5130_AMAX, (int32_t)(accelerationpps2 * m_scale)); } // 设置最大加速度 +void TMC5130::setDeceleration(float accelerationpps2) { writeInt(TMC5130_DMAX, (int32_t)(accelerationpps2 * m_scale)); } // 设置最大减速度 void TMC5130::setMotorShaft(bool reverse) { PRV_FIELD_WRITE(TMC5130_GCONF, TMC5130_SHAFT_MASK, TMC5130_SHAFT_SHIFT, reverse); } void TMC5130::setIHOLD_IRUN(uint8_t ihold, uint8_t irun, uint16_t iholddelay) { writeInt(TMC5130_IHOLD_IRUN, (iholddelay << TMC5130_IHOLDDELAY_SHIFT) | (irun << TMC5130_IRUN_SHIFT) | (ihold << TMC5130_IHOLD_SHIFT)); @@ -112,12 +113,15 @@ Tmc5130RampStat TMC5130::getTMC5130_RAMPSTAT2() { } void TMC5130::stop() { rotate(0); } void TMC5130::rotate(int32_t velocity) { + velocity *= m_scale; writeInt(TMC5130_VMAX, abs(velocity)); writeInt(TMC5130_RAMPMODE, (velocity >= 0) ? TMC5130_MODE_VELPOS : TMC5130_MODE_VELNEG); } void TMC5130::right(int32_t velocity) { rotate(velocity); } void TMC5130::left(int32_t velocity) { rotate(-velocity); } void TMC5130::moveTo(int32_t position, uint32_t velocityMax) { + position *= m_scale; + velocityMax *= m_scale; writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); writeInt(TMC5130_VMAX, velocityMax); writeInt(TMC5130_XTARGET, position); @@ -149,6 +153,9 @@ bool TMC5130::isReachTarget() { return event.isSetted(Tmc5130RampStat::ktmc5130_rs_vzero) && event.isSetted(Tmc5130RampStat::ktmc5130_rs_velreached); } } + +void TMC5130::setScale(float scale) { m_scale = scale; } + /******************************************************************************* * basic * *******************************************************************************/ diff --git a/components/tmc/ic/ztmc5130.hpp b/components/tmc/ic/ztmc5130.hpp index 61fee3c..c8caebd 100644 --- a/components/tmc/ic/ztmc5130.hpp +++ b/components/tmc/ic/ztmc5130.hpp @@ -84,6 +84,8 @@ class TMC5130 : public IStepperMotor { const uint8_t *m_registerAccessTable; const int32_t *m_defaultRegisterResetState; + float m_scale = 1.0; + public: TMC5130(/* args */); @@ -109,6 +111,8 @@ class TMC5130 : public IStepperMotor { virtual int32_t getENC_POS() { return 0; } // TODO impl it virtual void setENC_POS(int32_t value) {} // TODO impl it + virtual void setScale(float scale); + virtual void setAcceleration(float accelerationpps2); virtual void setDeceleration(float accelerationpps2); diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp index efef66b..887948b 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp @@ -8,7 +8,7 @@ void XYRobotCtrlModule::initialize(IStepperMotor* stepM1, // IStepperMotor* stepM2, // ZGPIO* Xgpio, // ZGPIO* Ygpio, // - float distanceK) { + float scale) { m_stepM1 = stepM1; m_stepM2 = stepM2; m_Xgpio = Xgpio; @@ -17,8 +17,8 @@ void XYRobotCtrlModule::initialize(IStepperMotor* stepM1, // ZASSERT(m_stepM2); ZASSERT(m_Xgpio); ZASSERT(m_Ygpio); - m_stepM1->setDistanceK(distanceK); - m_stepM2->setDistanceK(distanceK); + m_stepM1->setScale(scale); + m_stepM2->setScale(scale); m_lock.init(); m_statu_lock.init(); m_thread.init("XYRobotCtrlModule", 1024, osPriorityNormal); @@ -331,14 +331,24 @@ int32_t XYRobotCtrlModule::set_runtozero_leave_away_zero_maxXY(int32_t maxXY) { int32_t XYRobotCtrlModule::set_distance_scale(float distance_scale) { zlock_guard lock(m_lock); ZLOGI(TAG, "set_distance_scale:%f", distance_scale); - m_stepM1->setDistanceK(distance_scale); - m_stepM2->setDistanceK(distance_scale); + m_stepM1->setScale(distance_scale); + m_stepM2->setScale(distance_scale); m_cfg_distance_scale = distance_scale; return 0; } void XYRobotCtrlModule::loop() {} +int32_t XYRobotCtrlModule::set_current_pos(int32_t x, int32_t y) { + zlock_guard lock(m_lock); + ZLOGI(TAG, "set_current_pos x:%d y:%d", x, y); + int32_t m1pos, m2pos; + forward_kinematics(x, y, m1pos, m2pos); + m_stepM1->setXACTUAL(m1pos); + m_stepM2->setXACTUAL(m2pos); + return 0; +} + int32_t XYRobotCtrlModule::set_zero_robottype(RobotType_t robot_type) { zlock_guard lock(m_lock); ZLOGI(TAG, "set_zero_robottype:%d", robot_type); diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp index 6b2b4de..fd0ade2 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp @@ -37,7 +37,7 @@ class XYRobotCtrlModule { int32_t m_cfg_runtozero_maxY = 5120000; int32_t m_cfg_runtozero_speed = 30000; int32_t m_cfg_runtozero_dec = 600000; - int32_t m_cfg_runtozero_leave_away_zero_maxXY = 51200 ; + int32_t m_cfg_runtozero_leave_away_zero_maxXY = 51200; float m_cfg_distance_scale = 1.0f; RobotType_t m_robot_type = corexy; @@ -49,7 +49,7 @@ class XYRobotCtrlModule { IStepperMotor* stepM2, // ZGPIO* Xgpio, // ZGPIO* Ygpio, // - float distanceK); + float scale); int32_t set_acc(int32_t acc); int32_t set_dec(int32_t dec); @@ -66,6 +66,7 @@ class XYRobotCtrlModule { int32_t set_runtozero_dec(int32_t dec); int32_t set_runtozero_leave_away_zero_maxXY(int32_t maxXY); int32_t set_distance_scale(float distance_scale); + int32_t set_current_pos(int32_t x, int32_t y); void dumpcfg(const char* tag); diff --git a/components/zcancmder/cmd/basic_bean.hpp b/components/zcancmder/cmd/basic_bean.hpp index 59cb387..2e9ef3d 100644 --- a/components/zcancmder/cmd/basic_bean.hpp +++ b/components/zcancmder/cmd/basic_bean.hpp @@ -73,6 +73,7 @@ typedef enum { kcmd_xy_robot_ctrl_move_to_zero_with_calibrate = CMDID(1006, 3), kcmd_xy_robot_ctrl_move_to = CMDID(1006, 4), kcmd_xy_robot_ctrl_move_by = CMDID(1006, 5), + kcmd_xy_robot_ctrl_set_current_pos = CMDID(1006, 6), kcmd_xy_robot_ctrl_read_status = CMDID(1006, 50), kcmd_xy_robot_ctrl_set_acc = CMDID(1006, 100), kcmd_xy_robot_ctrl_set_dec = CMDID(1006, 101), @@ -87,6 +88,27 @@ typedef enum { kcmd_xy_robot_ctrl_set_runtozero_leave_away_zero_maxXY = CMDID(1006, 110), kcmd_xy_robot_ctrl_set_distance_scale = CMDID(1006, 111), // + /******************************************************************************* + * 1007:单轴步进电机控制 * + *******************************************************************************/ + kcmd_step_motor_ctrl_enable = CMDID(1007, 0), + kcmd_step_motor_ctrl_stop = CMDID(1007, 1), + kcmd_step_motor_ctrl_move_to_zero = CMDID(1007, 2), + kcmd_step_motor_ctrl_move_to_zero_with_calibrate = CMDID(1007, 3), + kcmd_step_motor_ctrl_move_to = CMDID(1007, 4), + kcmd_step_motor_ctrl_move_by = CMDID(1007, 5), + kcmd_step_motor_ctrl_set_current_pos = CMDID(1007, 6), + kcmd_step_motor_ctrl_read_status = CMDID(1007, 50), + kcmd_step_motor_ctrl_set_acc = CMDID(1007, 100), + kcmd_step_motor_ctrl_set_dec = CMDID(1007, 101), + kcmd_step_motor_ctrl_set_speed = CMDID(1007, 102), + kcmd_step_motor_ctrl_set_shaft = CMDID(1007, 103), + kcmd_step_motor_ctrl_set_zero_shift = CMDID(1007, 104), + kcmd_step_motor_ctrl_set_runtozero_max_distance = CMDID(1007, 105), + kcmd_step_motor_ctrl_set_runtozero_speed = CMDID(1007, 106), + kcmd_step_motor_ctrl_set_runtozero_dec = CMDID(1007, 107), + kcmd_step_motor_ctrl_set_runtozero_leave_away_zero_max_distance = CMDID(1007, 108), + kcmd_step_motor_ctrl_set_distance_scale = CMDID(1007, 109), } CmdID_t; diff --git a/components/zcancmder/cmd/c1006_module_cmd.hpp b/components/zcancmder/cmd/c1006_module_cmd.hpp index aa0c9c1..f3a58fd 100644 --- a/components/zcancmder/cmd/c1006_module_cmd.hpp +++ b/components/zcancmder/cmd/c1006_module_cmd.hpp @@ -18,6 +18,7 @@ ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_to_zero, cmd, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_to_zero_with_calibrate, cmd, uint8_t id; uint8_t _pad; int32_t x; int32_t y;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_to, cmd, uint8_t id; uint8_t _pad; int32_t x; int32_t y;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_by, cmd, uint8_t id; uint8_t _pad; int32_t dx; int32_t dy;); +ZPACKET_STRUCT(kcmd_xy_robot_ctrl_set_current_pos, cmd, uint8_t id; uint8_t _pad; int32_t x; int32_t y;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_read_status, cmd, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_set_acc, cmd, uint8_t id; uint8_t _pad; int32_t acc;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_set_dec, cmd, uint8_t id; uint8_t _pad; int32_t dec;); @@ -41,6 +42,7 @@ ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_to_zero, ack, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_to_zero_with_calibrate, ack, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_to, ack, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_move_by, ack, uint8_t id; uint8_t _pad;); +ZPACKET_STRUCT(kcmd_xy_robot_ctrl_set_current_pos, ack, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_read_status, ack, uint8_t id; uint8_t module_statu; int32_t x; int32_t y;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_set_acc, ack, uint8_t id; uint8_t _pad;); ZPACKET_STRUCT(kcmd_xy_robot_ctrl_set_dec, ack, uint8_t id; uint8_t _pad;); diff --git a/components/zcancmder_module/zcan_xy_robot_module.cpp b/components/zcancmder_module/zcan_xy_robot_module.cpp index faa1395..a45355c 100644 --- a/components/zcancmder_module/zcan_xy_robot_module.cpp +++ b/components/zcancmder_module/zcan_xy_robot_module.cpp @@ -16,10 +16,12 @@ void ZCANXYRobotCtrlModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { errorcode = m_xyRobotCtrlModule->enable(cmd->enable); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_stop, m_id) { // errorcode = m_xyRobotCtrlModule->stop(); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_move_to_zero, m_id) { // errorcode = m_xyRobotCtrlModule->move_to_zero([this, cmdheader](int32_t exec_status, int32_t dx, int32_t dy) { osDelay(5); // 用来保证回执消息在前面 @@ -34,6 +36,7 @@ void ZCANXYRobotCtrlModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { }); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_move_to_zero_with_calibrate, m_id) { // errorcode = m_xyRobotCtrlModule->move_to_zero_with_calibrate(cmd->x, cmd->y, [this, cmdheader](int32_t exec_status, int32_t zero_shift_x, int32_t zero_shift_y) { @@ -49,6 +52,7 @@ void ZCANXYRobotCtrlModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { }); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_move_to, m_id) { // errorcode = m_xyRobotCtrlModule->move_to(cmd->x, cmd->y, [this, cmdheader](int32_t exec_status, int32_t tox, int32_t toy) { osDelay(5); // 用来保证回执消息在前面 @@ -63,6 +67,7 @@ void ZCANXYRobotCtrlModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { }); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_move_by, m_id) { // errorcode = m_xyRobotCtrlModule->move_by(cmd->dx, cmd->dy, [this, cmdheader](int32_t exec_status, int32_t tox, int32_t toy) { ZLOGI(TAG, "kcmd_xy_robot_ctrl_move_by exec_status:%d tox:%d toy:%d", exec_status, tox, toy); @@ -76,54 +81,72 @@ void ZCANXYRobotCtrlModule::onRceivePacket(CanPacketRxBuffer* rxcmd) { }); } END_PROCESS_PACKET(); + + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_current_pos, m_id) { // + errorcode = m_xyRobotCtrlModule->set_current_pos(cmd->x, cmd->y); + } + END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_read_status, m_id) { // errorcode = m_xyRobotCtrlModule->read_status(&ack->module_statu, &ack->x, &ack->y); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_acc, m_id) { // errorcode = m_xyRobotCtrlModule->set_acc(cmd->acc); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_dec, m_id) { // errorcode = m_xyRobotCtrlModule->set_dec(cmd->dec); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_speed, m_id) { // errorcode = m_xyRobotCtrlModule->set_speed(cmd->speed); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_x_shaft, m_id) { // errorcode = m_xyRobotCtrlModule->set_x_shaft(cmd->x_shaft); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_y_shaft, m_id) { // errorcode = m_xyRobotCtrlModule->set_y_shaft(cmd->y_shaft); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_zero_robottype, m_id) { // errorcode = m_xyRobotCtrlModule->set_zero_robottype((XYRobotCtrlModule::RobotType_t)cmd->zero_robottype); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_runtozero_maxX, m_id) { // errorcode = m_xyRobotCtrlModule->set_runtozero_maxX(cmd->maxX); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_runtozero_maxY, m_id) { // errorcode = m_xyRobotCtrlModule->set_runtozero_maxY(cmd->maxY); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_runtozero_speed, m_id) { // errorcode = m_xyRobotCtrlModule->set_runtozero_speed(cmd->speed); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_runtozero_dec, m_id) { // errorcode = m_xyRobotCtrlModule->set_runtozero_dec(cmd->dec); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_runtozero_leave_away_zero_maxXY, m_id) { // errorcode = m_xyRobotCtrlModule->set_runtozero_leave_away_zero_maxXY(cmd->maxXY); } END_PROCESS_PACKET(); + PROCESS_PACKET(kcmd_xy_robot_ctrl_set_distance_scale, m_id) { // errorcode = m_xyRobotCtrlModule->set_distance_scale(cmd->distance_scale); }