tu-darmstadt-ros-pkg / hector_navigation

hector_navigation provides packages related to navigation of unmanned vehicles in USAR environments.
125 stars 90 forks source link

Unkown error to hector_costmap.cpp #21

Closed suho0515 closed 4 years ago

suho0515 commented 4 years ago

Hello sir, I'm trying to create hector_costmap. I made 2D Occupancy grid map and 2.5D Elevation Map but Cost map. but there is error like this

[hector_costmap-1] process has died [pid 40480, exit code -11, cmd /home/suho/catkin_ws/devel/lib/hector_costmap/hector_costmap __name:=hector_costmap __log:=/home/suho/.ros/log/56bc3842-4663-11ea-b940-40a3cce998a5/hector_costmap-1.log]. log file: /home/suho/.ros/log/56bc3842-4663-11ea-b940-40a3cce998a5/hector_costmap-1*.log

`// loop through each element int filtered_cell, filtered_cell_x, filtered_cell_y; for (int v = min_index(1); v < max_index(1); ++v) {

    for (int u = min_index(0); u < max_index(0); ++u)
    {

    printf("min_index(1):%d\n",min_index(1));
        printf("max_index(1):%d\n",max_index(1));
        printf("min_index(0):%d\n",min_index(0));
        printf("max_index(0):%d\n",max_index(0));

        // compute cost_map_index
        unsigned int cost_map_index = MAP_IDX(cost_map.info.width, u, v);

    printf("v:%d\n",v);
    printf("u:%d\n",u);

    //printf("size of elevation_map_ : %d(rows), %d(cols)\n",elevation_map_.rows,elevation_map_.cols); 
    printf("elevation_map_.at<int16_t>(%d,%d):%d\n",v+1,u,elevation_map_.at<int16_t>(v+1,u));
    printf("elevation_map_.at<int16_t>(%d,%d):%d\n",v-1,u,elevation_map_.at<int16_t>(v-1,u));
    printf("elevation_map_.at<int16_t>(%d,%d):%d\n",v,u+1,elevation_map_.at<int16_t>(v,u+1));
    printf("elevation_map_.at<int16_t>(%d,%d):%d\n",v,u-1,elevation_map_.at<int16_t>(v,u-1));

    //printf("(-elevation_zero_level):%d\n",(-elevation_zero_level));
        // check if neighbouring cells are known
        if(elevation_map_.at<int16_t>(v+1,u) == (-elevation_zero_level) ||
                elevation_map_.at<int16_t>(v-1,u) == (-elevation_zero_level) ||
                elevation_map_.at<int16_t>(v,u+1) == (-elevation_zero_level) ||
                elevation_map_.at<int16_t>(v,u-1) == (-elevation_zero_level))
    {
        printf("continue\n");
                continue;
    }`

I did review the code of hector_costmap.cpp and there is unknown error in some specific point. and i did print it out to see what's going on.

and i could get the result like this.

elevation_map_.at<int16_t>(1088,1122):0 elevation_map_.at<int16_t>(1086,1122):0 elevation_map_.at<int16_t>(1087,1123):0 elevation_map_.at<int16_t>(1087,1121):0 not continue min_index(1):925 max_index(1):1123 min_index(0):925 max_index(0):1123 v:1088 u:925 [hector_costmap-1] process has died [pid 40480, exit code -11, cmd /home/suho/catkin_ws/devel/lib/hector_costmap/hector_costmap __name:=hector_costmap __log:=/home/suho/.ros/log/56bc3842-4663-11ea-b940-40a3cce998a5/hector_costmap-1.log]. log file: /home/suho/.ros/log/56bc3842-4663-11ea-b940-40a3cce998a5/hector_costmap-1*.log

I could detect that, the node(hector_costmap) is terminated when the variable 'v' goes to 1088 or 1087. is there any memory issue, or should i configure something?

regards.

suho0515 commented 4 years ago

it caused by wrong setting, i'd close this issue.