4 changed files with 311 additions and 8 deletions
-
2sdk
-
118usrc/intelligent_winding_robot_ctrl.cpp
-
161usrc/intelligent_winding_robot_ctrl.hpp
-
38usrc/main.cpp
@ -1 +1 @@ |
|||
Subproject commit 089069f6ef3ae015b315835f83f520e800b785b1 |
|||
Subproject commit e06be65d256688d5ab0018e4d195352654081205 |
@ -0,0 +1,118 @@ |
|||
#include "intelligent_winding_robot_ctrl.hpp"
|
|||
#include <stdlib.h>
|
|||
using namespace std; |
|||
using namespace iflytop; |
|||
|
|||
#define TAG "IntelligentWindingRobotCtrl"
|
|||
|
|||
int32_t IntelligentWindingRobotCtrl::initialize_device() { return 0; } |
|||
// 排废舵机
|
|||
int32_t IntelligentWindingRobotCtrl::paifei_duoji_moveto_reset() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::paifei_duoji_moveto_press() { return 0; } |
|||
/**
|
|||
* @brief 绕线探测舵机 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::raoxiantance_duoji_move_to_reset() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::raoxiantance_duoji_move_to_get_thickness() { return 0; } |
|||
/**
|
|||
* @brief 压线舵机 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::yaxian_duoji_move_to_reset() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::yaxian_duoji_move_to_press_pos() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::yaxian_duoji_move_to_wait_for_press_pos() { return 0; } |
|||
/**
|
|||
* @brief 线拉紧舵机 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_reset() { return 0; } // 零位
|
|||
int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_line_entry_pos() { return 0; } // 入线位
|
|||
int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_tight_line_pos() { return 0; } // 拉线位置
|
|||
int32_t IntelligentWindingRobotCtrl::xianlajin_duoji_move_to_loose_line_pos() { return 0; } // 放线位置
|
|||
/**
|
|||
* @brief 夹线舵机 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::jiaxian_duoji_move_to_reset_pos() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::jiaxian_duoji_move_to_clamp_pos() { return 0; } |
|||
/**
|
|||
* @brief 剪刀 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::scissors_move_reset_pos() { return 0; } // block
|
|||
int32_t IntelligentWindingRobotCtrl::scissors_cut() { return 0; } // block
|
|||
/**
|
|||
* @brief 机械臂夹线舵机 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::arm_jiaxian_duoji_move_to_reset_pos() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::arm_jiaxian_duoji_move_to_clamp_pos() { return 0; } |
|||
|
|||
/**
|
|||
* @brief 机械臂钩爪 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::arm_hook_claws_reset() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::arm_hook_claws_move_to_half_pos() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::arm_hook_claws_move_to_full_pos() { return 0; } |
|||
/**
|
|||
* @brief XY平台 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::xy_platform_reset() { return 0; } |
|||
/**
|
|||
* @brief Z轴 |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::z_axis_reset() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::z_axis_move_to(int32_t pos) { return 0; } |
|||
|
|||
int32_t IntelligentWindingRobotCtrl::xy_reset() { return 0; } // 复位
|
|||
int32_t IntelligentWindingRobotCtrl::xy_move_to_zero() { return 0; } // 移动到零位
|
|||
int32_t IntelligentWindingRobotCtrl::xy_take_clip(int32_t index) { return 0; } // 取弹夹
|
|||
int32_t IntelligentWindingRobotCtrl::xy_take_line() { return 0; } // 取线
|
|||
int32_t IntelligentWindingRobotCtrl::xy_take_back_clip() { return 0; } // 放弹夹
|
|||
int32_t IntelligentWindingRobotCtrl::xy_remove_line() { return 0; } // 移除线
|
|||
/**
|
|||
* @brief |
|||
*/ |
|||
int32_t IntelligentWindingRobotCtrl::start_winding() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::stop_winding() { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::reset_and_check_device() { return 0; } |
|||
|
|||
int32_t IntelligentWindingRobotCtrl::setcfg(const char* cfgname, int32_t cfgvalue) { return 0; } |
|||
int32_t IntelligentWindingRobotCtrl::dumpcfg() { return 0; } |
|||
|
|||
int32_t IntelligentWindingRobotCtrl::initialize(ZModuleDeviceManager* dm, ICmdParser* cmdparse) { |
|||
m_dm = dm; |
|||
m_cmdparse = cmdparse; |
|||
|
|||
cmdparse->regCMD("paifei_duoji_moveto_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return paifei_duoji_moveto_reset(); }); |
|||
cmdparse->regCMD("paifei_duoji_moveto_press", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return paifei_duoji_moveto_press(); }); |
|||
cmdparse->regCMD("raoxiantance_duoji_move_to_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return raoxiantance_duoji_move_to_reset(); }); |
|||
cmdparse->regCMD("raoxiantance_duoji_move_to_get_thickness", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return raoxiantance_duoji_move_to_get_thickness(); }); |
|||
cmdparse->regCMD("yaxian_duoji_move_to_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return yaxian_duoji_move_to_reset(); }); |
|||
cmdparse->regCMD("yaxian_duoji_move_to_press_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return yaxian_duoji_move_to_press_pos(); }); |
|||
cmdparse->regCMD("yaxian_duoji_move_to_wait_for_press_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return yaxian_duoji_move_to_wait_for_press_pos(); }); |
|||
cmdparse->regCMD("xianlajin_duoji_move_to_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xianlajin_duoji_move_to_reset(); }); |
|||
cmdparse->regCMD("xianlajin_duoji_move_to_line_entry_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xianlajin_duoji_move_to_line_entry_pos(); }); |
|||
cmdparse->regCMD("xianlajin_duoji_move_to_tight_line_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xianlajin_duoji_move_to_tight_line_pos(); }); |
|||
cmdparse->regCMD("xianlajin_duoji_move_to_loose_line_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xianlajin_duoji_move_to_loose_line_pos(); }); |
|||
cmdparse->regCMD("jiaxian_duoji_move_to_reset_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return jiaxian_duoji_move_to_reset_pos(); }); |
|||
cmdparse->regCMD("jiaxian_duoji_move_to_clamp_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return jiaxian_duoji_move_to_clamp_pos(); }); |
|||
cmdparse->regCMD("scissors_move_reset_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return scissors_move_reset_pos(); }); |
|||
cmdparse->regCMD("scissors_cut", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return scissors_cut(); }); |
|||
cmdparse->regCMD("arm_jiaxian_duoji_move_to_reset_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return arm_jiaxian_duoji_move_to_reset_pos(); }); |
|||
cmdparse->regCMD("arm_jiaxian_duoji_move_to_clamp_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return arm_jiaxian_duoji_move_to_clamp_pos(); }); |
|||
cmdparse->regCMD("arm_hook_claws_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return arm_hook_claws_reset(); }); |
|||
cmdparse->regCMD("arm_hook_claws_move_to_half_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return arm_hook_claws_move_to_half_pos(); }); |
|||
cmdparse->regCMD("arm_hook_claws_move_to_full_pos", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return arm_hook_claws_move_to_full_pos(); }); |
|||
cmdparse->regCMD("xy_platform_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_platform_reset(); }); |
|||
cmdparse->regCMD("z_axis_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return z_axis_reset(); }); |
|||
cmdparse->regCMD("z_axis_move_to", "(int32_t pos)", 1, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return z_axis_move_to(atoi(paraV[0])); }); |
|||
cmdparse->regCMD("xy_reset", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_reset(); }); |
|||
cmdparse->regCMD("xy_move_to_zero", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_move_to_zero(); }); |
|||
cmdparse->regCMD("xy_take_clip", "(int32_t index)", 1, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_take_clip(atoi(paraV[0])); }); |
|||
cmdparse->regCMD("xy_take_line", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_take_line(); }); |
|||
cmdparse->regCMD("xy_take_back_clip", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_take_back_clip(); }); |
|||
cmdparse->regCMD("xy_remove_line", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return xy_remove_line(); }); |
|||
cmdparse->regCMD("start_winding", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return start_winding(); }); |
|||
cmdparse->regCMD("stop_winding", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return stop_winding(); }); |
|||
cmdparse->regCMD("reset_and_check_device", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return reset_and_check_device(); }); |
|||
cmdparse->regCMD("setcfg", "(const char* cfgname, int32_t cfgvalue)", 2, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return setcfg(paraV[0], atoi(paraV[1])); }); |
|||
cmdparse->regCMD("dumpcfg", "()", 0, [this](int32_t paramN, const char** paraV, ICmdParserACK* ack) { return dumpcfg(); }); |
|||
|
|||
return 0; |
|||
} |
@ -0,0 +1,161 @@ |
|||
#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; |
|||
|
|||
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(); |
|||
/**
|
|||
* @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(); |
|||
/**
|
|||
* @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(); |
|||
}; |
|||
|
|||
} // namespace iflytop
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue