leggedrobotics / tree_detection

This package implements a simple tree detector from point cloud data. It makes no assumptions about the ground plane and can handle arbitrary terrains.
70 stars 15 forks source link

Running into error after executing tree_detection_ros #6

Open chiragr15 opened 2 years ago

chiragr15 commented 2 years ago

Coming across an error after running roslaunch on every forest.pcd file even after following previous instructions correctly. Following error message thrown onto terminal : tree_detection_node: /usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:117: Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::operator()(Eigen::Index, Eigen::Index) const [with Derived = Eigen::Matrix<float, -1, -1>; Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType = const float&; Eigen::Index = long int]: Assertion `row >= 0 && row < rows() && col >= 0 && col < cols()' failed.

jelavice commented 2 years ago

Hi @chiragr15 ,

thank you for reporting the issue. Could you please run in debug mode and share the stack trace as well as information about your system (ubuntu version, ros version, eigen version)?

Then we might get a better idea of where the problem lies.

Best,

E

chiragr15 commented 2 years ago

Hi @jelavice , Could you please explain in detail what is meant by running in debug mode? Here are the system specs : Ubuntu version : 20.04.4 LTS ROS version : ROS2 Noetic Eigen version : 3.3.7

Thanks, Chirag

jelavice commented 2 years ago

I mean build in mode that contains debug info and then run with gdb: http://wiki.ros.org/roslaunch/Tutorials/Roslaunch%20Nodes%20in%20Valgrind%20or%20GDB

can you run this command in your catkin workspace, rebuild, and then run with gdb? catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo

you can change the launch prefix on line 5 in tree_detection.launch

chiragr15 commented 2 years ago

This solution worked. After rebuilding it with the above command and running with gdb, the algorithm worked. Thanks for your help!

chiragr15 commented 2 years ago

What was the exact problem in running it with the default instructions given in the ReadMe?

jelavice commented 2 years ago

You don't have to run it with gdb always, that is just for debugging.

My guess is that compiling in the Release mode optimizes out parts of the code that produce the segfault which is why this solution works. When you compiled before, you did not compile in the Release mode and the problematic part of code did not get optimized out. However, this means that there is a problem somewhere that we should investigate :see_no_evil:

I'll leave this issue open until the problem is fully resolved.

chiragr15 commented 2 years ago

Does the program run on ROS Melodic or it is catered to Noetic itself?

jelavice commented 2 years ago

You should be able to run it on Melodic as well, although I haven't tested this.

chiragr15 commented 2 years ago

Running into an CMake error when trying to build the project. 'Could not find a package configuration file provided by "grid_map_pcl" with any of the following names : grid_map_pclConfig.cmake grid_map_pcl-config.cmake '

Another error while launching the project: "PluginlibFactory : plugin for class 'grid_map_rviz_plugin/GridMap', failed to load"

jelavice commented 2 years ago

You need to compile the grid_map_pcl and grid_map_rviz from the source as instructed in the readme