PDF
AUBO SDK  0.26.0
aubo_api.h
浏览该文件的文档.
1/** @file aubo_api.h
2 * @brief \~chinese 机器人及外部轴等控制API接口,如获取机器人列表、获取系统信息等等
3 * @brief \~english API for controlling the robot and external axis
4 */
5#ifndef AUBO_SDK_AUBO_API_INTERFACE_H
6#define AUBO_SDK_AUBO_API_INTERFACE_H
7
8#include <aubo/system_info.h>
12#include <aubo/global_config.h>
13#include <aubo/math.h>
14#include <aubo/socket.h>
15#include <aubo/serial.h>
16#include <aubo/axis_interface.h>
18
19namespace arcs {
21
22/**
23 * \chinese
24 * @defgroup AuboApi AuboApi (主入口)
25 * @ingroup AuboApi
26 * AuboApi
27 * \endchinese
28 *
29 * \english
30 * @defgroup AuboApi Main Entrance
31 * @ingroup AuboApi
32 * AuboApi
33 * \endenglish
34 */
35class ARCS_ABI_EXPORT AuboApi
36{
37public:
39 virtual ~AuboApi();
40
41 /**
42 * @ingroup AuboApi
43 * @ref Math
44 * \chinese
45 * 获取纯数学相关接口
46 *
47 * @return MathPtr对象的指针
48 *
49 * @par Python函数原型
50 * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math
51 *
52 * @par C++示例
53 * @code
54 * auto rpc_cli = std::make_shared<RpcClient>();
55 * MathPtr ptr = rpc_cli->getMath();
56 * @endcode
57 * \endchinese
58 *
59 *\english
60 * Get pure mathematic related API
61 *
62 * @return Shared pointer to a Math object
63 *
64 * @par Python function prototype
65 * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math
66 *
67 * @par C++ example
68 * @code
69 * auto rpc_cli = std::make_shared<RpcClient>();
70 * MathPtr ptr = rpc_cli->getMath();
71 * @endcode
72 *\endenglish
73 */
75
76 /**
77 * @ingroup AuboApi
78 * @ref SystemInfo
79 * \chinese
80 * 获取系统信息
81 *
82 * @return SystemInfoPtr对象的指针
83 *
84 * @par Python函数原型
85 * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo
86 *
87 * @par C++示例
88 * @code
89 * auto rpc_cli = std::make_shared<RpcClient>();
90 * SystemInfoPtr ptr = rpc_cli->getSystemInfo();
91 * @endcode
92 * \endchinese
93 *
94 * \english
95 * Get system info
96 *
97 * @return Shared pointer to SystemInfo object
98 *
99 * @par Python function prototype
100 * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo
101 *
102 * @par C++ example
103 * @code
104 * auto rpc_cli = std::make_shared<RpcClient>();
105 * SystemInfoPtr ptr = rpc_cli->getSystemInfo();
106 * @endcode
107 * \endenglish
108 */
110
111 /**
112 * @ingroup AuboApi
113 * @ref RuntimeMachine
114 * \chinese
115 * 获取运行时接口
116 *
117 * @return RuntimeMachinePtr对象的指针
118 *
119 * @par Python函数原型
120 * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine
121 *
122 * @par C++示例
123 * @code
124 * auto rpc_cli = std::make_shared<RpcClient>();
125 * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine();
126 * @endcode
127 * \endchinese
128 *
129 * \english
130 * Get runtime api
131 *
132 * @return Shared pointer to RuntimeMachine object
133 * Python function prototype
134 * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine
135 *
136 * @par C++ example
137 * @code
138 * auto rpc_cli = std::make_shared<RpcClient>();
139 * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine();
140 * @endcode
141 * \endenglish
142 */
144
145 /**
146 * @ingroup AuboApi
147 * @ref RegisterControl
148 * \chinese
149 * 对外寄存器接口
150 *
151 * @return RegisterControlPtr对象的指针
152 *
153 * @par Python函数原型
154 * getRegisterControl(self: pyaubo_sdk.AuboApi) ->
155 * pyaubo_sdk.RegisterControl
156 *
157 * @par C++示例
158 * @code
159 * auto rpc_cli = std::make_shared<RpcClient>();
160 * RegisterControlPtr ptr = rpc_cli->getRegisterControl();
161 * @endcode
162 * \endchinese
163 *
164 * \english
165 * External registers api
166 *
167 * @return Shared pointer to RegisterControl object
168 *
169 * @par Python function prototype
170 * getRegisterControl(self: pyaubo_sdk.AuboApi) ->
171 * pyaubo_sdk.RegisterControl
172 *
173 * @par C++ example
174 * @code
175 * auto rpc_cli = std::make_shared<RpcClient>();
176 * RegisterControlPtr ptr = rpc_cli->getRegisterControl();
177 * @endcode
178 * \endenglish
179 */
181
182 /**
183 * @ingroup AuboApi
184 * \chinese
185 * 获取机器人列表
186 *
187 * @return 机器人列表
188 *
189 * @par Python函数原型
190 * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str]
191 *
192 * @par C++示例
193 * @code
194 * auto rpc_cli = std::make_shared<RpcClient>();
195 * auto robot_name = rpc_cli->getRobotNames().front();
196 * @endcode
197 *
198 * @par JSON-RPC请求示例
199 * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1}
200 *
201 * @par JSON-RPC响应示例
202 * {"id":1,"jsonrpc":"2.0","result":["rob1"]}
203 * \endchinese
204 *
205 * \english
206 * Get robot list
207 *
208 * @return robot list
209 *
210 * @par Python function prototype
211 * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str]
212 *
213 * @par C++ example
214 * @code
215 * auto rpc_cli = std::make_shared<RpcClient>();
216 * auto robot_name = rpc_cli->getRobotNames().front();
217 * @endcode
218 *
219 * @par JSON-RPC request example
220 * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1}
221 *
222 * @par JSON-RPC response example
223 * {"id":1,"jsonrpc":"2.0","result":["rob1"]}
224 * \endenglish
225 */
226 std::vector<std::string> getRobotNames();
227
228 /**
229 * @ingroup AuboApi
230 * @ref RobotInterface
231 * \chinese
232 * 根据名字获取 RobotInterfacePtr 接口
233 *
234 * @param name 机器人名字
235 * @return RobotInterfacePtr对象的指针
236 *
237 * @par Python函数原型
238 * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) ->
239 * pyaubo_sdk.RobotInterface
240 *
241 * @par C++示例
242 * @code
243 * auto rpc_cli = std::make_shared<RpcClient>();
244 * auto robot_name = rpc_cli->getRobotNames().front();
245 * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name);
246 * @endcode
247 * \endchinese
248 *
249 * \english
250 * Get RobotInterfacePtr based on name
251 *
252 * @param name Robot name
253 * @return Shared pointer to a RobotInterface object
254 *
255 * @par Python function prototype
256 * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) ->
257 * pyaubo_sdk.RobotInterface
258 *
259 * @par C++ example
260 * @code
261 * auto rpc_cli = std::make_shared<RpcClient>();
262 * auto robot_name = rpc_cli->getRobotNames().front();
263 * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name);
264 * @endcode
265 * \endenglish
266 */
267 RobotInterfacePtr getRobotInterface(const std::string &name);
268
269 /**
270 * @ingroup AuboApi
271 * \~chinese 获取外部轴列表 \~english Get external axis list
272 *
273 * @return
274 */
275 std::vector<std::string> getAxisNames();
276
277 /**
278 * @ingroup AuboApi
279 * @ref AxisInterface
280 * \chinese
281 * 获取外部轴接口
282 *
283 * @param name
284 * @return
285 * \endchinese
286 *
287 * \english
288 * Get external axis interface
289 *
290 * @param name
291 * @return
292 * \endenglish
293 */
294 AxisInterfacePtr getAxisInterface(const std::string &name);
295
296 /**
297 * @ingroup AuboApi
298 * @ref Socket
299 * \chinese
300 * 获取 socket
301 * @return SocketPtr对象的指针
302 *
303 * @par Python函数原型
304 * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket
305 * @endcode
306 *
307 * @par C++示例
308 * @code
309 * auto rpc_cli = std::make_shared<RpcClient>();
310 * SocketPtr ptr = rpc_cli->getSocket();
311 * @endcode
312 * \endchinese
313 *
314 * \english
315 * Get socket
316 * @return Shared pointer to a socket object
317 *
318 * @par Python function prototype
319 * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket
320 * @endcode
321 *
322 * @par C++ example
323 * @code
324 * auto rpc_cli = std::make_shared<RpcClient>();
325 * SocketPtr ptr = rpc_cli->getSocket();
326 * @endcode
327 * \endenglish
328 */
330
331 /**
332 * @ingroup AuboApi
333 * @ref Serial
334 * \chinese
335 * 获取Serial串口
336 * @return SerialPtr对象的指针
337 *
338 * @par Python函数原型
339 * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial
340 *
341 * @par C++示例
342 * @code
343 * auto rpc_cli = std::make_shared<RpcClient>();
344 * SerialPtr ptr = rpc_cli->getSerial();
345 * @endcode
346 * \endchinese
347 *
348 * \english
349 * @return Shared pointer to Serial object
350 *
351 * @par Python function prototype
352 * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial
353 *
354 * @par C++ example
355 * @code
356 * auto rpc_cli = std::make_shared<RpcClient>();
357 * SerialPtr ptr = rpc_cli->getSerial();
358 * @endcode
359 * \endenglish
360 */
362
363 /**
364 * @ingroup AuboApi
365 * @ref SyncMove
366 * \~chinese 获取同步运动接口 \~english Get syncronous move interface
367 *
368 * \~chinese @return SyncMovePtr对象的指针
369 * \~english @return Shared pointer to SyncMove object
370 */
371 SyncMovePtr getSyncMove(const std::string &name);
372
373 /**
374 * @ingroup AuboApi
375 * @ref Trace
376 * \~chinese 获取告警信息接口
377 * \~english Get alert interface
378 *
379 * \~chinese @return TracePtr对象的指针
380 * \~english @return Shared pointer of trace object
381 */
382 TracePtr getTrace(const std::string &name);
383
384 /**
385 * @ingroup AuboApi
386 * @ref GripperInterface
387 * \~chinese 获取通用夹爪接口
388 * \~english Get gripper interface
389 *
390 * \~chinese @return GripperInterfacePtr对象的指针
391 * \~english @return Shared pointer of gripper object
392 */
394
395protected:
396 void *d_{ nullptr };
397};
398using AuboApiPtr = std::shared_ptr<AuboApi>;
399
400} // namespace common_interface
401} // namespace arcs
402
403#endif // AUBO_SDK_AUBO_API_H
通用夹爪接口
TracePtr getTrace(const std::string &name)
Trace (日志与弹窗) 获取告警信息接口
GripperInterfacePtr getGripperInterface()
GripperInterface (夹爪) 获取通用夹爪接口
SerialPtr getSerial()
Serial (串口通信) 获取Serial串口
MathPtr getMath()
Math (数学工具) 获取纯数学相关接口
AxisInterfacePtr getAxisInterface(const std::string &name)
AxisInterface (外部轴) 获取外部轴接口
SocketPtr getSocket()
Socket (socket网络通信) 获取 socket
RegisterControlPtr getRegisterControl()
RegisterControl (寄存器操作) 对外寄存器接口
std::vector< std::string > getAxisNames()
获取外部轴列表
SystemInfoPtr getSystemInfo()
SystemInfo (系统信息) 获取系统信息
RobotInterfacePtr getRobotInterface(const std::string &name)
RobotInterface(机器人模块) 根据名字获取 RobotInterfacePtr 接口
RuntimeMachinePtr getRuntimeMachine()
RuntimeMachine (运行时管理) 获取运行时接口
std::vector< std::string > getRobotNames()
获取机器人列表
SyncMovePtr getSyncMove(const std::string &name)
SyncMove (同步运动控制和轴组管理) 获取同步运动接口
数学方法接口,如欧拉角与四元数转换、位姿的加减运算
std::shared_ptr< RuntimeMachine > RuntimeMachinePtr
std::shared_ptr< AxisInterface > AxisInterfacePtr
std::shared_ptr< Math > MathPtr
std::shared_ptr< GripperInterface > GripperInterfacePtr
std::shared_ptr< Serial > SerialPtr
std::shared_ptr< SystemInfo > SystemInfoPtr
std::shared_ptr< RobotInterface > RobotInterfacePtr
std::shared_ptr< Trace > TracePtr
std::shared_ptr< RegisterControl > RegisterControlPtr
std::shared_ptr< SyncMove > SyncMovePtr
std::shared_ptr< AuboApi > AuboApiPtr
std::shared_ptr< Socket > SocketPtr
寄存器操作接口,用于三个模块之间的数据交换功能
机器人API 接口
Script interpreter runtime interface, allows pausing the script interpreter and setting/removing brea...
串口通信
socket通信
获取系统信息接口,如接口板的版本号、示教器软件的版本号