Closed ghost closed 3 years ago
Unfortunately, we currently don't have the resources to investigate this but feel free to make a PR.
If you're not doing that already, you could build the node from source as Debug
or RelWithDebInfo
and attach a debugger to find what exactly results in the segmentation fault.
If you can pinpoint the issue to a specific line, we may be able to help.
there is a bug in the code: for (int y = size_y_rev; y >= 0; --y){
int idx_map_y = size_x * (size_y -y);
int idx_img_y = size_x * y;
for (int x = 0; x < size_x; ++x){
...
it should be: for (int y = size_y_rev; y >= 0; --y){
int idx_map_y = size_x * (size_y -y-1); // here is the change.
int idx_img_y = size_x * y;
for (int x = 0; x < size_x; ++x){
@lianghu3124 Thank you for looking into this! Could you link the relevant file / line?
Hello,
I am currently running a custom RL-based exploration algorithm which takes in the map generated by the "gmapping" pkg as an input, in the form of an image. In order to do so, I've used the hector_compressed_image_transport to transform the \map topic generated by gmapping into an image. However, once a training episode of the exploration algorithm is done, the exploration algorithm moves on to the next episode but the "map_to_image" node shuts down producing the error message: "Segmentation Fault (core dummped)".
I have a hunch this has something to do with the fact that I've tailored the gmapping pkg to reset the map everytime an episode is done, as was done in https://github.com/jukindle/slam_gmapping. On the exploration side, I publish a trigger msg (in this case, 'reset'), for which the gmapping pkg is always listening, upon which the gmapping resets the map. Right after this, there may be a short period of time during which there is no \map node to subscribe to while a new "SlamGmapping" object is being started live again.