tree_detection icon indicating copy to clipboard operation
tree_detection copied to clipboard

Running into error after executing tree_detection_ros

Open chiragr15 opened this issue 2 years ago • 10 comments

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.

chiragr15 avatar Sep 06 '22 08:09 chiragr15

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

jelavice avatar Sep 06 '22 11:09 jelavice

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

chiragr15 avatar Sep 06 '22 11:09 chiragr15

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

jelavice avatar Sep 06 '22 14:09 jelavice

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

chiragr15 avatar Sep 07 '22 05:09 chiragr15

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

chiragr15 avatar Sep 07 '22 05:09 chiragr15

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.

jelavice avatar Sep 07 '22 08:09 jelavice

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

chiragr15 avatar Sep 29 '22 09:09 chiragr15

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

jelavice avatar Sep 29 '22 10:09 jelavice

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"

chiragr15 avatar Sep 29 '22 10:09 chiragr15

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

jelavice avatar Sep 29 '22 10:09 jelavice