正点原子开发板 alientek_develop_board cancmder
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
5.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include "sdk/os/zos.hpp"
  3. #include "sdk\components\zprotocols\zcancmder_v2\api\api.hpp"
  4. #include "sdk\components\zprotocols\zcancmder_v2\zmodule_device_manager.hpp"
  5. //
  6. #include "app_zmodule_device_manager.hpp"
  7. #define ZMOTOR_ID 4
  8. #define XYRobot_ID 3
  9. #define XYRobot_HOOK_ID 21
  10. namespace iflytop {
  11. using namespace std;
  12. class IntelligentWindingRobotCtrl {
  13. public:
  14. typedef struct {
  15. /**
  16. * @brief еۼ߶
  17. */
  18. int32_t m11_arm_jiaxian_reset_pos;
  19. int32_t m11_arm_jiaxian_clamp_direction;
  20. int32_t m11_arm_jiaxian_clamp_torque;
  21. /**
  22. * @brief ߼н
  23. */
  24. int32_t m12_jiaxian_reset_pos;
  25. int32_t m12_jiaxian_clamp_direction;
  26. int32_t m12_jiaxian_clamp_torque;
  27. /**
  28. * @brief ѹ߶
  29. */
  30. /**
  31. * ߶:
  32. * 1. ûе 1015
  33. * 2. е 1055
  34. * 3. п 1110
  35. *
  36. */
  37. int32_t m13_yaxian_forward_reset_pos; // ѹ������λ
  38. int32_t m13_yaxian_backward_reset_pos; // ��������λ
  39. int32_t m13_jiaxian_clamp_direction; // ѹ�߷���
  40. int32_t m13_jiaxian_clamp_torque; // ѹ��Ť��
  41. /**
  42. * @brief ̽
  43. */
  44. int32_t m14_raoxiantance_reset_pos;
  45. int32_t m14_raoxiantance_tance_zero_pos;
  46. /**
  47. * @brief ŷ϶
  48. */
  49. int32_t m15_paifei_reset_pos;
  50. int32_t m15_paifei_press_direction;
  51. int32_t m15_paifei_press_torque;
  52. /**
  53. * @brief
  54. */
  55. int32_t m16_xianlajin_reset_pos;
  56. int32_t m16_xianlajin_tight_line_pos;
  57. int32_t m16_xianlajin_winding_low_pos;
  58. int32_t m16_xianlajin_winding_up_pos;
  59. int32_t m16_xianlajin_line_entry_pos;
  60. /**
  61. * @brief צ
  62. */
  63. int32_t m21_arm_hook_claws_half_pos;
  64. int32_t m21_arm_hook_claws_full_pos;
  65. /**
  66. * @brief
  67. */
  68. // int32_t m22_scissors_cut_pos;
  69. /**
  70. * @brief
  71. */
  72. // int32_t m23_laxian_move_to_tight_pos;
  73. /**
  74. * @brief Zλ
  75. */
  76. int32_t z_axis_take_line_pos;
  77. int32_t z_axis_take_clip_pos;
  78. int32_t z_axis_winding_hight;
  79. /**
  80. * @brief XYƽ̨
  81. */
  82. int32_t xy_platform_winding_pos_x;
  83. int32_t xy_platform_winding_pos_y;
  84. int32_t xy_platform_takeline_pos_x;
  85. int32_t xy_platform_takeline_pos_y;
  86. int32_t xy_platform_takeline_clip00_pos_x; //
  87. int32_t xy_platform_takeline_clip00_pos_y;
  88. int32_t xy_platform_takeline_clipXX_pos_x;
  89. int32_t xy_platform_takeline_clipXX_pos_y;
  90. int32_t clip_line;
  91. int32_t clip_each_line_num;
  92. } config_t;
  93. APPDM* m_dm;
  94. ICmdParser* m_cmdparse;
  95. config_t cfg;
  96. public:
  97. int32_t initialize(APPDM* dm, ICmdParser* cmdparse);
  98. public:
  99. void wait_module_idle(int32_t moduleid);
  100. void wait_modules_idle(void* mark, ...);
  101. int32_t m11_arm_jiaxian_move_to_reset_pos();
  102. int32_t m11_arm_jiaxian_move_to_clamp_pos();
  103. int32_t m12_jiaxian_move_to_open_pos();
  104. int32_t m12_jiaxian_move_to_clamp_pos();
  105. int32_t m13_yaxian_move_to_reset_forward();
  106. int32_t m13_yaxian_move_to_reset_backward();
  107. int32_t m13_yaxian_press_clip();
  108. int32_t m14_raoxiantance_move_to_reset();
  109. int32_t m15_paifei_moveto_reset();
  110. int32_t m15_paifei_moveto_press();
  111. int32_t m16_xianlajin_move_to_reset();
  112. int32_t m16_xianlajin_move_to_tight_line_pos();
  113. int32_t m16_xianlajin_move_to_winding_low_pos();
  114. int32_t m16_xianlajin_move_to_winding_up_pos();
  115. int32_t m16_xianlajin_move_to_line_entry_pos();
  116. int32_t m21_arm_hook_claws_reset();
  117. int32_t m21_arm_hook_claws_move_to_half_pos();
  118. int32_t m21_arm_hook_claws_move_to_full_pos();
  119. int32_t m22_scissors_move_reset_pos(); // block
  120. int32_t m22_scissors_cut(); // block
  121. int32_t m23_laxian_motor_move_to_reset_pos(); // block
  122. int32_t m23_laxian_motor_move_to_tight_line_pos(); // block
  123. int32_t m4_zreset();
  124. int32_t m4_zmove_to(int32_t pos);
  125. int32_t device_reset();
  126. int32_t disable_all_module();
  127. int32_t enable_all_module();
  128. int32_t step_take_bullet(int32_t bulletindex);
  129. int32_t xy_get_point(int32_t clip_index, int32_t& x, int32_t& y); // ȡ����
  130. int32_t xy_run_to(int32_t x, int32_t y, int32_t zpos = 0, bool jiaxian_reset = true); // ȡ����
  131. int32_t xy_run_to_clip_pos_test(int32_t clip_index);
  132. int32_t xy_reset();
  133. int32_t xymove_to(int32_t x, int32_t y);
  134. void regcb();
  135. int32_t initialize_device();
  136. int32_t main_shaft_run();
  137. int32_t main_shaft_stop();
  138. /**
  139. * @brief XYƽ̨
  140. */
  141. int32_t xy_platform_reset();
  142. /**
  143. * @brief Z
  144. */
  145. int32_t z_axis_reset();
  146. int32_t z_axis_move_to(int32_t pos);
  147. int32_t xy_move_to_zero(); // �ƶ�����λ
  148. int32_t xy_take_clip(int32_t index); // ȡ����
  149. int32_t xy_take_line(); // ȡ��
  150. int32_t xy_take_back_clip(); // �ŵ���
  151. int32_t xy_remove_line(); // �Ƴ���
  152. /**
  153. * @brief
  154. */
  155. int32_t start_winding();
  156. int32_t stop_winding();
  157. int32_t reset_and_check_device();
  158. int32_t setcfg(const char* cfgname, int32_t cfgvalue);
  159. int32_t dumpcfg();
  160. int32_t do_reset_device();
  161. int32_t do_winding(int32_t index);
  162. void processError(int32_t err);
  163. };
  164. } // namespace iflytop