|
|
@ -232,8 +232,6 @@ int32_t XYRobotCtrlModule::module_set_reg(int32_t regindex, int32_t val) { |
|
|
|
MODULE_REG_CASE__NOT_SUPPORT(kreg_xyrobot_has_move_to_zero); |
|
|
|
MODULE_REG_CASE__NOT_SUPPORT(kreg_xyrobot_is_enable); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
return err::kmodule_not_find_reg; |
|
|
|
break; |
|
|
@ -244,7 +242,6 @@ int32_t XYRobotCtrlModule::module_set_reg(int32_t regindex, int32_t val) { |
|
|
|
return ret; |
|
|
|
} |
|
|
|
int32_t XYRobotCtrlModule::module_get_reg(int32_t regindex, int32_t* val) { |
|
|
|
|
|
|
|
int32_t ret = 0; |
|
|
|
switch (regindex) { |
|
|
|
MODULE_CFG_CASE__GET_REG_FROM(kreg_xyrobot_robot_type, m_cfg.robot_type); |
|
|
@ -281,7 +278,6 @@ int32_t XYRobotCtrlModule::module_get_reg(int32_t regindex, int32_t* val) { |
|
|
|
MODULE_CFG_CASE__GET_REG_FROM(kreg_xyrobot_has_move_to_zero, m_state.has_move_to_zero); |
|
|
|
MODULE_CFG_CASE__GET_REG_FROM(kreg_xyrobot_is_enable, m_state.is_enable); |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
return err::kmodule_not_find_reg; |
|
|
|
break; |
|
|
@ -329,7 +325,7 @@ int32_t XYRobotCtrlModule::do_xymotor_move_to_zero() { |
|
|
|
int32_t ecode = exec_move_to_zero_task(); |
|
|
|
after_motor_move(); |
|
|
|
if (ecode == 0) { |
|
|
|
setnowpos(0, 0); |
|
|
|
setnowpos(0 + m_cfg.shift_x, 0 + m_cfg.shift_y); |
|
|
|
m_state.has_move_to_zero = 1; |
|
|
|
} |
|
|
|
return; |
|
|
@ -451,12 +447,12 @@ void XYRobotCtrlModule::inverse_kinematics(int32_t m1pos, int32_t m2pos, int32_t |
|
|
|
if (m_cfg.x_shaft) x = -x; |
|
|
|
if (m_cfg.y_shaft) y = -y; |
|
|
|
|
|
|
|
x += m_cfg.shift_x; |
|
|
|
y += m_cfg.shift_y; |
|
|
|
// x += m_cfg.shift_x;
|
|
|
|
// y += m_cfg.shift_y;
|
|
|
|
} |
|
|
|
void XYRobotCtrlModule::forward_kinematics(int32_t x, int32_t y, int32_t& m1pos, int32_t& m2pos) { |
|
|
|
x -= m_cfg.shift_x; |
|
|
|
y -= m_cfg.shift_y; |
|
|
|
// x -= m_cfg.shift_x;
|
|
|
|
// y -= m_cfg.shift_y;
|
|
|
|
|
|
|
|
if (m_cfg.x_shaft) x = -x; |
|
|
|
if (m_cfg.y_shaft) y = -y; |
|
|
|