|
| Math () |
|
virtual | ~Math () |
|
std::vector< double > | poseAdd (const std::vector< double > &p1, const std::vector< double > &p2) |
| Pose addition
|
|
std::vector< double > | poseSub (const std::vector< double > &p1, const std::vector< double > &p2) |
| Pose subtraction 位姿相减
|
|
std::vector< double > | interpolatePose (const std::vector< double > &p1, const std::vector< double > &p2, double alpha) |
| 计算线性插值
|
|
std::vector< double > | poseTrans (const std::vector< double > &pose_from, const std::vector< double > &pose_from_to) |
| Pose transformation
|
|
std::vector< double > | poseTransInv (const std::vector< double > &pose_from, const std::vector< double > &pose_to_from) |
| 姿态逆变换
|
|
std::vector< double > | poseInverse (const std::vector< double > &pose) |
| Get the inverse of a pose
|
|
double | poseDistance (const std::vector< double > &p1, const std::vector< double > &p2) |
| 计算两个位姿的位置距离
|
|
double | poseAngleDistance (const std::vector< double > &p1, const std::vector< double > &p2) |
| 计算两个位姿的轴角距离
|
|
bool | poseEqual (const std::vector< double > &p1, const std::vector< double > &p2, double eps=5e-5) |
| 判断两个位姿是否相等
|
|
std::vector< double > | transferRefFrame (const std::vector< double > &F_b_a_old, const Vector3d &V_in_a, int type) |
|
std::vector< double > | poseRotation (const std::vector< double > &pose, const std::vector< double > &rotv) |
| 姿态旋转
|
|
std::vector< double > | rpyToQuaternion (const std::vector< double > &rpy) |
| 欧拉角转四元数
|
|
std::vector< double > | quaternionToRpy (const std::vector< double > &quat) |
| 四元数转欧拉角
|
|
ResultWithErrno | tcpOffsetIdentify (const std::vector< std::vector< double > > &poses) |
| 四点法标定TCP偏移
|
|
ResultWithErrno | calibrateCoordinate (const std::vector< std::vector< double > > &poses, int type) |
| 三点法标定坐标系
|
|
ResultWithErrno | calculateCircleFourthPoint (const std::vector< double > &p1, const std::vector< double > &p2, const std::vector< double > &p3, int mode) |
| 根据圆弧的三个点,计算出拟合成的圆的另一半圆弧的中间点位置
|
|
std::vector< double > | forceTrans (const std::vector< double > &pose_a_in_b, const std::vector< double > &force_in_a) |
| forceTrans: 变换力和力矩的参考坐标系 force_in_b = pose_a_in_b * force_in_a
|
|
std::vector< double > | getDeltaPoseBySensorDistance (const std::vector< double > &distances, double position, double radius, double track_scale) |
| 通过距离计算工具坐标系下的位姿增量
|
|
std::vector< double > | deltaPoseTrans (const std::vector< double > &pose_a_in_b, const std::vector< double > &ft_in_a) |
| changeFTFrame: 变换力和力矩的参考坐标系
|
|
std::vector< double > | deltaPoseAdd (const std::vector< double > &pose_a_in_b, const std::vector< double > &v_in_b) |
| addDeltaPose: 计算以给定速度变换单位时间后的位姿
|
|
std::vector< double > | changePoseWithXYRef (const std::vector< double > &pose_tar, const std::vector< double > &pose_ref) |
| changePoseWithXYRef: 修改 pose_tar 的xy轴方向,尽量与 pose_ref 一致,
|
|
std::vector< double > | homMatrixToPose (const std::vector< double > &homMatrix) |
| homMatrixToPose: 由齐次变换矩阵得到位姿
|
|
std::vector< double > | poseToHomMatrix (const std::vector< double > &pose) |
| poseToHomMatrix: 位姿变换得到齐次变换矩阵
|
|
std::vector< double > arcs::common_interface::Math::poseAdd |
( |
const std::vector< double > & |
p1, |
|
|
const std::vector< double > & |
p2 |
|
) |
| |
Pose addition
Both arguments contain three position parameters (x, y, z) jointly called P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This function calculates the result x_3 as the addition of the given poses as follows:
p_3.P = p_1.P + p_2.P p_3.R = p_1.R * p_2.R
位姿相加。 两个参数都包含三个位置参数(x、y、z),统称为P, 以及三个旋转参数(R_x、R_y、R_z),统称为R。 此函数根据以下方式计算结果 p_3,即给定位姿的相加: p_3.P = p_1.P + p_2.P, p_3.R = p_1.R * p_2.R
- 参数
-
p1 | 工具位姿1(pose) |
p2 | 工具位姿2(pose) |
- 返回
- Sum of position parts and product of rotation parts (pose) 位置部分之和和旋转部分之积(pose)
- Python函数原型
- poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> List[float]
- Lua函数原型
- poseAdd(p1: table, p2: table) -> table
- JSON-RPC请求示例
- {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
- JSON-RPC响应示例
- {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]}
std::vector< double > arcs::common_interface::Math::poseTrans |
( |
const std::vector< double > & |
pose_from, |
|
|
const std::vector< double > & |
pose_from_to |
|
) |
| |
Pose transformation
The first argument, p_from, is used to transform the second argument, p_from_to, and the result is then returned. This means that the result is the resulting pose, when starting at the coordinate system of p_from, and then in that coordinate system moving p_from_to.
This function can be seen in two different views. Either the function transforms, that is translates and rotates, p_from_to by the parameters of p_from. Or the function is used to get the resulting pose, when first making a move of p_from and then from there, a move of p_from_to. If the poses were regarded as transformation matrices, it would look like:
T_world->to = T_world->from * T_from->to, T_x->to = T_x->from * T_from->to
位姿变换
第一个参数 p_from 用于转换第二个参数 p_from_to,并返回结果。 这意味着结果是从 p_from 的坐标系开始, 然后在该坐标系中移动 p_from_to后的位姿。
这个函数可以从两个不同的角度来看。 一种是函数将 p_from_to 根据 p_from 的参数进行转换,即平移和旋转。 另一种是函数被用于获取结果姿态,先对 p_from 进行移动,然后再对 p_from_to 进行移动。 如果将姿态视为转换矩阵,它看起来像是:
T_world->to = T_world->from * T_from->to, T_x->to = T_x->from * T_from->to
这两个方程描述了姿态变换的基本原理,根据给定的起始姿态和相对于起始姿态的姿态变化,可以计算出目标姿态。
举个例子,已知B相对于A的位姿、C相对于B的位姿,求C相对于A的位姿。 第一个参数是B相对于A的位姿,第二个参数是C相对于B的位姿, 返回值是C相对于A的位姿。
- 参数
-
pose_from | 起始位姿(空间向量) |
pose_from_to | 相对于起始位姿的姿态变化(空间向量) |
- 返回
- 结果位姿 (空间向量)
- Python函数原型
- poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> List[float]
- Lua函数原型
- poseTrans(pose_from: table, pose_from_to: table) -> table
- JSON-RPC请求示例
- {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5, 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1}
- JSON-RPC响应示例
- {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]}