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.
202 lines
5.1 KiB
202 lines
5.1 KiB
#pragma once
|
|
#include "sdk/os/zos.hpp"
|
|
#include "sdk\components\zprotocols\zcancmder_v2\api\api.hpp"
|
|
#include "sdk\components\zprotocols\zcancmder_v2\zmodule_device_manager.hpp"
|
|
|
|
//
|
|
#include "app_zmodule_device_manager.hpp"
|
|
|
|
#define ZMOTOR_ID 4
|
|
#define XYRobot_ID 3
|
|
#define XYRobot_HOOK_ID 21
|
|
|
|
namespace iflytop {
|
|
using namespace std;
|
|
|
|
class IntelligentWindingRobotCtrl {
|
|
public:
|
|
typedef struct {
|
|
/**
|
|
* @brief 机械臂夹线舵机
|
|
*/
|
|
int32_t m11_arm_jiaxian_reset_pos;
|
|
int32_t m11_arm_jiaxian_clamp_direction;
|
|
int32_t m11_arm_jiaxian_clamp_torque;
|
|
|
|
/**
|
|
* @brief 线夹紧舵机
|
|
*/
|
|
int32_t m12_jiaxian_reset_pos;
|
|
int32_t m12_jiaxian_clamp_direction;
|
|
int32_t m12_jiaxian_clamp_torque;
|
|
|
|
/**
|
|
* @brief 压线舵机
|
|
*/
|
|
/**
|
|
* 高度:
|
|
* 1. 没有弹夹 1015
|
|
* 2. 有弹夹 1055
|
|
* 3. 弹夹有壳 1110
|
|
*
|
|
*/
|
|
int32_t m13_yaxian_forward_reset_pos; // 压死待机位
|
|
int32_t m13_yaxian_backward_reset_pos; // 反向待机位
|
|
int32_t m13_jiaxian_clamp_direction; // 压线方向
|
|
int32_t m13_jiaxian_clamp_torque; // 压线扭矩
|
|
|
|
/**
|
|
* @brief 绕线探测舵机
|
|
*/
|
|
int32_t m14_raoxiantance_reset_pos;
|
|
int32_t m14_raoxiantance_tance_zero_pos;
|
|
|
|
/**
|
|
* @brief 排废舵机
|
|
*/
|
|
int32_t m15_paifei_reset_pos;
|
|
int32_t m15_paifei_press_direction;
|
|
int32_t m15_paifei_press_torque;
|
|
|
|
/**
|
|
* @brief 线拉紧舵机
|
|
*/
|
|
int32_t m16_xianlajin_reset_pos;
|
|
int32_t m16_xianlajin_tight_line_pos;
|
|
int32_t m16_xianlajin_winding_low_pos;
|
|
int32_t m16_xianlajin_winding_up_pos;
|
|
int32_t m16_xianlajin_line_entry_pos;
|
|
|
|
/**
|
|
* @brief 钩爪
|
|
*/
|
|
int32_t m21_arm_hook_claws_half_pos;
|
|
int32_t m21_arm_hook_claws_full_pos;
|
|
/**
|
|
* @brief 剪刀
|
|
*/
|
|
// int32_t m22_scissors_cut_pos;
|
|
/**
|
|
* @brief 拉线
|
|
*/
|
|
// int32_t m23_laxian_move_to_tight_pos;
|
|
|
|
/**
|
|
* @brief Z轴定位
|
|
*/
|
|
int32_t z_axis_process_line_high;
|
|
int32_t z_axis_take_clip_pos;
|
|
int32_t z_axis_winding_hight;
|
|
|
|
// 3377
|
|
|
|
int32_t z_axis_cook_bullet_pos;
|
|
|
|
/**
|
|
* @brief XY平台
|
|
*/
|
|
int32_t xy_platform_cook_bullet_pos_x;
|
|
int32_t xy_platform_cook_bullet_pos_y;
|
|
|
|
int32_t xy_platform_remove_line_pos_x;
|
|
int32_t xy_platform_remove_line_pos_y;
|
|
|
|
int32_t xy_platform_takeline_pos_x;
|
|
int32_t xy_platform_takeline_pos_y;
|
|
|
|
int32_t xy_platform_takeline_clip00_pos_x; //
|
|
int32_t xy_platform_takeline_clip00_pos_y;
|
|
|
|
int32_t xy_platform_takeline_clipXX_pos_x;
|
|
int32_t xy_platform_takeline_clipXX_pos_y;
|
|
int32_t clip_line;
|
|
int32_t clip_each_line_num;
|
|
|
|
} config_t;
|
|
|
|
APPDM* m_dm;
|
|
ICmdParser* m_cmdparse;
|
|
config_t cfg;
|
|
|
|
public:
|
|
int32_t initialize(APPDM* dm, ICmdParser* cmdparse);
|
|
|
|
private:
|
|
void start_probe_bullet_pos();
|
|
void stop_probe_bullet_pos();
|
|
int32_t get_probe_bullet_pos();
|
|
bool is_hasbullet();
|
|
|
|
public:
|
|
void wait_module_idle(int32_t moduleid);
|
|
void wait_modules_idle(void* mark, ...);
|
|
|
|
int32_t m11_arm_jiaxian_move_to_reset_pos();
|
|
int32_t m11_arm_jiaxian_move_to_clamp_pos();
|
|
int32_t m12_jiaxian_move_to_open_pos();
|
|
int32_t m12_jiaxian_move_to_clamp_pos();
|
|
int32_t m13_yaxian_move_to_reset_forward();
|
|
int32_t m13_yaxian_move_to_reset_backward();
|
|
int32_t m13_yaxian_press_clip();
|
|
int32_t m14_raoxiantance_move_to_reset();
|
|
int32_t m15_paifei_moveto_reset();
|
|
int32_t m15_paifei_moveto_press();
|
|
int32_t m16_xianlajin_move_to_reset();
|
|
int32_t m16_xianlajin_move_to_tight_line_pos();
|
|
int32_t m16_xianlajin_move_to_winding_low_pos();
|
|
int32_t m16_xianlajin_move_to_winding_up_pos();
|
|
int32_t m16_xianlajin_move_to_line_entry_pos();
|
|
int32_t m21_arm_hook_claws_reset();
|
|
int32_t m21_arm_hook_claws_move_to_half_pos();
|
|
int32_t m21_arm_hook_claws_move_to_full_pos();
|
|
int32_t m22_scissors_move_reset_pos(); // block
|
|
int32_t m22_scissors_cut(); // block
|
|
int32_t m23_laxian_motor_move_to_reset_pos(); // block
|
|
int32_t m23_laxian_motor_move_to_tight_line_pos(); // block
|
|
|
|
int32_t m4_zreset();
|
|
int32_t m4_zmove_to(int32_t pos);
|
|
|
|
int32_t device_reset();
|
|
int32_t disable_all_module();
|
|
int32_t enable_all_module();
|
|
|
|
int32_t step_take_bullet(int32_t bulletindex);
|
|
int32_t step_prepare_remove_line();
|
|
int32_t step_remove_line();
|
|
|
|
int32_t xy_get_point(int32_t clip_index, int32_t& x, int32_t& y); // 取弹夹
|
|
int32_t xy_run_to(int32_t x, int32_t y, int32_t zpos = 0, bool jiaxian_reset = true); // 取弹夹
|
|
int32_t xy_run_to_clip_pos_test(int32_t clip_index);
|
|
int32_t xy_reset();
|
|
|
|
int32_t xymove_to(int32_t x, int32_t y);
|
|
|
|
void regcb();
|
|
int32_t initialize_device();
|
|
|
|
int32_t main_shaft_run();
|
|
int32_t main_shaft_stop();
|
|
|
|
/**
|
|
* @brief XY平台
|
|
*/
|
|
int32_t xy_platform_reset();
|
|
|
|
/**
|
|
* @brief
|
|
*/
|
|
int32_t start_winding();
|
|
int32_t stop_winding();
|
|
int32_t reset_and_check_device();
|
|
|
|
int32_t setcfg(const char* cfgname, int32_t cfgvalue);
|
|
int32_t dumpcfg();
|
|
|
|
int32_t do_reset_device();
|
|
int32_t do_winding(int32_t index);
|
|
|
|
void processError(int32_t err);
|
|
};
|
|
|
|
} // namespace iflytop
|