当前位置:网站首页>【机器人坐标系第一讲】
【机器人坐标系第一讲】
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
边栏推荐
- Jarvis OJ 远程登录协议
- Benji Banas membership pass holders' second quarter reward activities update list
- Summary of PHP pseudo protocol of cisp-pte
- 为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
- Dare not buy thinking
- [echart] resize lodash to realize chart adaptation when window is zoomed
- Do sqlserver have any requirements for database performance when doing CDC
- 给自己打打气
- Scratch colorful candied haws Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
- 极坐标扇图使用场景与功能详解
猜你喜欢
Games101 notes (I)
Benji Banas membership pass holders' second quarter reward activities update list
【刷题篇】有效的数独
公司自用的国产API管理神器
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
Scratch colorful candied haws Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
PHP人才招聘系统开发 源代码 招聘网站源码二次开发
If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats
Jarvis OJ simple network management protocol
Win11如何给应用换图标?Win11给应用换图标的方法
随机推荐
为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
【深度学习】深度学习如何影响运筹学?
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
Solution of vant tabbar blocking content
Get ready for the pre-season card game MotoGP ignition champions!
The difference between searching forward index and inverted index
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
Jarvis OJ simple network management protocol
Solve cmakelist find_ Package cannot find Qt5, ECM cannot be found
Games101 notes (I)
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
有序链表集合求交集 方法 总结
Raspberry pie 4B installation pytorch1.11
怎样在电脑上设置路由器的WiFi密码
采用药丸屏的iPhone14或引发中国消费者的热烈抢购
[brush questions] effective Sudoku
Data access - entityframework integration
数据访问 - EntityFramework集成