正点原子开发板 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.

433 lines
18 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
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. #include "intelligent_winding_robot_ctrl.hpp"
  2. #include <stdarg.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <exception>
  6. using namespace std;
  7. using namespace iflytop;
  8. #define TAG "APPDM"
  9. #define DO(exptr) \
  10. { \
  11. int32_t ret = exptr; \
  12. if (ret != 0) { \
  13. return ret; \
  14. } \
  15. }
  16. #define PARAM int32_t paramN, const char **paraV, ICmdParserACK *ack
  17. void IntelligentWindingRobotCtrl::processError(int32_t err) { ZLOGE(TAG, "processError: %d", err); }
  18. class myexception : public exception {
  19. virtual const char* what() const throw() { return "My exception happened"; }
  20. };
  21. int32_t IntelligentWindingRobotCtrl::initialize(APPDM* dm, ICmdParser* cmdparse) {
  22. m_dm = dm;
  23. m_cmdparse = cmdparse;
  24. initialize_device();
  25. regcb();
  26. return 0;
  27. }
  28. int32_t IntelligentWindingRobotCtrl::initialize_device() {
  29. cfg.xy_platform_takeline_clip00_pos_x = 1736;
  30. cfg.xy_platform_takeline_clip00_pos_y = 16853;
  31. cfg.xy_platform_takeline_clipXX_pos_x = 52307;
  32. cfg.xy_platform_takeline_clipXX_pos_y = 31993;
  33. cfg.clip_line = 12;
  34. cfg.clip_each_line_num = 5;
  35. cfg.m11_arm_jiaxian_reset_pos = 2619;
  36. cfg.m11_arm_jiaxian_clamp_torque = 330;
  37. cfg.m11_arm_jiaxian_clamp_direction = -1;
  38. cfg.m12_jiaxian_reset_pos = 2600;
  39. cfg.m12_jiaxian_clamp_direction = -1;
  40. cfg.m12_jiaxian_clamp_torque = 330;
  41. cfg.m13_yaxian_forward_reset_pos = 1015;
  42. cfg.m13_yaxian_backward_reset_pos = 2885;
  43. cfg.m13_jiaxian_clamp_direction = -1;
  44. cfg.m13_jiaxian_clamp_torque = 200;
  45. cfg.m14_raoxiantance_reset_pos = 2047;
  46. cfg.m14_raoxiantance_tance_zero_pos = 2517;
  47. cfg.m15_paifei_reset_pos = 2046;
  48. cfg.m15_paifei_press_direction = 1;
  49. cfg.m15_paifei_press_torque = 330;
  50. cfg.m16_xianlajin_reset_pos = 2047;
  51. cfg.m16_xianlajin_tight_line_pos = 1966;
  52. cfg.m16_xianlajin_winding_low_pos = 1900;
  53. cfg.m16_xianlajin_winding_up_pos = 1865;
  54. cfg.m16_xianlajin_line_entry_pos = 1833;
  55. cfg.m21_arm_hook_claws_full_pos = 2558;
  56. cfg.m21_arm_hook_claws_half_pos = 2294;
  57. cfg.z_axis_take_clip_pos = 6924;
  58. return 0;
  59. }
  60. void IntelligentWindingRobotCtrl::regcb() {
  61. // device_reset
  62. m_cmdparse->regCMD("device_reset", "()", 0, [this](PARAM) { device_reset(); });
  63. m_cmdparse->regCMD("enable_all_module", "()", 0, [this](PARAM) { enable_all_module(); });
  64. m_cmdparse->regCMD("disable_all_module", "()", 0, [this](PARAM) { disable_all_module(); });
  65. m_cmdparse->regCMD("xy_run_to_clip_pos_test", "()", 1, [this](PARAM) { return xy_run_to_clip_pos_test(atoi(paraV[0])); });
  66. // m_cmdparse->regCMD("disable_all_motor", "()", 0, [this](PARAM) { return disable_all_motor(); });
  67. m_cmdparse->regCMD("app_m11_arm_jiaxian_move_to_reset_pos", "()", 0, [this](PARAM) { return m11_arm_jiaxian_move_to_reset_pos(); });
  68. m_cmdparse->regCMD("app_m11_arm_jiaxian_move_to_clamp_pos", "()", 0, [this](PARAM) { return m11_arm_jiaxian_move_to_clamp_pos(); });
  69. m_cmdparse->regCMD("app_m12_jiaxian_move_to_reset_pos", "()", 0, [this](PARAM) { return m12_jiaxian_move_to_reset_pos(); });
  70. m_cmdparse->regCMD("app_m12_jiaxian_move_to_clamp_pos", "()", 0, [this](PARAM) { return m12_jiaxian_move_to_clamp_pos(); });
  71. m_cmdparse->regCMD("app_m13_yaxian_move_to_reset_forward", "()", 0, [this](PARAM) { return m13_yaxian_move_to_reset_forward(); });
  72. m_cmdparse->regCMD("app_m13_yaxian_move_to_reset_backward", "()", 0, [this](PARAM) { return m13_yaxian_move_to_reset_backward(); });
  73. m_cmdparse->regCMD("app_m13_yaxian_press_clip", "()", 0, [this](PARAM) { return m13_yaxian_press_clip(); });
  74. m_cmdparse->regCMD("app_m14_raoxiantance_move_to_reset", "()", 0, [this](PARAM) { return m14_raoxiantance_move_to_reset(); });
  75. m_cmdparse->regCMD("app_m15_paifei_moveto_reset", "()", 0, [this](PARAM) { return m15_paifei_moveto_reset(); });
  76. m_cmdparse->regCMD("app_m15_paifei_moveto_press", "()", 0, [this](PARAM) { return m15_paifei_moveto_press(); });
  77. m_cmdparse->regCMD("app_m16_xianlajin_move_to_reset", "()", 0, [this](PARAM) { return m16_xianlajin_move_to_reset(); });
  78. m_cmdparse->regCMD("app_m16_xianlajin_move_to_tight_line_pos", "()", 0, [this](PARAM) { return m16_xianlajin_move_to_tight_line_pos(); });
  79. m_cmdparse->regCMD("app_m16_xianlajin_move_to_winding_low_pos", "()", 0, [this](PARAM) { return m16_xianlajin_move_to_winding_low_pos(); });
  80. m_cmdparse->regCMD("app_m16_xianlajin_move_to_winding_up_pos", "()", 0, [this](PARAM) { return m16_xianlajin_move_to_winding_up_pos(); });
  81. m_cmdparse->regCMD("app_m16_xianlajin_move_to_line_entry_pos", "()", 0, [this](PARAM) { return m16_xianlajin_move_to_line_entry_pos(); });
  82. m_cmdparse->regCMD("app_m21_arm_hook_claws_reset", "()", 0, [this](PARAM) { return m21_arm_hook_claws_reset(); });
  83. m_cmdparse->regCMD("app_m21_arm_hook_claws_move_to_half_pos", "()", 0, [this](PARAM) { return m21_arm_hook_claws_move_to_half_pos(); });
  84. m_cmdparse->regCMD("app_m21_arm_hook_claws_move_to_full_pos", "()", 0, [this](PARAM) { return m21_arm_hook_claws_move_to_full_pos(); });
  85. m_cmdparse->regCMD("app_m22_scissors_move_reset_pos", "()", 0, [this](PARAM) { return m22_scissors_move_reset_pos(); });
  86. m_cmdparse->regCMD("app_m22_scissors_cut", "()", 0, [this](PARAM) { return m22_scissors_cut(); });
  87. m_cmdparse->regCMD("app_m23_laxian_motor_move_to_reset_pos", "()", 0, [this](PARAM) { return m23_laxian_motor_move_to_reset_pos(); });
  88. m_cmdparse->regCMD("app_m23_laxian_motor_move_to_tight_line_pos", "()", 0, [this](PARAM) { return m23_laxian_motor_move_to_tight_line_pos(); });
  89. }
  90. void IntelligentWindingRobotCtrl::wait_module_idle(int32_t moduleid) {
  91. zos_delay(100);
  92. int i = 0;
  93. while (true) {
  94. int32_t status = 0;
  95. int32_t ecode = m_dm->module_get_status(moduleid, &status);
  96. if (ecode != 0) {
  97. processError(ecode);
  98. break;
  99. };
  100. if (status == 0) {
  101. ZLOGI(TAG, "wait_module_idle %d %d....", moduleid, status);
  102. break;
  103. }
  104. if (status == 2) {
  105. processError(err::kfail);
  106. break;
  107. };
  108. if (i % 30 == 0) {
  109. ZLOGI(TAG, "wait_module_idle %d %d....", moduleid, status);
  110. break;
  111. }
  112. i++;
  113. zos_delay(100);
  114. }
  115. }
  116. void IntelligentWindingRobotCtrl::wait_modules_idle(void* mark, ...) {
  117. int32_t moduleid = 0;
  118. va_list args;
  119. va_start(args, mark);
  120. moduleid = va_arg(args, int32_t);
  121. while (moduleid > 0) {
  122. wait_module_idle(moduleid);
  123. moduleid = va_arg(args, int32_t);
  124. }
  125. va_end(args);
  126. }
  127. int32_t IntelligentWindingRobotCtrl::disable_all_module() {
  128. m_dm->motor_enable(2, 0);
  129. m_dm->xymotor_enable(3, 0);
  130. m_dm->motor_enable(4, 0);
  131. m_dm->motor_enable(11, 0);
  132. m_dm->motor_enable(12, 0);
  133. m_dm->motor_enable(13, 0);
  134. m_dm->motor_enable(14, 0);
  135. m_dm->motor_enable(15, 0);
  136. m_dm->motor_enable(16, 0);
  137. m_dm->motor_enable(21, 0);
  138. m_dm->motor_enable(22, 0);
  139. m_dm->motor_enable(23, 0);
  140. return 0;
  141. }
  142. int32_t IntelligentWindingRobotCtrl::enable_all_module() {
  143. m_dm->motor_enable(2, 1);
  144. m_dm->xymotor_enable(3, 1);
  145. m_dm->motor_enable(4, 1);
  146. m_dm->motor_enable(11, 1);
  147. m_dm->motor_enable(12, 1);
  148. m_dm->motor_enable(13, 1);
  149. m_dm->motor_enable(14, 1);
  150. m_dm->motor_enable(15, 1);
  151. m_dm->motor_enable(16, 1);
  152. m_dm->motor_enable(21, 1);
  153. m_dm->motor_enable(22, 1);
  154. m_dm->motor_enable(23, 1);
  155. return 0;
  156. }
  157. #define WAIT_MODULES_IDLE(...) \
  158. { wait_modules_idle(NULL, __VA_ARGS__, NULL); }
  159. int32_t IntelligentWindingRobotCtrl::device_reset() {
  160. // Z�Ḵλ
  161. /**
  162. * @
  163. *
  164. * 1. Zλ
  165. * 2. M13λ
  166. * 3. M13λ,ȴһʱM13Ƿλɹ
  167. * 4. е۸λ
  168. */
  169. enable_all_module();
  170. m4_zreset();
  171. m11_arm_jiaxian_move_to_reset_pos();
  172. m21_arm_hook_claws_reset();
  173. WAIT_MODULES_IDLE(4, 11, 21);
  174. m12_jiaxian_move_to_reset_pos();
  175. m14_raoxiantance_move_to_reset();
  176. m15_paifei_moveto_reset();
  177. m16_xianlajin_move_to_reset();
  178. m22_scissors_move_reset_pos();
  179. m23_laxian_motor_move_to_reset_pos();
  180. WAIT_MODULES_IDLE(12, 14, 15, 16, 22, 23);
  181. /**
  182. * @brief Żλ߼ʱλʧܣ
  183. */
  184. m13_yaxian_move_to_reset_backward();
  185. wait_module_idle(13);
  186. m_dm->xymotor_move_to_zero(XYRobot_ID);
  187. wait_module_idle(XYRobot_ID);
  188. ZLOGI(TAG, "device_reset finished....");
  189. }
  190. int32_t IntelligentWindingRobotCtrl::m11_arm_jiaxian_move_to_reset_pos() { return m_dm->motor_move_to(11, cfg.m11_arm_jiaxian_reset_pos, 2000, 0); }
  191. int32_t IntelligentWindingRobotCtrl::m11_arm_jiaxian_move_to_clamp_pos() { return m_dm->motor_rotate_with_torque(11, cfg.m11_arm_jiaxian_clamp_direction, cfg.m11_arm_jiaxian_clamp_torque); }
  192. int32_t IntelligentWindingRobotCtrl::m12_jiaxian_move_to_reset_pos() { return m_dm->motor_move_to(12, cfg.m12_jiaxian_reset_pos, 2000, 0); }
  193. int32_t IntelligentWindingRobotCtrl::m12_jiaxian_move_to_clamp_pos() { return m_dm->motor_rotate_with_torque(12, cfg.m12_jiaxian_clamp_direction, cfg.m12_jiaxian_clamp_torque); }
  194. int32_t IntelligentWindingRobotCtrl::m13_yaxian_move_to_reset_forward() { return m_dm->motor_move_to(13, cfg.m13_yaxian_forward_reset_pos, 2000, 0); }
  195. int32_t IntelligentWindingRobotCtrl::m13_yaxian_move_to_reset_backward() { return m_dm->motor_move_to(13, cfg.m13_yaxian_backward_reset_pos, 2000, 0); }
  196. int32_t IntelligentWindingRobotCtrl::m13_yaxian_press_clip() { return m_dm->motor_rotate_with_torque(13, cfg.m13_jiaxian_clamp_direction, cfg.m13_jiaxian_clamp_torque); }
  197. int32_t IntelligentWindingRobotCtrl::m14_raoxiantance_move_to_reset() { return m_dm->motor_move_to(14, cfg.m14_raoxiantance_reset_pos, 2000, 0); }
  198. int32_t IntelligentWindingRobotCtrl::m15_paifei_moveto_reset() { return m_dm->motor_move_to(15, cfg.m15_paifei_reset_pos, 2000, 0); }
  199. int32_t IntelligentWindingRobotCtrl::m15_paifei_moveto_press() { return m_dm->motor_rotate_with_torque(15, cfg.m15_paifei_press_direction, cfg.m15_paifei_press_torque); }
  200. int32_t IntelligentWindingRobotCtrl::m16_xianlajin_move_to_reset() { return m_dm->motor_move_to(16, cfg.m16_xianlajin_reset_pos, 300, 0); }
  201. int32_t IntelligentWindingRobotCtrl::m16_xianlajin_move_to_tight_line_pos() { return m_dm->motor_move_to(16, cfg.m16_xianlajin_tight_line_pos, 100, 0); }
  202. int32_t IntelligentWindingRobotCtrl::m16_xianlajin_move_to_winding_low_pos() { return m_dm->motor_move_to(16, cfg.m16_xianlajin_winding_low_pos, 100, 0); }
  203. int32_t IntelligentWindingRobotCtrl::m16_xianlajin_move_to_winding_up_pos() { return m_dm->motor_move_to(16, cfg.m16_xianlajin_winding_up_pos, 100, 0); }
  204. int32_t IntelligentWindingRobotCtrl::m16_xianlajin_move_to_line_entry_pos() { return m_dm->motor_move_to(16, cfg.m16_xianlajin_line_entry_pos, 100, 0); }
  205. int32_t IntelligentWindingRobotCtrl::m21_arm_hook_claws_reset() { return m_dm->motor_move_to_zero_backward(21, 0, 0, 0, 0); }
  206. int32_t IntelligentWindingRobotCtrl::m21_arm_hook_claws_move_to_half_pos() { return m_dm->motor_move_to(21, cfg.m21_arm_hook_claws_half_pos, 0, 0); }
  207. int32_t IntelligentWindingRobotCtrl::m21_arm_hook_claws_move_to_full_pos() { return m_dm->motor_move_to(21, cfg.m21_arm_hook_claws_full_pos, 0, 0); }
  208. int32_t IntelligentWindingRobotCtrl::m22_scissors_move_reset_pos() { return 0; }
  209. int32_t IntelligentWindingRobotCtrl::m22_scissors_cut() { return m_dm->motor_rotate_with_torque(22, 1, 4095); }
  210. int32_t IntelligentWindingRobotCtrl::m23_laxian_motor_move_to_reset_pos() { return m_dm->motor_move_to_zero_backward(23, 0, 0, 0, 0); }
  211. int32_t IntelligentWindingRobotCtrl::m23_laxian_motor_move_to_tight_line_pos() { return m_dm->motor_move_to(23, 500, 0, 0); }
  212. int32_t IntelligentWindingRobotCtrl::m4_zreset() { m_dm->motor_move_to_zero_backward(4, 450, 300, 2000, 0); }
  213. int32_t IntelligentWindingRobotCtrl::m4_zmove_to(int32_t pos) {
  214. ZLOGI(TAG, "zmove_to %d", pos);
  215. int32_t nowpos = 0;
  216. m_dm->motor_read_pos(ZMOTOR_ID, &nowpos);
  217. if (pos >= nowpos) {
  218. m_dm->motor_move_to(ZMOTOR_ID, pos, 450, 600);
  219. } else {
  220. m_dm->motor_move_to(ZMOTOR_ID, pos, 1000, 600);
  221. }
  222. if (pos == 0) {
  223. m4_zreset();
  224. }
  225. }
  226. int32_t IntelligentWindingRobotCtrl::main_shaft_run() {
  227. ZLOGI(TAG, "main_shaft_run");
  228. DO(m_dm->motor_rotate_acctime(2, 1, 1000, 10000));
  229. return 0;
  230. }
  231. int32_t IntelligentWindingRobotCtrl::main_shaft_stop() {
  232. ZLOGI(TAG, "main_shaft_stop");
  233. DO(m_dm->module_stop(2));
  234. return 0;
  235. }
  236. /**
  237. * @brief XYƽ̨
  238. */
  239. int32_t IntelligentWindingRobotCtrl::xy_platform_reset() { return 0; }
  240. /**
  241. * @brief Z
  242. */
  243. int32_t IntelligentWindingRobotCtrl::z_axis_reset() { return 0; }
  244. int32_t IntelligentWindingRobotCtrl::z_axis_move_to(int32_t pos) { return 0; }
  245. int32_t IntelligentWindingRobotCtrl::xy_move_to_zero() { return 0; } // �ƶ�����λ
  246. int32_t IntelligentWindingRobotCtrl::xy_take_clip(int32_t index) { return 0; } // ȡ����
  247. int32_t IntelligentWindingRobotCtrl::xy_take_line() { return 0; } // ȡ��
  248. int32_t IntelligentWindingRobotCtrl::xy_take_back_clip() { return 0; } // �ŵ���
  249. int32_t IntelligentWindingRobotCtrl::xy_remove_line() { return 0; } // �Ƴ���
  250. int32_t IntelligentWindingRobotCtrl::do_reset_device() {}
  251. int32_t IntelligentWindingRobotCtrl::do_winding(int32_t index) {}
  252. /**
  253. * @brief
  254. */
  255. int32_t IntelligentWindingRobotCtrl::start_winding() { return 0; }
  256. int32_t IntelligentWindingRobotCtrl::stop_winding() { return 0; }
  257. int32_t IntelligentWindingRobotCtrl::reset_and_check_device() { return 0; }
  258. int32_t IntelligentWindingRobotCtrl::xy_get_point(int32_t clip_index, int32_t& x, int32_t& y) {
  259. int clip_x_off = clip_index / cfg.clip_each_line_num;
  260. int clip_y_off = clip_index % cfg.clip_each_line_num;
  261. float eachx = (cfg.xy_platform_takeline_clipXX_pos_x - cfg.xy_platform_takeline_clip00_pos_x) / (cfg.clip_line - 1);
  262. float eachy = (cfg.xy_platform_takeline_clipXX_pos_y - cfg.xy_platform_takeline_clip00_pos_y) / (cfg.clip_each_line_num - 1);
  263. x = cfg.xy_platform_takeline_clip00_pos_x + eachx * clip_x_off;
  264. y = cfg.xy_platform_takeline_clip00_pos_y + eachy * clip_y_off;
  265. return 0;
  266. }
  267. #if 0
  268. int32_t IntelligentWindingRobotCtrl::zmove_to(int32_t pos) {
  269. ZLOGI(TAG, "zmove_to %d", pos);
  270. int32_t nowpos = 0;
  271. m_dm->motor_read_pos(ZMOTOR_ID, &nowpos);
  272. if (pos >= nowpos) {
  273. m_dm->motor_move_to(ZMOTOR_ID, pos, 450, 600);
  274. } else {
  275. m_dm->motor_move_to(ZMOTOR_ID, pos, 1000, 600);
  276. }
  277. if (pos == 0) {
  278. zreset();
  279. }
  280. wait_module_idle(ZMOTOR_ID);
  281. return 0;
  282. }
  283. int32_t IntelligentWindingRobotCtrl::zreset() {
  284. ZLOGI(TAG, "zreset");
  285. m_dm->motor_enable(ZMOTOR_ID, 1);
  286. wait_module_idle(ZMOTOR_ID);
  287. return 0;
  288. }
  289. #endif
  290. int32_t IntelligentWindingRobotCtrl::xymove_to(int32_t x, int32_t y) {
  291. ZLOGI(TAG, "xymove_to %d %d", x, y);
  292. m_dm->xymotor_move_to(XYRobot_ID, x, y, 0);
  293. wait_module_idle(XYRobot_ID);
  294. return 0;
  295. }
  296. int32_t IntelligentWindingRobotCtrl::xy_reset() {
  297. ZLOGI(TAG, "xy_reset");
  298. m_dm->xymotor_move_to_zero(XYRobot_ID);
  299. wait_module_idle(XYRobot_ID);
  300. return 0;
  301. }
  302. int32_t IntelligentWindingRobotCtrl::xy_run_to_clip_pos_test(int32_t clip_index) {
  303. #if 0
  304. ZLOGI(TAG, "xy_run_to_clip_pos_test %d", clip_index);
  305. if (clip_index >= cfg.clip_line * cfg.clip_each_line_num) {
  306. ZLOGE(TAG, "clip_index %d out of range", clip_index);
  307. return err::kparam_out_of_range;
  308. }
  309. zreset();
  310. m11_arm_jiaxian_move_to_reset_pos();
  311. m21_arm_hook_claws_reset();
  312. int32_t x = 0;
  313. int32_t y = 0;
  314. xy_get_point(clip_index, x, y);
  315. xymove_to(x, y);
  316. zmove_to(cfg.z_axis_take_clip_pos);
  317. m21_arm_hook_claws_move_to_full_pos();
  318. zmove_to(0);
  319. zmove_to(cfg.z_axis_take_clip_pos);
  320. m21_arm_hook_claws_reset();
  321. zmove_to(0);
  322. #endif
  323. }
  324. int32_t IntelligentWindingRobotCtrl::setcfg(const char* cfgname, int32_t cfgvalue) {
  325. #if 0
  326. if (strcmp(cfgname, "paifei_reset_pos") == 0)
  327. cfg.paifei_reset_pos = cfgvalue;
  328. else if (strcmp(cfgname, "paifei_press_pos") == 0)
  329. cfg.paifei_press_pos = cfgvalue;
  330. else if (strcmp(cfgname, "paifei_press_torque") == 0)
  331. cfg.paifei_press_torque = cfgvalue;
  332. else if (strcmp(cfgname, "raoxiantance_reset_pos") == 0)
  333. cfg.raoxiantance_reset_pos = cfgvalue;
  334. else if (strcmp(cfgname, "raoxiantance_tance_zero_pos") == 0)
  335. cfg.raoxiantance_tance_zero_pos = cfgvalue;
  336. else if (strcmp(cfgname, "yaxian_reset_pos") == 0)
  337. cfg.yaxian_reset_pos = cfgvalue;
  338. else if (strcmp(cfgname, "yaxian_press_pos") == 0)
  339. cfg.yaxian_press_pos = cfgvalue;
  340. else if (strcmp(cfgname, "yaxian_press_torque") == 0)
  341. cfg.yaxian_press_torque = cfgvalue;
  342. else if (strcmp(cfgname, "yaxian_wait_for_press_pos") == 0)
  343. cfg.yaxian_wait_for_press_pos = cfgvalue;
  344. else if (strcmp(cfgname, "xianlajin_reset_pos") == 0)
  345. cfg.xianlajin_reset_pos = cfgvalue;
  346. else if (strcmp(cfgname, "xianlajin_line_entry_pos") == 0)
  347. cfg.xianlajin_line_entry_pos = cfgvalue;
  348. else if (strcmp(cfgname, "xianlajin_tight_line_pos") == 0)
  349. cfg.xianlajin_tight_line_pos = cfgvalue;
  350. else if (strcmp(cfgname, "xianlajin_loose_line_pos") == 0)
  351. cfg.xianlajin_loose_line_pos = cfgvalue;
  352. else if (strcmp(cfgname, "jiaxian_reset_pos") == 0)
  353. cfg.jiaxian_reset_pos = cfgvalue;
  354. else if (strcmp(cfgname, "jiaxian_clamp_pos") == 0)
  355. cfg.jiaxian_clamp_pos = cfgvalue;
  356. else if (strcmp(cfgname, "jiaxian_clamp_torque") == 0)
  357. cfg.jiaxian_clamp_torque = cfgvalue;
  358. else if (strcmp(cfgname, "arm_jiaxian_reset_pos") == 0)
  359. cfg.arm_jiaxian_reset_pos = cfgvalue;
  360. else if (strcmp(cfgname, "arm_jiaxian_clamp_pos") == 0)
  361. cfg.arm_jiaxian_clamp_pos = cfgvalue;
  362. else if (strcmp(cfgname, "arm_jiaxian_clamp_torque") == 0)
  363. cfg.arm_jiaxian_clamp_torque = cfgvalue;
  364. else if (strcmp(cfgname, "scissors_reset_pos") == 0)
  365. cfg.scissors_reset_pos = cfgvalue;
  366. else if (strcmp(cfgname, "m22_scissors_cut_pos") == 0)
  367. cfg.m22_scissors_cut_pos = cfgvalue;
  368. else if (strcmp(cfgname, "m21_arm_hook_claws_half_pos") == 0)
  369. cfg.m21_arm_hook_claws_half_pos = cfgvalue;
  370. else if (strcmp(cfgname, "m21_arm_hook_claws_full_pos") == 0)
  371. cfg.m21_arm_hook_claws_full_pos = cfgvalue;
  372. return 0;
  373. #endif
  374. return 0;
  375. }
  376. int32_t IntelligentWindingRobotCtrl::dumpcfg() { return 0; }
  377. #if 1
  378. #endif