AUBO SDK  0.26.0
Loading...
Searching...
No Matches
gripper_interface.h
Go to the documentation of this file.
1/** @file gripper_interface.h
2 * @brief 通用夹爪接口
3 */
4#ifndef AUBO_SDK_GRIPPER_INTERFACE_H
5#define AUBO_SDK_GRIPPER_INTERFACE_H
6
7#include <aubo/sync_move.h>
8#include <aubo/trace.h>
9
10namespace arcs {
11namespace common_interface {
12
13/**
14 * \~chinese 通用夹爪API接口
15 */
16class ARCS_ABI_EXPORT GripperInterface
17{
18public:
21
22 /**
23 * \chinese
24 * 获取支持的所有夹爪
25 *
26 * @return
27 * \endchinese
28 */
29 std::vector<std::string> gripperGetSupportedModels();
30
31 /**
32 * \chinese
33 * 扫描该型号下的所有设备
34 *
35 * @param model 夹爪品牌型号
36 * @param device_name 设备名
37 * @return 成功返回设备列表和0,失败返回错误码
38 * \endchinese
39 */
40 ResultWithErrno2 gripperScanDevices(const std::string &model,
41 const std::string &device_name);
42
43 /**
44 * \chinese
45 * 获取已添加的夹爪
46 * @return
47 */
48 std::vector<std::string> gripperGetNames();
49
50 /**
51 * \chinese
52 * 添加夹爪
53 *
54 * @param name 用户自定义名字,唯一
55 * @param model 夹爪品牌及型号
56 * @return 成功返回0,失败返回错误码
57 * \endchinese
58 */
59 int gripperAdd(const std::string &name, const std::string &model);
60
61 /**
62 * \chinese
63 * 删除夹爪
64 *
65 * @param name 用户自定义名字
66 * @return 成功返回0,失败返回错误码
67 * \endchinese
68 */
69 int gripperDelete(const std::string &name);
70
71 /**
72 * \chinese
73 * 修改夹爪名
74 *
75 * @param name
76 * @param new_name 新名字
77 * @return 成功返回0,失败返回错误码
78 * \endchinese
79 */
80 int gripperRename(const std::string &name, const std::string &new_name);
81
82 /**
83 * \chinese
84 * 夹爪连接
85 *
86 * @param name
87 * @param device_name 设备名
88 * @return 成功返回0,失败返回错误码
89 * \endchinese
90 */
91 int gripperConnect(const std::string &name, const std::string &device_name);
92
93 /**
94 * \chinese
95 * 夹爪断开连接
96 *
97 * @param name
98 * @return 成功返回0,失败返回错误码
99 * \endchinese
100 */
101 int gripperDisconnect(const std::string &name);
102
103 /**
104 * \chinese
105 * 夹爪是否连接
106 *
107 * @param name
108 * @return 已连接返回true,未连接返回false
109 * \endchinese
110 */
111 bool gripperIsConnected(const std::string &name);
112
113 /**
114 * \chinese
115 * 设置工作模式
116 *
117 * @param name
118 * @param work_mode 工作模式
119 * @return 成功返回0,失败返回错误码
120 * \endchinese
121 */
122 int gripperSetWorkMode(const std::string &name, int work_mode);
123
124 /**
125 * \chinese
126 * 获取工作模式
127 *
128 * @param name
129 * @return 返回工作模式
130 * \endchinese
131 */
132 int gripperGetWorkMode(const std::string &name);
133
134 /**
135 * \chinese
136 * 设置夹爪安装偏移
137 *
138 * @param name
139 * @param isVisibled 是否显示
140 * @param pose 末端(不包括手指)相对法兰的位姿
141 * @return 成功返回true,失败返回false
142 * \endchinese
143 */
144 int gripperSetMountPose(const std::string &name,
145 const std::vector<double> &pose,
146 bool enable_collision);
147
148 /**
149 * @brief 获取夹爪安装偏移
150 * @param name
151 * @return 返回夹爪安装偏移
152 */
153 std::vector<double> gripperGetMountPose(const std::string &name);
154
155 /**
156 * \chinese
157 * 使能夹爪
158 *
159 * @param name
160 * @return
161 * \endchinese
162 */
163 int gripperEnable(const std::string &name, bool enable);
164
165 /**
166 * \chinese
167 * 夹爪是否使能
168 *
169 * @param name
170 * @return
171 * \endchinese
172 */
173 bool gripperIsEnabled(const std::string &name);
174
175 /**
176 * \chinese
177 * 设置运动参数
178 *
179 * @param name
180 * @return
181 * \endchinese
182 */
183 int gripperSetPosition(const std::string &name, const double position);
184 int gripperSetVelocity(const std::string &name, const double velocity);
185 int gripperSetForce(const std::string &name, const double force);
186 int gripperSetAngle(const std::string &name, const double angle);
187 int gripperSetRVelocity(const std::string &name, const double r_velocity);
188 int gripperSetTorque(const std::string &name, const double torque);
189
190 /**
191 * \chinese
192 * 开始运动
193 *
194 * @param name
195 * @return
196 * \endchinese
197 */
198 int gripperMove(const std::string &name);
199
200 /**
201 * \chinese
202 * 停止运动
203 *
204 * @param name
205 * @return
206 * \endchinese
207 */
208 int gripperStop(const std::string &name);
209
210 /**
211 * \chinese
212 * 获取夹爪状态
213 *
214 * @param name
215 * @return
216 * \endchinese
217 */
218 std::string gripperGetHardwareVersion(const std::string &name);
219 std::string gripperGetSoftwareVersion(const std::string &name);
220 double gripperGetPosition(const std::string &name);
221 double gripperGetVelocity(const std::string &name);
222 double gripperGetForce(const std::string &name);
223 double gripperGetAngle(const std::string &name);
224 double gripperGetRVelocity(const std::string &name);
225 double gripperGetTorque(const std::string &name);
226 bool gripperGetObjectDetection(const std::string &name);
227 bool gripperGetMotionState(const std::string &name);
228 double gripperGetVoltage(const std::string &name);
229 double gripperGetTemperature(const std::string &name);
230
231 /**
232 * \chinese
233 * 重置modbus从站ID
234 *
235 * @param name
236 * @param slave_id 从站Id
237 * @return
238 * \endchinese
239 */
240 int gripperResetSlaveId(const std::string &name, const int slave_id);
241
242protected:
243 void *d_;
244};
245using GripperInterfacePtr = std::shared_ptr<GripperInterface>;
246
247} // namespace common_interface
248} // namespace arcs
249
250#endif // AUBO_SDK_GRIPPER_INTERFACE_H
double gripperGetVoltage(const std::string &name)
int gripperSetVelocity(const std::string &name, const double velocity)
double gripperGetAngle(const std::string &name)
double gripperGetVelocity(const std::string &name)
std::vector< std::string > gripperGetSupportedModels()
std::string gripperGetSoftwareVersion(const std::string &name)
std::vector< double > gripperGetMountPose(const std::string &name)
获取夹爪安装偏移
double gripperGetTorque(const std::string &name)
int gripperSetWorkMode(const std::string &name, int work_mode)
int gripperEnable(const std::string &name, bool enable)
int gripperResetSlaveId(const std::string &name, const int slave_id)
int gripperSetAngle(const std::string &name, const double angle)
int gripperGetWorkMode(const std::string &name)
bool gripperGetObjectDetection(const std::string &name)
int gripperStop(const std::string &name)
int gripperSetTorque(const std::string &name, const double torque)
int gripperSetMountPose(const std::string &name, const std::vector< double > &pose, bool enable_collision)
bool gripperIsConnected(const std::string &name)
double gripperGetForce(const std::string &name)
double gripperGetRVelocity(const std::string &name)
int gripperAdd(const std::string &name, const std::string &model)
int gripperMove(const std::string &name)
std::vector< std::string > gripperGetNames()
double gripperGetTemperature(const std::string &name)
int gripperConnect(const std::string &name, const std::string &device_name)
ResultWithErrno2 gripperScanDevices(const std::string &model, const std::string &device_name)
int gripperRename(const std::string &name, const std::string &new_name)
int gripperSetPosition(const std::string &name, const double position)
int gripperSetForce(const std::string &name, const double force)
int gripperSetRVelocity(const std::string &name, const double r_velocity)
std::string gripperGetHardwareVersion(const std::string &name)
int gripperDelete(const std::string &name)
bool gripperIsEnabled(const std::string &name)
bool gripperGetMotionState(const std::string &name)
int gripperDisconnect(const std::string &name)
double gripperGetPosition(const std::string &name)
std::tuple< std::vector< std::string >, int > ResultWithErrno2
Definition type_def.h:771
std::shared_ptr< GripperInterface > GripperInterfacePtr
同步运行
Interface for injecting logs into the controller's logging system.