当前位置:网站首页>【机器人坐标系第一讲】
【机器人坐标系第一讲】
2022-07-05 16:14:00 【小秋SLAM实战教程】
// 求解的是世界坐标系到相机坐标系的变换矩阵
cv::Mat Tcw = mpTracker->GrabImageRGBD(im,depthmap,timestamp);
// 保存轨迹是相机坐标系到世界坐标系的变换矩阵
// 将相机坐标系下面的点装换到世界坐标系下面
mRcw = mTcw.rowRange(0,3).colRange(0,3);
mRwc = mRcw.t();
mRwc * x3Dc + -mRwc*mTcw.rowRange(0,3).col(3);

角度要是负数,右手法则


机器人坐标系 符合右手坐标系 红前x 绿左y 蓝上z
x+ to forward, y+ to left, z+ to up
q.setRPY(0, M_PI/2, -M_PI/2); // -0 90 -90 先绕z轴负90度 再绕y轴正90度 最后绕x轴转0度
// 旋转矩阵
Eigen::Matrix3d rotation_matrix3d;
// 绕 Z 轴旋转 45 度的旋转矩阵 sin45 = cos45 = 0.707107
rotation_matrix3d << cos45, -sin45, 0,
sin45, cos45, 0,
0, 0, 1;
rotation_matrix3d << 0.707107, -0.707107, 0,
0.707107, 0.707107, 0,
0, 0, 1;
std::cout << "rotation_matrix =\n" << rotation_matrix << std::endl;
/* * rotation_matrix = * 0.707107 -0.707107 0 * 0.707107 0.707107 0 * 0 0 1 */
// 2. 旋转矩阵转换为欧拉角,"2" represents the z axis , "0" x axis, "1" y axis
Eigen::Vector3d euler_angle = rotation_matrix3d.eulerAngles(2, 1, 0);// z y x
std::cout << "绕z轴旋转的角度是 " << euler_angle.z() * 180 / M_PI << std::endl;
std::cout << "绕y轴旋转的角度是 " << euler_angle.y() * 180 / M_PI << std::endl;
std::cout << "绕x轴旋转的角度是 " << euler_angle.x() * 180 / M_PI << std::endl;
tf_camera_rotation.getEulerYPR(z,y,x);
std::cout << "zb " << z << " yb " << y << " xb " << x << std::endl; // rotation_matrix3d.x() -1.57062 rotation_matrix3d.y() -0.000116255 rotation_matrix3d.z() -1.57072
边栏推荐
- Starkware: to build ZK "universe"
- 机器学习编译第2讲:张量程序抽象
- sqlserver 做cdc 要对数据库性能有什么要求么
- How to use FRP intranet penetration +teamviewer to quickly connect to the intranet host at home when mobile office
- Jarvis OJ simple network management protocol
- 不敢买的思考
- Games101 notes (I)
- scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
- DenseNet
- 挖财股票开户安全吗?怎么开股票账户是安全?
猜你喜欢

Deep learning plus

Get ready for the pre-season card game MotoGP ignition champions!

Global Data Center released DC brain system, enabling intelligent operation and management through science and technology

深潜Kotlin协程(二十一):Flow 生命周期函数

如何将mysql卸载干净

Today's sleep quality record 79 points

国产芯片产业链两条路齐头并进,ASML真慌了而大举加大合作力度

Data access - entityframework integration

中国广电正式推出5G服务,中国移动赶紧推出免费服务挽留用户

2020-2022 two-year anniversary of creation
随机推荐
DeSci:去中心化科学是Web3.0的新趋势?
Jarvis OJ 远程登录协议
Practice independent and controllable 3.0 and truly create the open source business of the Chinese people
Data verification before and after JSON to map -- custom UDF
自己要有自己的坚持
You should have your own persistence
JSON转MAP前后数据校验 -- 自定义UDF
One click installation script enables rapid deployment of graylog server 4.2.10 stand-alone version
[js] skill simplification if empty judgment
如何将mysql卸载干净
If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats
How to use FRP intranet penetration +teamviewer to quickly connect to the intranet host at home when mobile office
PHP strict mode
面对新的挑战,成为更好的自己--进击的技术er
HiEngine:可媲美本地的云原生内存数据库引擎
【学术相关】多位博士毕业去了三四流高校,目前惨不忍睹……
【深度学习】深度学习如何影响运筹学?
Summary of methods for finding intersection of ordered linked list sets
SQL injection of cisp-pte (Application of secondary injection)
How to uninstall MySQL cleanly