gaoxiang12 / slambook

MIT License
6.76k stars 3.24k forks source link

ch13 octomap_mapping error: segmentation fault (core dumped) #258

Closed skystalkerrc closed 4 years ago

skystalkerrc commented 4 years ago

Ubuntu 18.04 OpenCV 3.1 Eigien 3.3.4-4

Error message

(gdb) finish
Run till exit from #0  std::vector<Eigen::Transform<double, 3, 1, 0>, std::allocator<Eigen::Transform<double, 3, 1, 0> > >::push_back (this=0x7fffffffd040, __x=...)
    at /usr/include/c++/7/bits/stl_vector.h:941
octomap_mapping: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]: Assertion `(internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
skystalkerrc commented 4 years ago

Problem solved: In file octomap_mapping.cpp, modify line 16 as bellow:

vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d> > poses;
$./octomap_mapping 
正在将图像转换为 Octomap ...
转换图像中: 1
转换图像中: 2
转换图像中: 3
转换图像中: 4
转换图像中: 5
saving octomap ... 
Writing 146768 nodes to output stream...
$octovis octomap.bt
skystalkerrc commented 4 years ago

Problem solved: In file octomap_mapping.cpp, modify line 16 as bellow:

vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d> > poses;