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.
175 lines
4.1 KiB
175 lines
4.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"
|
|
|
|
namespace iflytop {
|
|
using namespace std;
|
|
class IntelligentWindingRobotCtrl {
|
|
public:
|
|
typedef struct {
|
|
/**
|
|
* @brief 排废舵机
|
|
*/
|
|
int32_t paifei_duoji_reset_pos;
|
|
int32_t paifei_duoji_press_pos;
|
|
int32_t paifei_duoji_press_torque;
|
|
|
|
/**
|
|
* @brief 绕线探测舵机
|
|
*/
|
|
int32_t raoxiantance_duoji_reset_pos;
|
|
int32_t raoxiantance_duoji_tance_zero_pos;
|
|
|
|
/**
|
|
* @brief 压线舵机
|
|
*/
|
|
int32_t yaxian_duoji_reset_pos;
|
|
int32_t yaxian_duoji_press_pos;
|
|
int32_t yaxian_duoji_press_torque;
|
|
int32_t yaxian_duoji_wait_for_press_pos;
|
|
|
|
/**
|
|
* @brief 线拉紧舵机
|
|
*/
|
|
int32_t xianlajin_duoji_reset_pos;
|
|
int32_t xianlajin_duoji_line_entry_pos;
|
|
int32_t xianlajin_duoji_tight_line_pos;
|
|
int32_t xianlajin_duoji_loose_line_pos;
|
|
|
|
/**
|
|
* @brief 线夹紧舵机
|
|
*/
|
|
int32_t jiaxian_duoji_reset_pos;
|
|
int32_t jiaxian_duoji_clamp_pos;
|
|
int32_t jiaxian_duoji_clamp_torque;
|
|
|
|
/**
|
|
* @brief 机械臂夹线舵机
|
|
*/
|
|
int32_t arm_jiaxian_duoji_reset_pos;
|
|
int32_t arm_jiaxian_duoji_clamp_pos;
|
|
int32_t arm_jiaxian_duoji_clamp_torque;
|
|
|
|
/**
|
|
* @brief 剪刀
|
|
*/
|
|
int32_t scissors_reset_pos;
|
|
int32_t scissors_cut_pos;
|
|
|
|
/**
|
|
* @brief 钩爪
|
|
*/
|
|
int32_t arm_hook_claws_half_pos;
|
|
int32_t arm_hook_claws_full_pos;
|
|
|
|
/**
|
|
* @brief Z轴定位
|
|
*/
|
|
int32_t z_axis_take_line_pos;
|
|
int32_t z_axis_take_clip_pos;
|
|
int32_t z_axis_winding_hight;
|
|
|
|
/**
|
|
* @brief XY平台
|
|
*/
|
|
|
|
int32_t xy_platform_winding_pos_x;
|
|
int32_t xy_platform_winding_pos_y;
|
|
|
|
int32_t xy_platform_takeline_pos_x;
|
|
int32_t xy_platform_takeline_pos_y;
|
|
|
|
} config_t;
|
|
|
|
ZModuleDeviceManager* m_dm;
|
|
ICmdParser* m_cmdparse;
|
|
config_t cfg;
|
|
|
|
public:
|
|
int32_t initialize(ZModuleDeviceManager* dm, ICmdParser* cmdparse);
|
|
int32_t initialize_device();
|
|
// 排废舵机
|
|
int32_t paifei_duoji_moveto_reset();
|
|
int32_t paifei_duoji_moveto_press();
|
|
/**
|
|
* @brief 绕线探测舵机
|
|
*/
|
|
int32_t raoxiantance_duoji_move_to_reset();
|
|
int32_t raoxiantance_duoji_move_to_get_thickness(int32_t *thickness);
|
|
/**
|
|
* @brief 压线舵机
|
|
*/
|
|
int32_t yaxian_duoji_move_to_reset();
|
|
int32_t yaxian_duoji_move_to_press_pos();
|
|
int32_t yaxian_duoji_move_to_wait_for_press_pos();
|
|
/**
|
|
* @brief 线拉紧舵机
|
|
*/
|
|
int32_t xianlajin_duoji_move_to_reset(); // 零位
|
|
int32_t xianlajin_duoji_move_to_line_entry_pos(); // 入线位
|
|
int32_t xianlajin_duoji_move_to_tight_line_pos(); // 拉线位置
|
|
int32_t xianlajin_duoji_move_to_loose_line_pos(); // 放线位置
|
|
/**
|
|
* @brief 夹线舵机
|
|
*/
|
|
int32_t jiaxian_duoji_move_to_reset_pos();
|
|
int32_t jiaxian_duoji_move_to_clamp_pos();
|
|
/**
|
|
* @brief 剪刀
|
|
*/
|
|
int32_t scissors_move_reset_pos(); // block
|
|
int32_t scissors_cut(); // block
|
|
/**
|
|
* @brief 机械臂夹线舵机
|
|
*/
|
|
int32_t arm_jiaxian_duoji_move_to_reset_pos();
|
|
int32_t arm_jiaxian_duoji_move_to_clamp_pos();
|
|
|
|
/**
|
|
* @brief 机械臂钩爪
|
|
*/
|
|
int32_t arm_hook_claws_reset();
|
|
int32_t arm_hook_claws_move_to_half_pos();
|
|
int32_t arm_hook_claws_move_to_full_pos();
|
|
|
|
int32_t main_shaft_run();
|
|
int32_t main_shaft_stop();
|
|
|
|
/**
|
|
* @brief XY平台
|
|
*/
|
|
int32_t xy_platform_reset();
|
|
/**
|
|
* @brief Z轴
|
|
*/
|
|
int32_t z_axis_reset();
|
|
int32_t z_axis_move_to(int32_t pos);
|
|
|
|
int32_t xy_reset(); // 复位
|
|
int32_t xy_move_to_zero(); // 移动到零位
|
|
int32_t xy_take_clip(int32_t index); // 取弹夹
|
|
int32_t xy_take_line(); // 取线
|
|
int32_t xy_take_back_clip(); // 放弹夹
|
|
int32_t xy_remove_line(); // 移除线
|
|
|
|
/**
|
|
* @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);
|
|
|
|
void wait_module_idle(int32_t moduleid);
|
|
};
|
|
|
|
} // namespace iflytop
|