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