视觉SLAM十四讲slambook2ch3examplesplotTrajectory.c。。。

更新时间:2023-07-15 13:23:43 阅读: 评论:0

视觉SLAM⼗四讲slambook2ch3examplesplotTrajectory.c。。。
视觉SLAM⼗四讲slambook2/ch3/examples/plotTrajectory.cpp程序报错解决
原程序编译后出现如下报错:
/usr/local/include/pangolin/var/var.h:218:29: error: ‘class pangolin::VarValueT<bool>’ has no member named ‘Get’
return var->Get();
^
/usr/local/include/pangolin/var/var.h:222:29: error: ‘class pangolin::VarValueT<bool>’ has no member named ‘Get’
return var->Get();
^
仓鼠吃啥/usr/local/include/pangolin/var/varvalue.h:99:23: error: ‘class pangolin::VarValue<bool>’ has no membe
r named ‘str’
this->str = (VarValueT<std::string>*)this;
^
/usr/local/include/pangolin/var/varvalue.h:102:23: error: ‘class pangolin::VarValue<bool>’ has no member named ‘str’中国古典园林分析
this->str = str_ptr;
^
解决办法:找到该⼯程 加⼊如下代码:
t(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} -std=c++11")
即可解决
再编译仍存在问题,报错如下:
/
home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:14:28: error: ‘Isometry3d’ was not declared in this scope
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>>);
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:14:65: error: ‘Isometry3d’ was not declared in this scope
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>>);
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:14:65: error: template argument 1 is invalid
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:14:75: error: template argument 1 is invalid
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>>);
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:14:75: error: template argument 2 is invalid
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp: In function ‘int main(int, char**)’:
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:10: error: ‘Isometry3d’ was not declared in this scope
vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos;
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:47: error: the value of ‘Isometry3d’ is not usable in a constant expression
vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos;
卤腐竹的做法^
/
home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:10: note: ‘Isometry3d’ was not declared ‘constexpr’
vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos;
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:47: error: type/value mismatch at argument 1 in template parameter list for ‘template<class  T> class Eigen::aligned_allocator’
vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos;
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:47: note:  expected a type, got ‘Isometry3d’
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:57: error: template argument 1 is invalid
vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos;
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:18:57: error: template argument 2 is invalid
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:28:16: error: expected ‘;’ before ‘Twr’
Isometry3d Twr(Quaterniond(qw, qx, qy, qz));
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:29:5: error: ‘Twr’ was not declared in this scope朋友数
Twr.pretranslate(Vector3d(tx, ty, tz));
^
二次根式的计算
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:30:11: error: request for member ‘push_back’ in ‘pos’, which is of non-class type ‘int’
/
home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:30:11: error: request for member ‘push_back’ in ‘pos’, which is of non-class type ‘int’    pos.push_back(Twr);
^
个人业绩成果自述/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:32:34: error: request for member ‘size’ in ‘pos’, which is of non-class type ‘int’
cout << "read total " << pos.size() << " po entries" << endl;
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp: At global scope:
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:40:28: error: ‘Isometry3d’ was not declared in this scope
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos) {
^
/
home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:40:65: error: ‘Isometry3d’ was not declared in this scope
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos) {
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:40:65: error: template argument 1 is invalid
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:40:75: error: template argument 1 is invalid
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>> pos) {
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:40:75: error: template argument 2 is invalid
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp: In function ‘void DrawTrajectory(int)’:
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:61:34: error: request for member ‘size’ in ‘pos’, which is of non-class type ‘int’
for (size_t i = 0; i < pos.size(); i++) {
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:63:28: error: invalid types ‘int[std::size_t {aka long unsigned int}]’ for array subscript
Vector3d Ow = pos[i].translation();
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:64:28: error: invalid types ‘int[std::size_t {aka long unsigned int}]’ for array subscript
Vector3d Xw = pos[i] * (0.1 * Vector3d(1, 0, 0));
^
/
home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:65:28: error: invalid types ‘int[std::size_t {aka long unsigned int}]’ for array subscript
Vector3d Yw = pos[i] * (0.1 * Vector3d(0, 1, 0));
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:66:28: error: invalid types ‘int[std::size_t {aka long unsigned int}]’ for array subscript
Vector3d Zw = pos[i] * (0.1 * Vector3d(0, 0, 1));
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:80:34: error: request for member ‘size’ in ‘pos’, which is of non-class type ‘int’
for (size_t i = 0; i < pos.size(); i++) {
^
/
home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:83:24: error: invalid types ‘int[std::size_t {aka long unsigned int}]’ for array subscript
auto p1 = pos[i], p2 = pos[i + 1];
^
/home/sky/LQT/slambook2/ch3/examples/plotTrajectory.cpp:85:18: error: ‘p2’ was not declared in this scope
anslation()[0], p2.translation()[1], p2.translation()[2]);
仔细阅读报错,查看代码发现主要是对 Isometry3d Vector3d等⼏何模块不⽀持,发现缺少集合模块头⽂件,补上头⽂件:
如何进入安全模式
#include <Eigen/Geometry>
编译成功
若发现程序编译成功后仍不可运⾏,返回错误:
cannot find trajectory file at ./
将路径修改为绝对路径即可
// path to trajectory file
考研祝福string trajectory_file ="/home/sky/LQT/slambook2/ch3/";

本文发布于:2023-07-15 13:23:43,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1097929.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:报错   编译   发现   园林   自述   解决办法
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图