当前位置:网站首页>【机器人坐标系第一讲】
【机器人坐标系第一讲】
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
边栏推荐
- Solution of vant tabbar blocking content
- Single merchant v4.4 has the same original intention and strength!
- How to use FRP intranet penetration +teamviewer to quickly connect to the intranet host at home when mobile office
- Can you help me see what the problem is? [ERROR] Could not execute SQL stateme
- Jarvis OJ simple network management protocol
- Flet教程之 12 Stack 重叠组建图文混合 基础入门(教程含源码)
- 国产芯片产业链两条路齐头并进,ASML真慌了而大举加大合作力度
- 机器学习编译第2讲:张量程序抽象
- 【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
- Get ready for the pre-season card game MotoGP ignition champions!
猜你喜欢
今日睡眠质量记录79分
Binary tree related OJ problems
Accès aux données - intégration du cadre d'entité
Games101 notes (II)
OneForAll安装使用
Bs-xx-042 implementation of personnel management system based on SSM
Jarvis OJ Flag
Deep dive kotlin synergy (XXI): flow life cycle function
Benji Bananas 会员通行证持有人第二季奖励活动更新一览
scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
随机推荐
Cheer yourself up
清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
网站页面禁止复制内容 JS代码
[深度学习][原创]让yolov6-0.1.0支持yolov5的txt读取数据集模式
[deep learning] how does deep learning affect operations research?
文件操作--I/O
The memory of a Zhang
Android privacy sandbox developer preview 3: privacy, security and personalized experience
有序链表集合求交集 方法 总结
Get ready for the pre-season card game MotoGP ignition champions!
Jarvis OJ 远程登录协议
Deep dive kotlin synergy (XXI): flow life cycle function
Flet教程之 09 NavigationRail 基础入门(教程含源码)
Record a 'very strange' troubleshooting process of cloud security group rules
给自己打打气
Jarvis OJ Flag
[61dctf]fm
深潜Kotlin协程(二十一):Flow 生命周期函数
为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
Benji Bananas 会员通行证持有人第二季奖励活动更新一览