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