iris-ua / iris_lama_ros

LaMa on ROS
BSD 3-Clause "New" or "Revised" License
208 stars 59 forks source link

Cant compile on Raspberry Pi - Noetic #52

Closed JanezCim closed 1 year ago

JanezCim commented 2 years ago

Hey @eupedrosa, i have a problem compiling iris on rpi4, heres what im doing:

Raspberry pi 4 rev 1.4

ubuntu@pi-focal:~/iris_slam_ws/src$ ls
iris_lama  iris_lama_ros
ubuntu@pi-focal:~/iris_slam_ws/src/iris_lama_ros$ git checkout noetic-devel
ubuntu@pi-focal:~/iris_slam_ws/src/iris_lama$ git status
On branch master
ubuntu@pi-focal:~/iris_slam_ws$ catkin config --extend /opt/ros/noetic
ubuntu@pi-focal:~/iris_slam_ws$ rosdep install --from-paths src --ignore-src -r -y
#All required rosdeps installed successfully
ubuntu@pi-focal:~/iris_slam_ws$ catkin build
...              
_____________________________________________________________________________________________________
Errors     << iris_lama:make /home/ubuntu/iris_ws/logs/iris_lama/build.make.000.log                  
/home/ubuntu/iris_ws/src/iris_lama/src/loc2d.cpp: In member function ‘void lama::Loc2D::addSamplingCovariance(const Ptr&)’:
/home/ubuntu/iris_ws/src/iris_lama/src/loc2d.cpp:211:55: error: no matching function for call to ‘max(unsigned int, long unsigned int)’
  211 |     const size_t step = std::max(num_points / 100, 1ul);
eupedrosa commented 2 years ago

Hi @JanezCim.

It compiles fine on my normal computer. There must be some weird compiler behaviour. Try changing to

const size_t step = std::max<size_t>(num_points / 100, 1ul);

or

const size_t step = std::max((size_t)(num_points / 100), (size_t)(1ul));

There may be some wrong type deduction from the compiler. Please let me know if it fixes anything.

JanezCim commented 2 years ago

Setting

const size_t step = std::max<size_t>(num_points / 100, 1ul);

fixed the problem, it now compiles, albeit with a warning:


Warnings   << iris_lama_ros:make /home/ubuntu/iris_ws/logs/iris_lama_ros/build.make.000.log          
In file included from /usr/include/c++/9/vector:72,
                 from /opt/ros/noetic/include/nav_msgs/GetMapRequest.h:10,
                 from /opt/ros/noetic/include/nav_msgs/GetMap.h:11,
                 from /home/ubuntu/iris_ws/src/iris_lama_ros/src/loc2d_ros.cpp:34:
/usr/include/c++/9/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const Eigen::Matrix<double, 3, 1, 0, 3, 1>&}; _Tp = Eigen::Matrix<double, 3, 1>; _Alloc = std::allocator<Eigen::Matrix<double, 3, 1> >]’:
/usr/include/c++/9/bits/vector.tcc:426:7: note: parameter passing for argument of type ‘std::vector<Eigen::Matrix<double, 3, 1> >::iterator’ {aka ‘__gnu_cxx::__normal_iterator<Eigen::Matrix<double, 3, 1>*, std::vector<Eigen::Matrix<double, 3, 1> > >’} changed in GCC 7.1
  426 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
eupedrosa commented 2 years ago

That is an ABI warning, as described here.

Maybe recompile everthing?

JanezCim commented 2 years ago

deleted and recompiled everything, the warning is still showing. I'd simply ignore it for now and call this solved