|
|
@ -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); |
|
|
|
} |
|
|
|