elevation_mapping icon indicating copy to clipboard operation
elevation_mapping copied to clipboard

Can't write elevation_mapping code in main()

Open mhowe8 opened this issue 3 years ago • 3 comments

I am writing my own subscriber to an elevation map. I have my own elevation map stored as a global variable and with each message I convert it into a map and store it as my global map. For some reason, whenever I call functions on this map in main, I get this error:

[elev_map_listener-10] process has died [pid 13617, exit code -8, cmd /home/mikey/travels_ws/devel/lib/travels_main/elev_map_listener __name:=elev_map_listener __log:=/home/mikey/.ros/log/98279fcc-eda7-11ec-90cc-b1a665a9a6bc/elev_map_listener-10.log]. log file: /home/mikey/.ros/log/98279fcc-eda7-11ec-90cc-b1a665a9a6bc/elev_map_listener-10*.log

However, when I write code that directly involves the map (call elevation_mapping or GridMap functions on the map) in the callback function for the subscriber, or in functions that I call from the callback function, it works fine.

I would like to be able to write my code in main.

mhowe8 avatar Jun 16 '22 19:06 mhowe8

Can you add more debug output?

maximilianwulf avatar Jun 17 '22 09:06 maximilianwulf

Running it with valgrind doesn't work either, I think the issue is that I don't have enough space in memory but I will get back to you.

mhowe8 avatar Jun 21 '22 15:06 mhowe8

Thread 1 "elev_map_listen" received signal SIGFPE, Arithmetic exception. 0x00007ffff7f5cec1 in grid_map::getIndexFromLinearIndex(unsigned long, Eigen::Array<int, 2, 1, 0, 2, 1> const&, bool) () from /opt/ros/noetic/lib/libgrid_map_core.so (gdb) bt #0 0x00007ffff7f5cec1 in grid_map::getIndexFromLinearIndex(unsigned long, Eigen::Array<int, 2, 1, 0, 2, 1> const&, bool) () from /opt/ros/noetic/lib/libgrid_map_core.so #1 0x00007ffff7f6853c in grid_map::GridMapIterator::operator*() const () from /opt/ros/noetic/lib/libgrid_map_core.so #2 0x00005555555b5dc7 in main (argc=1, argv=0x7fffffffd2e8) at /home/mikey/2022-big-idea-software/src/travels_main/src/elev_map_listener.cpp:674

mhowe8 avatar Jul 14 '22 20:07 mhowe8