AUBO SDK  0.26.0
Loading...
Searching...
No Matches
math.h
Go to the documentation of this file.
1/** @file math.h
2 * \~chinese @brief 数学方法接口,如欧拉角与四元数转换、位姿的加减运算
3 * \~english @brief Mathematic operation interface, such as euler to quaternion conversion, addition/subtraction of poses
4 */
5#ifndef AUBO_SDK_MATH_INTERFACE_H
6#define AUBO_SDK_MATH_INTERFACE_H
7
8#include <vector>
9#include <memory>
10
11#include <aubo/type_def.h>
12#include <aubo/global_config.h>
13
14namespace arcs {
15namespace common_interface {
16
17class ARCS_ABI_EXPORT Math
18{
19public:
21 virtual ~Math();
22
23 /**
24 * \english
25 * Pose addition
26 *
27 * Both arguments contain three position parameters (x, y, z) jointly called
28 * P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This
29 * function calculates the result x_3 as the addition of the given poses as
30 * follows:
31 *
32 * p_3.P = p_1.P + p_2.P
33 *
34 * p_3.R = p_1.R * p_2.R
35 *
36 * @param p1 Tool pose 1
37 * @param p2 Tool pose 2
38 * @return sum of position parts and product of rotation parts (pose)
39 *
40 * @par Python interface prototype
41 * poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) ->
42 * List[float]
43 *
44 * @par Lua interface prototype
45 * poseAdd(p1: table, p2: table) -> table
46 *
47 * @par Lua example
48 * pose_add = poseAdd({0.2, 0.5, 0.1, 1.57, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
49 *
50 * @par JSON-RPC request example
51 * {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57,
52 * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
53 *
54 * @par JSON-RPC response example
55 * {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]}
56 * \endengish
57 *
58 * \chinese
59 * 位姿相加。
60 * 两个参数都包含三个位置参数(x、y、z),统称为P,
61 * 以及三个旋转参数(R_x、R_y、R_z),统称为R。
62 * 此函数根据以下方式计算结果 p_3,即给定位姿的相加:
63 * p_3.P = p_1.P + p_2.P,
64 * p_3.R = p_1.R * p_2.R
65 *
66 * @param p1 工具位姿1(pose)
67 * @param p2 工具位姿2(pose)
68 * @return 位置部分之和和旋转部分之积(pose)
69 *
70 * @par Python函数原型
71 * poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) ->
72 * List[float]
73 *
74 * @par Lua函数原型
75 * poseAdd(p1: table, p2: table) -> table
76 *
77 * @par Lua示例
78 * pose_add = poseAdd({0.2, 0.5, 0.1, 1.57, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
79 *
80 * @par JSON-RPC请求示例
81 * {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57,
82 * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
83 *
84 * @par JSON-RPC响应示例
85 * {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]}
86 * \endchinese
87 */
88 std::vector<double> poseAdd(const std::vector<double> &p1,
89 const std::vector<double> &p2);
90
91 /**
92 * \chinese
93 * 位姿相减
94 *
95 * 两个参数都包含三个位置参数(x、y、z),统称为P,
96 * 以及三个旋转参数(R_x、R_y、R_z),统称为R。
97 * 此函数根据以下方式计算结果 p_3,即给定位姿的相加:
98 * p_3.P = p_1.P - p_2.P,
99 * p_3.R = p_1.R * p_2.R.inverse
100 *
101 * @param p1 工具位姿1
102 * @param p2 工具位姿2
103 * @return 位姿相减计算结果
104 *
105 * @par Python函数原型
106 * poseSub(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) ->
107 * List[float]
108 *
109 * @par Lua函数原型
110 * poseSub(p1: table, p2: table) -> table
111 *
112 * @par Lua示例
113 * pose_sub = poseSub({0.2, 0.5, 0.1, 1.57, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
114 *
115 * @par JSON-RPC请求示例
116 * {"jsonrpc":"2.0","method":"Math.poseSub","params":[[0.2, 0.5, 0.1, 1.57,
117 * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
118 *
119 * @par JSON-RPC响应示例
120 * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-0.5,0.0,-0.0,0.0]}
121 * \endchinese
122 *
123 * \english
124 * Pose subtraction
125 *
126 * Both arguments contain three position parameters (x, y, z) jointly called
127 * P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This
128 * function calculates the result x_3 as the addition of the given poses as
129 * follows:
130 *
131 * p_3.P = p_1.P - p_2.P,
132 *
133 * p_3.R = p_1.R * p_2.R.inverse
134 *
135 * @param p1 tool pose 1
136 * @param p2 tool pose 2
137 * @return difference between two poses
138 *
139 * @par Python interface prototype
140 * poseSub(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) ->
141 * List[float]
142 *
143 * @par Lua interface prototype
144 * poseSub(p1: table, p2: table) -> table
145 *
146 * @par Lua example
147 * pose_sub = poseSub({0.2, 0.5, 0.1, 1.57, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
148 *
149 * @par JSON-RPC request example
150 * {"jsonrpc":"2.0","method":"Math.poseSub","params":[[0.2, 0.5, 0.1, 1.57,
151 * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
152 *
153 * @par JSON-RPC response example
154 * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-0.5,0.0,-0.0,0.0]}
155 * \endenglish
156 */
157 std::vector<double> poseSub(const std::vector<double> &p1,
158 const std::vector<double> &p2);
159
160 /**
161 * \chinese
162 * 计算线性插值
163 *
164 * @param p1 起点的TCP位姿
165 * @param p2 终点的TCP位姿
166 * @param alpha 系数,
167 * 当0<alpha<1,返回p1和p2两点直线的之间靠近p1端且占总路径比例为alpha的点;
168 * 例如当alpha=0.3,返回的是靠近p1那端,总路径的百分之30的点;
169 * 当alpha>1,返回p2;
170 * 当alpha<0,返回p1;
171 * @return 插值计算结果
172 *
173 * @par Python函数原型
174 * interpolatePose(self: pyaubo_sdk.Math, arg0: List[float], arg1:
175 * List[float], arg2: float) -> List[float]
176 *
177 * @par Lua函数原型
178 * interpolatePose(p1: table, p2: table, alpha: number) -> table
179 *
180 * @par Lua示例
181 * pose_interpolate = interpolatePose({0.2, 0.2, 0.4, 0, 0, 0},{0.2, 0.2, 0.6, 0, 0, 0},0.5)
182 *
183 * @par JSON-RPC请求示例
184 * {"jsonrpc":"2.0","method":"Math.interpolatePose","params":[[0.2, 0.2,
185 * 0.4, 0, 0, 0],[0.2, 0.2, 0.6, 0, 0, 0],0.5],"id":1}
186 *
187 * @par JSON-RPC响应示例
188 * {"id":1,"jsonrpc":"2.0","result":[0.2,0.2,0.5,0.0,-0.0,0.0]}
189 * \endchinese
190 *
191 * \english
192 * Calculate linear interpolation
193 *
194 * @param p1 starting TCP pose
195 * @param p2 ending TCP pose
196 * @param alpha coefficient;
197 * When 0<alpha<1,return a point between p1 & p2 that is closer to p1, at alpha percentage of the path;
198 * For example when alpha=0.3,point returned is closer to p1,at 30% of the total distance;
199 * When alpha>1, return p2;
200 * When alpha<0,return p1;
201 * @return interpolation result
202 *
203 * @par Python interface prototype
204 * interpolatePose(self: pyaubo_sdk.Math, arg0: List[float], arg1:
205 * List[float], arg2: float) -> List[float]
206 *
207 * @par Lua interface prototype
208 * interpolatePose(p1: table, p2: table, alpha: number) -> table
209 *
210 * @par Lua example
211 * pose_interpolate = interpolatePose({0.2, 0.2, 0.4, 0, 0, 0},{0.2, 0.2, 0.6, 0, 0, 0},0.5)
212 *
213 * @par JSON-RPC request example
214 * {"jsonrpc":"2.0","method":"Math.interpolatePose","params":[[0.2, 0.2,
215 * 0.4, 0, 0, 0],[0.2, 0.2, 0.6, 0, 0, 0],0.5],"id":1}
216 *
217 * @par JSON-RPC response example
218 * {"id":1,"jsonrpc":"2.0","result":[0.2,0.2,0.5,0.0,-0.0,0.0]}
219 * \endenglish
220 *
221 */
222 std::vector<double> interpolatePose(const std::vector<double> &p1,
223 const std::vector<double> &p2,
224 double alpha);
225 /**
226 * \chinese
227 * 位姿变换
228 *
229 * 第一个参数 p_from 用于转换第二个参数 p_from_to,并返回结果。
230 * 这意味着结果是从 p_from 的坐标系开始,
231 * 然后在该坐标系中移动 p_from_to后的位姿。
232 *
233 * 这个函数可以从两个不同的角度来看。
234 * 一种是函数将 p_from_to 根据 p_from 的参数进行转换,即平移和旋转。
235 * 另一种是函数被用于获取结果姿态,先对 p_from 进行移动,然后再对 p_from_to
236 * 进行移动。 如果将姿态视为转换矩阵,它看起来像是:
237 *
238 * T_world->to = T_world->from * T_from->to,
239 * T_x->to = T_x->from * T_from->to
240 *
241 * 这两个方程描述了姿态变换的基本原理,根据给定的起始姿态和相对于起始姿态的姿态变化,可以计算出目标姿态。
242 *
243 * 举个例子,已知B相对于A的位姿、C相对于B的位姿,求C相对于A的位姿。
244 * 第一个参数是B相对于A的位姿,第二个参数是C相对于B的位姿,
245 * 返回值是C相对于A的位姿。
246 *
247 * @param pose_from 起始位姿(空间向量)
248 * @param pose_from_to 相对于起始位姿的姿态变化(空间向量)
249 * @return 结果位姿 (空间向量)
250 *
251 * @par Python函数原型
252 * poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) ->
253 * List[float]
254 *
255 * @par Lua函数原型
256 * poseTrans(pose_from: table, pose_from_to: table) -> table
257 *
258 * @par Lua示例
259 * pose_trans = poseTrans({0.2, 0.5, 0.1, 1.57, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
260 *
261 * @par JSON-RPC请求示例
262 * {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5,
263 * 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
264 *
265 * @par JSON-RPC响应示例
266 * {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]}
267 * \endchinese
268 *
269 * \english
270 * Pose transformation
271 *
272 * The first argument, p_from, is used to transform the second argument,
273 * p_from_to, and the result is then returned. This means that the result is
274 * the resulting pose, when starting at the coordinate system of p_from, and
275 * then in that coordinate system moving p_from_to.
276 *
277 * This function can be seen in two different views. Either the function
278 * transforms, that is translates and rotates, p_from_to by the parameters
279 * of p_from. Or the function is used to get the resulting pose, when first
280 * making a move of p_from and then from there, a move of p_from_to. If the
281 * poses were regarded as transformation matrices, it would look like:
282 *
283 * T_world->to = T_world->from * T_from->to,
284 * T_x->to = T_x->from * T_from->to
285 *
286 *
287 * These two equations describes the foundations for pose transformation.
288 * Based on a starting pose and the pose transformation relative to the starting pose, we can get the target pose.
289 *
290 * For example, we know pose of B relative to A, pose of C relative to B, find pose of C relative to A.
291 * param 1 is pose of B relative to A,param 2 is pose of C relative to B,
292 * the return value is the pose of C relative to A
293 *
294 * @param pose_from starting pose(vector in 3D space)
295 * @param pose_from_to pose transformation relative to starting pose(vector in 3D space)
296 * @return final pose (vector in 3D space)
297 *
298 * @par Python interface prototype
299 * poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) ->
300 * List[float]
301 *
302 * @par Lua interface prototype
303 * poseTrans(pose_from: table, pose_from_to: table) -> table
304 *
305 * @par Lua example
306 * pose_trans = poseTrans({0.2, 0.5, 0.1, 1.57, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
307 *
308 * @par JSON-RPC request example
309 * {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5,
310 * 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
311 *
312 * @par JSON-RPC response example
313 * {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]}
314 * \endenglish
315 */
316 std::vector<double> poseTrans(const std::vector<double> &pose_from,
317 const std::vector<double> &pose_from_to);
318
319 /**
320 * \english
321 * Pose inverse transformation
322 *
323 * Given pose of C relative to A, pose of C relative to B, find pose of B relative to A.
324 * param 1 is pose of C relative to A,param 2 is pose of C relative to B,
325 * the return value is the pose of B relative to A
326 *
327 * @param pose_from starting pose
328 * @param pose_to_from pose transformation relative to final pose
329 * @return resulting pose
330 *
331 * @par Python interface prototype
332 * poseTransInv(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float])
333 * -> List[float]
334 *
335 * @par Lua interface prototype
336 * poseTransInv(pose_from: table, pose_to_from: table) -> table
337 *
338 * @par Lua example
339 * pose_trans_inv = poseTransInv({0.4, -0.0996016, 0.600478, 3.14, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
340 *
341 * @par JSON-RPC request example
342 * {"jsonrpc":"2.0","method":"Math.poseTransInv","params":[[0.4, -0.0996016,
343 * 0.600478, 3.14, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
344 *
345 * @par JSON-RPC response example
346 * {"id":1,"jsonrpc":"2.0","result":[0.2,0.5000000464037341,0.10000036250764266,1.57,-0.0,0.0]}
347 * \endenglish
348 *
349 * \chinese
350 * 姿态逆变换
351 *
352 * 已知C相对于A的位姿、C相对于B的位姿,求B相对于A的位姿。
353 * 第一个参数是C相对于A的位姿,第二个参数是C相对于B的位姿,
354 * 返回值是B相对于A的位姿。
355 *
356 * @param pose_from 起始位姿
357 * @param pose_to_from 相对于结果位姿的姿态变化
358 * @return 结果位姿
359 *
360 * @par Python函数原型
361 * poseTransInv(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float])
362 * -> List[float]
363 *
364 * @par Lua函数原型
365 * poseTransInv(pose_from: table, pose_to_from: table) -> table
366 *
367 * @par Lua示例
368 * pose_trans_inv = poseTransInv({0.4, -0.0996016, 0.600478, 3.14, 0, 0},{0.2, 0.5, 0.6, 1.57, 0, 0})
369 *
370 * @par JSON-RPC请求示例
371 * {"jsonrpc":"2.0","method":"Math.poseTransInv","params":[[0.4, -0.0996016,
372 * 0.600478, 3.14, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
373 *
374 * @par JSON-RPC响应示例
375 * {"id":1,"jsonrpc":"2.0","result":[0.2,0.5000000464037341,0.10000036250764266,1.57,-0.0,0.0]}
376 * \endchinese
377 */
378 std::vector<double> poseTransInv(const std::vector<double> &pose_from,
379 const std::vector<double> &pose_to_from);
380
381 /**
382 * \chinese
383 * 获取位姿的逆
384 *
385 * @param pose 工具位姿(空间向量)
386 * @return 工具位姿的逆转换(空间向量)
387 *
388 * @par Python函数原型
389 * poseInverse(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float]
390 *
391 * @par Lua函数原型
392 * poseInverse(pose: table) -> table
393 *
394 * @par Lua示例
395 * pose_inverse = poseInverse({0.2, 0.5, 0.1, 1.57, 0, 3.14})
396 *
397 * @par JSON-RPC请求示例
398 * {"jsonrpc":"2.0","method":"Math.poseInverse","params":[[0.2, 0.5,
399 * 0.1, 1.57, 0, 3.14]],"id":1}
400 *
401 * @par JSON-RPC响应示例
402 * {"id":1,"jsonrpc":"2.0","result":[0.19920341988726448,-0.09960155178838484,-0.5003973704832628,
403 * 1.5699999989900404,-0.0015926530848129354,-3.1415913853161266]}
404 *
405 * \endchinese
406 *
407 * \english
408 * Get the inverse of a pose
409 *
410 * @param pose tool pose (spatial vector)
411 * @return inverse tool pose transformation (spatial vector)
412 *
413 * @par Python interface prototype
414 * poseInverse(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float]
415 *
416 * @par Lua interface prototype
417 * poseInverse(pose: table) -> table
418 *
419 * @par Lua example
420 * pose_inverse = poseInverse({0.2, 0.5, 0.1, 1.57, 0, 3.14})
421 *
422 * @par JSON-RPC request example
423 * {"jsonrpc":"2.0","method":"Math.poseInverse","params":[[0.2, 0.5,
424 * 0.1, 1.57, 0, 3.14]],"id":1}
425 *
426 * @par JSON-RPC response example
427 * {"id":1,"jsonrpc":"2.0","result":[0.19920341988726448,-0.09960155178838484,-0.5003973704832628,
428 * 1.5699999989900404,-0.0015926530848129354,-3.1415913853161266]}
429 * \endenglish
430 *
431 */
432 std::vector<double> poseInverse(const std::vector<double> &pose);
433
434 /**
435 * \chinese
436 * 计算两个位姿的位置距离
437 *
438 * @param p1 位姿1
439 * @param p2 位姿2
440 * @return 两个位姿的位置距离
441 *
442 * @par Lua函数原型
443 * poseDistance(p1: table, p2: table) -> number
444 *
445 * @par Lua示例
446 * pose_distance = poseDistance({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},{0.2, 0.5, 0.6, 0, -0.172, 0.0})
447 *
448 * @par JSON-RPC请求示例
449 * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1,
450 * 0.3142, 0.0, 1.571],[0.2, 0.5, 0.6, 0, -0.172, 0.0]],"id":1}
451 *
452 * @par JSON-RPC响应示例
453 * {"id":1,"jsonrpc":"2.0","result":0.5477225575051661}
454 * \endchinese
455 *
456 * \english
457 * Calculate distance between two poses
458 *
459 * @param p1 pose 1
460 * @param p2 pose 2
461 * @return distance between the poses
462 *
463 * @par Lua function prototype
464 * poseDistance(p1: table, p2: table) -> number
465 *
466 * @par Lua example
467 * pose_distance = poseDistance({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},{0.2, 0.5, 0.6, 0, -0.172, 0.0})
468 *
469 * @par JSON-RPC request example
470 * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1,
471 * 0.3142, 0.0, 1.571],[0.2, 0.5, 0.6, 0, -0.172, 0.0]],"id":1}
472 *
473 * @par JSON-RPC response example
474 * {"id":1,"jsonrpc":"2.0","result":0.5477225575051661}
475 * \endenglish
476 *
477 */
478 double poseDistance(const std::vector<double> &p1,
479 const std::vector<double> &p2);
480
481 /**
482 * \chinese
483 * 计算两个位姿的轴角距离
484 *
485 * @param p1 位姿1
486 * @param p2 位姿2
487 * @return 轴角距离
488 *
489 * @par Lua函数原型
490 * poseAngleDistance(p1: table, p2: table) -> number
491 *
492 * @par Lua示例
493 * pose_angle_distance = poseAngleDistance({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},{0.2, 0.5, 0.6, 0, -0.172, 0.0})
494 *
495 * \endchinese
496 *
497 * \english
498 * Calculate axis-angle difference between two poses
499 *
500 * @param p1 pose 1
501 * @param p2 pose 2
502 * @return axis angle difference
503 *
504 * @par Lua函数原型
505 * poseAngleDistance(p1: table, p2: table) -> number
506 *
507 * @par Lua示例
508 * pose_angle_distance = poseAngleDistance({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},{0.2, 0.5, 0.6, 0, -0.172, 0.0})
509 *
510 * \endenglish
511 */
512 double poseAngleDistance(const std::vector<double> &p1,
513
514 const std::vector<double> &p2);
515
516 /**
517 * \chinese
518 * 判断两个位姿是否相等
519 *
520 * @param p1 位姿1
521 * @param p2 位姿2
522 * @param eps 误差
523 * @return 相等返回true,反之返回false
524 *
525 * @par Lua函数原型
526 * poseEqual(p1: table, p2: table, eps: number) -> boolean
527 *
528 * @par Lua示例
529 * pose_equal = poseEqual({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},{0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711},0.01)
530 *
531 * @par JSON-RPC请求示例
532 * {"jsonrpc":"2.0","method":"Math.poseEqual","params":[[0.1, 0.3, 0.1,
533 * 0.3142, 0.0, 1.571],[0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711],0.01]],"id":1}
534 *
535 * @par JSON-RPC响应示例
536 * {"id":1,"jsonrpc":"2.0","result":0.0}
537 * \endchinese
538 *
539 * \english
540 * Determine if two poses are equivalent
541 *
542 * @param p1 pose 1
543 * @param p2 pose 2
544 * @param eps error margin
545 * @return true or false
546 *
547 * @par Lua函数原型
548 * poseEqual(p1: table, p2: table, eps: number) -> boolean
549 *
550 * @par Lua示例
551 * pose_equal = poseEqual({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},{0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711},0.01)
552 *
553 * @par JSON-RPC request example
554 * {"jsonrpc":"2.0","method":"Math.poseEqual","params":[[0.1, 0.3, 0.1,
555 * 0.3142, 0.0, 1.571],[0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711],0.01],"id":1}
556 *
557 * @par JSON-RPC response example
558 * {"id":1,"jsonrpc":"2.0","result":0.0}
559 * \endenglish
560 */
561 bool poseEqual(const std::vector<double> &p1, const std::vector<double> &p2,
562 double eps = 5e-5);
563
564 /**
565 * \chinese
566 * @param F_b_a_old
567 * @param V_in_a
568 * @param type
569 * @return
570 *
571 * @par Python函数原型
572 * transferRefFrame(self: pyaubo_sdk.Math, arg0: List[float], arg1:
573 * List[float[3]], arg2: int) -> List[float]
574 *
575 * @par Lua函数原型
576 * transferRefFrame(F_b_a_old: table, V_in_a: table, type: number) -> table
577 * \endchinese
578 *
579 * \english
580 * @param F_b_a_old
581 * @param V_in_a
582 * @param type
583 * @return
584 *
585 * @par Python interface prototype
586 * transferRefFrame(self: pyaubo_sdk.Math, arg0: List[float], arg1:
587 * List[float[3]], arg2: int) -> List[float]
588 *
589 * @par Lua interface prototype
590 * transferRefFrame(F_b_a_old: table, V_in_a: table, type: number) -> table
591 * \endenglish
592 */
593 std::vector<double> transferRefFrame(const std::vector<double> &F_b_a_old,
594 const Vector3d &V_in_a, int type);
595
596 /**
597 * \chinese
598 * 姿态旋转
599 *
600 * @param pose
601 * @param rotv
602 * @return
603 *
604 * @par Python函数原型
605 * poseRotation(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float])
606 * -> List[float]
607 *
608 * @par Lua函数原型
609 * poseRotation(pose: table, rotv: table) -> table
610 * \endchinese
611 *
612 * \english
613 * Pose rotation
614 *
615 * @param pose
616 * @param rotv
617 * @return
618 *
619 * @par Python interface prototype
620 * poseRotation(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float])
621 * -> List[float]
622 *
623 * @par Lua interface prototype
624 * poseRotation(pose: table, rotv: table) -> table
625 * \endenglish
626 */
627 std::vector<double> poseRotation(const std::vector<double> &pose,
628 const std::vector<double> &rotv);
629
630 /**
631 * \chinese
632 * 欧拉角转四元数
633 *
634 * @param rpy 欧拉角
635 * @return 四元数
636 *
637 * @par Python函数原型
638 * rpyToQuaternion(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float]
639 *
640 * @par Lua函数原型
641 * rpyToQuaternion(rpy: table) -> table
642 *
643 * @par Lua示例
644 * quaternion = rpyToQuaternion({0.611, 0.785, 0.960})
645 *
646 * @par JSON-RPC请求示例
647 * {"jsonrpc":"2.0","method":"Math.rpyToQuaternion","params":[[0.611, 0.785,
648 * 0.960]],"id":1}
649 *
650 * @par JSON-RPC响应示例
651 * {"id":1,"jsonrpc":"2.0","result":[0.834721517970497,0.07804256900772265,0.4518931575790371,0.3048637712043723]}
652 * \endchinese
653 *
654 * \english
655 * Euler angles to quaternions
656 *
657 * @param rpy euler angles
658 * @return quaternions
659 *
660 * @par Python interface prototype
661 * rpyToQuaternion(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float]
662 *
663 * @par Lua interface prototype
664 * rpyToQuaternion(rpy: table) -> table
665 *
666 * @par Lua example
667 * quaternion = rpyToQuaternion({0.611, 0.785, 0.960})
668 *
669 * @par JSON-RPC request example
670 * {"jsonrpc":"2.0","method":"Math.rpyToQuaternion","params":[[0.611, 0.785,
671 * 0.960]],"id":1}
672 *
673 * @par JSON-RPC response example
674 * {"id":1,"jsonrpc":"2.0","result":[0.834721517970497,0.07804256900772265,0.4518931575790371,0.3048637712043723]}
675 * \endenglish
676 */
677 std::vector<double> rpyToQuaternion(const std::vector<double> &rpy);
678
679 /**
680 * \chinese
681 * 四元数转欧拉角
682 *
683 * @param quat 四元数
684 * @return 欧拉角
685 *
686 * @par Python函数原型
687 * quaternionToRpy(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float]
688 *
689 * @par Lua函数原型
690 * quaternionToRpy(quat: table) -> table
691 *
692 * @par Lua示例
693 * rpy = quaternionToRpy({0.834722,0.0780426, 0.451893, 0.304864})
694 *
695 * @par JSON-RPC请求示例
696 * {"jsonrpc":"2.0","method":"Math.quaternionToRpy","params":[[0.834722,
697 * 0.0780426, 0.451893, 0.304864]],"id":1}
698 *
699 * @par JSON-RPC响应示例
700 * {"id":1,"jsonrpc":"2.0","result":[0.6110000520523781,0.7849996877683915,0.960000543982093]}
701 * \endchinese
702 *
703 * \english
704 * Quaternions to euler angles
705 *
706 * @param quat quaternions
707 * @return euler angles
708 *
709 * @par Python interface prototype
710 * quaternionToRpy(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float]
711 *
712 * @par Lua interface prototype
713 * quaternionToRpy(quat: table) -> table
714 *
715 * @par Lua example
716 * rpy = quaternionToRpy({0.834722,0.0780426, 0.451893, 0.304864})
717 *
718 * @par JSON-RPC request example
719 * {"jsonrpc":"2.0","method":"Math.quaternionToRpy","params":[[0.834722,
720 * 0.0780426, 0.451893, 0.304864]],"id":1}
721 *
722 * @par JSON-RPC response example
723 * {"id":1,"jsonrpc":"2.0","result":[0.6110000520523781,0.7849996877683915,0.960000543982093]}
724 * \endenglish
725 */
726 std::vector<double> quaternionToRpy(const std::vector<double> &quat);
727
728 /**
729 * \chinese
730 * 四点法标定TCP偏移
731 *
732 * 找一个尖点,将机械臂工具末端点绕着尖点示教四个位置,姿态差别要大。
733 * 设置完毕后即可计算出来结果。
734 *
735 * @param poses 四个点的位姿集合
736 * @return TCP标定结果和标定结果是否有效
737 *
738 * @par Python函数原型
739 * tcpOffsetIdentify(self: pyaubo_sdk.Math, arg0: List[List[float]]) ->
740 * Tuple[List[float], int]
741 *
742 * @par Lua函数原型
743 * tcpOffsetIdentify(poses: table) -> table
744 *
745 * @par Lua示例
746 * p1 = {0.48659,0.10456,0.24824,-3.135,0.004,1.569} \n
747 * p2 = {0.38610,0.09096,0.22432,2.552,-0.437,1.008} \n
748 * p3 = {0.38610,0.05349,0.16791,-3.021,-0.981,0.517} \n
749 * p4 = {0.49675,0.06417,0.21408,-2.438,0.458,0.651} \n
750 * p = {p1,p2,p3,p4} \n
751 * tcp_result = tcpOffsetIdentify(p)
752 *
753 * \endchinese
754 *
755 * \english
756 * Four point method calibration for TCP offset
757 *
758 * About a sharp point, move the robot's tcp in four different poses. Difference between each pose should be drastic.
759 * Result can be obtained based on these four poses
760 *
761 * @param poses combination of four different poses
762 * @return TCP calibration result and whether successfull
763 *
764 * @par Python interface prototype
765 * tcpOffsetIdentify(self: pyaubo_sdk.Math, arg0: List[List[float]]) ->
766 * Tuple[List[float], int]
767 *
768 * @par Lua interface prototype
769 * tcpOffsetIdentify(poses: table) -> table
770 *
771 * @par Lua example
772 * p1 = {0.48659,0.10456,0.24824,-3.135,0.004,1.569} \n
773 * p2 = {0.38610,0.09096,0.22432,2.552,-0.437,1.008} \n
774 * p3 = {0.38610,0.05349,0.16791,-3.021,-0.981,0.517} \n
775 * p4 = {0.49675,0.06417,0.21408,-2.438,0.458,0.651} \n
776 * p = {p1,p2,p3,p4} \n
777 * tcp_result = tcpOffsetIdentify(p)
778 *
779 * \endenglish
780 */
782 const std::vector<std::vector<double>> &poses);
783
784 /**
785 * \chinese
786 * 三点法标定坐标系
787 *
788 * @param poses 三个点的位姿集合
789 * @param type 类型:\n
790 * 0 - oxy 原点 x轴正方向 xy平面(y轴正方向)\n
791 * 1 - oxz 原点 x轴正方向 xz平面(z轴正方向)\n
792 * 2 - oyz 原点 y轴正方向 yz平面(z轴正方向)\n
793 * 3 - oyx 原点 y轴正方向 yx平面(x轴正方向)\n
794 * 4 - ozx 原点 z轴正方向 zx平面(x轴正方向)\n
795 * 5 - ozy 原点 z轴正方向 zy平面(y轴正方向)\n
796 * @return 坐标系标定结果和标定结果是否有效
797 *
798 * @par Lua函数原型
799 * calibrateCoordinate(poses: table, type: int) -> table, number
800 *
801 * @par Lua示例
802 * p1 = {0.55462,0.06219,0.37175,-3.142,0.0,1.580} \n
803 * p2 = {0.63746,0.11805,0.37175,-3.142,0.0,1.580} \n
804 * p3 = {0.40441,0.28489,0.37174,-3.142,0.0,1.580} \n
805 * p = {p1,p2,p3} \n
806 * coord_pose, cal_result = calibrateCoordinate(p,0)
807 *
808 * @par JSON-RPC请求示例
809 * {"jsonrpc":"2.0","method":"Math.calibrateCoordinate","params":[[[0.55462,0.06219,0.37175,-3.142,0.0,1.580],
810 * [0.63746,0.11805,0.37175,-3.142,0.0,1.580],[0.40441,0.28489,0.37174,-3.142,0.0,1.580]],0],"id":1}
811 *
812 * @par JSON-RPC响应示例
813 * {"id":1,"jsonrpc":"2.0","result":[[0.55462,0.06219,0.37175,-3.722688983883945e-05,-1.6940658945086007e-21,0.5932768162455785],0]}
814 * \endchinese
815 *
816 * \english
817 * Calibrate coordinate system with 3 points
818 *
819 * @param poses set of 3 poses
820 * @param type type:\n
821 * 0 - oxy origin, +x axis, xy plane (+y direction) \n
822 * 1 - oxz origin, +x axis, xz plane (+z direction) \n
823 * 2 - oyz origin, +y axis, yz plane (+z direction) \n
824 * 3 - oyx origin, +y axis, yx plane (+x direction) \n
825 * 4 - ozx origin, +z axis, zx plane (+x direction) \n
826 * 5 - ozy origin, +z axis, zy plane (+y direction) \n
827 * @return Coordinate system calibration result and whether the calibration result is valid
828 *
829 * @par Lua function prototype
830 * calibrateCoordinate(poses: table, type: int) -> table, number
831 *
832 * @par Lua example
833 * p1 = {0.55462,0.06219,0.37175,-3.142,0.0,1.580} \n
834 * p2 = {0.63746,0.11805,0.37175,-3.142,0.0,1.580} \n
835 * p3 = {0.40441,0.28489,0.37174,-3.142,0.0,1.580} \n
836 * p = {p1,p2,p3} \n
837 * coord_pose, cal_result = calibrateCoordinate(p,0)
838 *
839 * @par JSON-RPC request example
840 * {"jsonrpc":"2.0","method":"Math.calibrateCoordinate","params":[[[0.55462,0.06219,0.37175,-3.142,0.0,1.580],
841 * [0.63746,0.11805,0.37175,-3.142,0.0,1.580],[0.40441,0.28489,0.37174,-3.142,0.0,1.580]],0],"id":1}
842 *
843 * @par JSON-RPC response example
844 * {"id":1,"jsonrpc":"2.0","result":[[0.55462,0.06219,0.37175,-3.722688983883945e-05,-1.6940658945086007e-21,0.5932768162455785],0]}
845 * \endenglish
846 */
848 const std::vector<std::vector<double>> &poses, int type);
849
850 /**
851 * \chinese
852 * 根据圆弧的三个点,计算出拟合成的圆的另一半圆弧的中间点位置
853 *
854 * @param p1 圆弧的起始点
855 * @param p2 圆弧的中间点
856 * @param p3 圆弧的结束点
857 * @param mode 当mode等于1的时候,表示需要对姿态进行圆弧规划;
858 * 当mode等于0的时候,表示不需要对姿态进行圆弧规划
859 *
860 * @return 拟合成的圆的另一半圆弧的中间点位置和计算结果是否有效
861 *
862 * @par Lua函数原型
863 * calculateCircleFourthPoint(p1: table, p2: table, p3: table, mode: int)
864 *
865 * @par Lua示例
866 * center_pose, cal_result = calculateCircleFourthPoint({0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424},
867 * {0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423},
868 * {0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06,1.570796326792422},1)
869 *
870 * @par JSON-RPC请求示例
871 * {"jsonrpc":"2.0","method":"Math.calculateCircleFourthPoint","params":[[0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424],
872 * [0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423],
873 * [0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06,
874 * 1.570796326792422],1],"id":1}
875 *
876 * @par JSON-RPC响应示例
877 * {"id":1,"jsonrpc":"2.0","result":[[0.5488696249770837,-0.031860179583911546,0.27033259504604207,-3.1415919803846903,-3.67320510285378e-06,1.570796326792423],1]}
878 *
879 * \endchinese
880 *
881 * \english
882 * Based on three points on an arc, calculate the position of the midpoint of the other half of the fitted circle's arc
883 *
884 * @param p1 start point of the arc
885 * @param p2 middle point of the arc
886 * @param p3 end point of the arc
887 * @param mode when mode = 1, need to plan for orientation around arc;
888 * when mode = 0, do not need to plan for orientation around arc.
889 * @return position of the midpoint of the other half of the fitted circle's arc and whether the result is valid.
890 *
891 *
892 * @par Lua函数原型
893 * calculateCircleFourthPoint(p1: table, p2: table, p3: table, mode: int)
894 *
895 * @par Lua示例
896 * center_pose, cal_result = calculateCircleFourthPoint({0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424},
897 * {0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423},
898 * {0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06,1.570796326792422},1)
899 *
900 * @par JSON-RPC request example
901 * {"jsonrpc":"2.0","method":"Math.calculateCircleFourthPoint","params":[[0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424],
902 * [0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423],
903 * [0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06,
904 * 1.570796326792422],1],"id":1}
905 *
906 * @par JSON-RPC response example
907 * {"id":1,"jsonrpc":"2.0","result":[[0.5488696249770837,-0.031860179583911546,0.27033259504604207,-3.1415919803846903,-3.67320510285378e-06,1.570796326792423],1]}
908 *
909 * \endenglish
910 */
911 ResultWithErrno calculateCircleFourthPoint(const std::vector<double> &p1,
912 const std::vector<double> &p2,
913 const std::vector<double> &p3,
914 int mode);
915 /**
916 * \chinese
917 * @brief forceTrans:
918 * 变换力和力矩的参考坐标系 force_in_b = pose_a_in_b * force_in_a
919 * @param pose_a_in_b: a 坐标系在 b 坐标系的位姿
920 * @param force_in_a: 力和力矩在 a 坐标系的描述
921 * @return force_in_b,力和力矩在 b 坐标系的描述
922 * \endchinese
923 *
924 * \english
925 * @brief forceTrans:
926 * Transform the reference frame of force and torque: force_in_b = pose_a_in_b * force_in_a
927 * @param pose_a_in_b: pose of frame a in frame b
928 * @param force_in_a: force and torque described in frame a
929 * @return Force_in_b, force and torque described in frame b
930 * \endenglish
931 */
932 std::vector<double> forceTrans(const std::vector<double> &pose_a_in_b,
933 const std::vector<double> &force_in_a);
934
935 /**
936 * \chinese
937 * @brief 通过距离计算工具坐标系下的位姿增量
938 * @param distances: N 个距离, N >=3
939 * @param position: 距离参考轨迹的保持高度
940 * @param radius: 传感器中心距离末端tcp的等效半径
941 * @param track_scale: 跟踪比例, 设置范围(0, 1], 1表示跟踪更快
942 * @return 基于工具坐标系的位姿增量
943 * \endchinese
944 *
945 * \english
946 * @brief Calculate pose increment in tool coordinate system based on sensor data
947 * @param distances: N distances, N >= 3
948 * @param position: reference height to maintain from the trajectory
949 * @param radius: effective radius from sensor center to tool TCP
950 * @param track_scale: tracking ratio, range (0, 1], 1 means faster tracking
951 * @return Pose increment in tool coordinate system
952 * \endenglish
953 */
954 std::vector<double> getDeltaPoseBySensorDistance(
955 const std::vector<double> &distances, double position, double radius,
956 double track_scale);
957
958 /**
959 * \chinese
960 * @brief changeFTFrame: 变换力和力矩的参考坐标系
961 * @param pose_a_in_b: a 坐标系在 b 坐标系的位姿
962 * @param ft_in_a: 作用在 a 点的力和力矩在 a 坐标系的描述
963 * @return ft_in_b,作用在 b 点的力和力矩在 b 坐标系的描述
964 * \endchinese
965 *
966 * \english
967 * @brief changeFTFrame: Transform the reference frame of force and torque
968 * @param pose_a_in_b: pose of frame a in frame b
969 * @param ft_in_a: force and torque applied at point a, described in frame a
970 * @return ft_in_b, force and torque applied at point b, described in frame b
971 * \endenglish
972 */
973 std::vector<double> deltaPoseTrans(const std::vector<double> &pose_a_in_b,
974 const std::vector<double> &ft_in_a);
975
976 /**
977 * \chinese
978 * @brief addDeltaPose: 计算以给定速度变换单位时间后的位姿
979 * @param pose_a_in_b: 当前时刻 a 相对于 b 的位姿
980 * @param v_in_b: 当前时刻 a 坐标系的速度在 b 的描述
981 * @return pose_in_b, 单位时间后的位姿在 b 的描述
982 * \endchinese
983 *
984 * \english
985 * @brief addDeltaPose: Calculate the pose after unit time given a velocity
986 * @param pose_a_in_b: current pose of a relative to b
987 * @param v_in_b: velocity of frame a described in frame b at current time
988 * @return pose_in_b, pose after unit time described in frame b
989 * \endenglish
990 */
991 std::vector<double> deltaPoseAdd(const std::vector<double> &pose_a_in_b,
992 const std::vector<double> &v_in_b);
993
994 /**
995 * \chinese
996 * @brief changePoseWithXYRef: 修改 pose_tar 的xy轴方向,尽量与 pose_ref 一致,
997 * @param pose_tar: 需要修改的目标位姿
998 * @param pose_ref: 参考位姿
999 * @return 修改后的位姿,采用pose_tar的 xyz 坐标和 z 轴方向
1000 * \endchinese
1001 *
1002 * \english
1003 * @brief changePoseWithXYRef: Modify the XY axis direction of pose_tar to be as consistent as possible with pose_ref
1004 * @param pose_tar: target pose to be modified
1005 * @param pose_ref: reference pose
1006 * @return Modified pose, using the xyz coordinates and z axis direction of pose_tar
1007 * \endenglish
1008 */
1009 std::vector<double> changePoseWithXYRef(
1010 const std::vector<double> &pose_tar,
1011 const std::vector<double> &pose_ref);
1012
1013 /**
1014 * \chinese
1015 * @brief homMatrixToPose: 由齐次变换矩阵得到位姿
1016 * @param homMatrix: 4*4 齐次变换矩阵, 输入元素采用横向排列
1017 * @return 对应的位姿
1018 * \endchinese
1019 *
1020 * \english
1021 * @brief homMatrixToPose: Get pose from homogeneous transformation matrix
1022 * @param homMatrix: 4x4 homogeneous transformation matrix, input elements are arranged row-wise
1023 * @return corresponding pose
1024 * \endenglish
1025 */
1026 std::vector<double> homMatrixToPose(const std::vector<double> &homMatrix);
1027
1028 /**
1029 * \chinese
1030 * @brief poseToHomMatrix: 位姿变换得到齐次变换矩阵
1031 * @param pose: 输入的位姿
1032 * @return 输出的齐次变换矩阵,元素横向排列
1033 * \endchinese
1034 *
1035 * \english
1036 * @brief poseToHomMatrix: Get homogeneous transformation matrix from pose
1037 * @param pose: input pose
1038 * @return output homogeneous transformation matrix, elements arranged row-wise
1039 * \endenglish
1040 */
1041 std::vector<double> poseToHomMatrix(const std::vector<double> &pose);
1042
1043protected:
1044 void *d_;
1045};
1046using MathPtr = std::shared_ptr<Math>;
1047
1048} // namespace common_interface
1049} // namespace arcs
1050#endif
std::vector< double > transferRefFrame(const std::vector< double > &F_b_a_old, const Vector3d &V_in_a, int type)
double poseDistance(const std::vector< double > &p1, const std::vector< double > &p2)
Calculate distance between two poses
std::vector< double > poseTrans(const std::vector< double > &pose_from, const std::vector< double > &pose_from_to)
Pose transformation
std::vector< double > forceTrans(const std::vector< double > &pose_a_in_b, const std::vector< double > &force_in_a)
std::vector< double > poseToHomMatrix(const std::vector< double > &pose)
std::vector< double > poseRotation(const std::vector< double > &pose, const std::vector< double > &rotv)
Pose rotation
ResultWithErrno calculateCircleFourthPoint(const std::vector< double > &p1, const std::vector< double > &p2, const std::vector< double > &p3, int mode)
Based on three points on an arc, calculate the position of the midpoint of the other half of the fitt...
std::vector< double > changePoseWithXYRef(const std::vector< double > &pose_tar, const std::vector< double > &pose_ref)
std::vector< double > poseAdd(const std::vector< double > &p1, const std::vector< double > &p2)
Pose addition
double poseAngleDistance(const std::vector< double > &p1, const std::vector< double > &p2)
Calculate axis-angle difference between two poses
std::vector< double > getDeltaPoseBySensorDistance(const std::vector< double > &distances, double position, double radius, double track_scale)
ResultWithErrno calibrateCoordinate(const std::vector< std::vector< double > > &poses, int type)
Calibrate coordinate system with 3 points
std::vector< double > poseSub(const std::vector< double > &p1, const std::vector< double > &p2)
Pose subtraction
bool poseEqual(const std::vector< double > &p1, const std::vector< double > &p2, double eps=5e-5)
Determine if two poses are equivalent
ResultWithErrno tcpOffsetIdentify(const std::vector< std::vector< double > > &poses)
Four point method calibration for TCP offset
std::vector< double > quaternionToRpy(const std::vector< double > &quat)
Quaternions to euler angles
std::vector< double > rpyToQuaternion(const std::vector< double > &rpy)
Euler angles to quaternions
std::vector< double > homMatrixToPose(const std::vector< double > &homMatrix)
std::vector< double > poseTransInv(const std::vector< double > &pose_from, const std::vector< double > &pose_to_from)
Pose inverse transformation
std::vector< double > poseInverse(const std::vector< double > &pose)
Get the inverse of a pose
std::vector< double > interpolatePose(const std::vector< double > &p1, const std::vector< double > &p2, double alpha)
Calculate linear interpolation
std::vector< double > deltaPoseTrans(const std::vector< double > &pose_a_in_b, const std::vector< double > &ft_in_a)
std::vector< double > deltaPoseAdd(const std::vector< double > &pose_a_in_b, const std::vector< double > &v_in_b)
std::array< double, 3 > Vector3d
Definition type_def.h:31
std::shared_ptr< Math > MathPtr
Definition math.h:1046
std::tuple< std::vector< double >, int > ResultWithErrno
Definition type_def.h:763
enum type definitions