当前位置:网站首页>【机器人坐标系第一讲】
【机器人坐标系第一讲】
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
边栏推荐
- The new version of effect editor is online! 3D rendering, labeling, and animation, this time an editor is enough
- Migrate /home partition
- Games101 notes (III)
- Single merchant v4.4 has the same original intention and strength!
- Jarvis OJ 远程登录协议
- [deep learning] how does deep learning affect operations research?
- 有序链表集合求交集 方法 总结
- 【刷题篇】有效的数独
- Cartoon: what is service fusing?
- 如何安装mysql
猜你喜欢
美国芯片傲不起来了,中国芯片成功在新兴领域夺得第一名
Jarvis OJ Flag
Enter a command with the keyboard
如何将mysql卸载干净
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
PHP人才招聘系统开发 源代码 招聘网站源码二次开发
Solution of vant tabbar blocking content
普洛斯数据中心发布DC Brain系统,科技赋能智慧化运营管理
中国广电正式推出5G服务,中国移动赶紧推出免费服务挽留用户
【刷題篇】鹅廠文化衫問題
随机推荐
中间表是如何被消灭的?
OneForAll安装使用
二叉树相关OJ题
Twig数组合并的写法
Do sqlserver have any requirements for database performance when doing CDC
解决CMakeList find_package找不到Qt5,找不到ECM
Binary tree related OJ problems
Flet教程之 12 Stack 重叠组建图文混合 基础入门(教程含源码)
Jarvis OJ Flag
scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
Using graylog alarm function to realize the regular work reminder of nail group robots
[es6] 模板字符串内添加if判断或添加三元运算符判断
为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
The new version of effect editor is online! 3D rendering, labeling, and animation, this time an editor is enough
搜索 正排索引 和 倒排索引 区别
树莓派4b安装Pytorch1.11
Learnopongl notes (I)
tf.sequence_mask函数讲解案例
[es6] add if judgment or ternary operator judgment in the template string
详解SQL中Groupings Sets 语句的功能和底层实现逻辑