zm0612 / Hybrid_A_Star

Hybrid A Star algorithm C++ implementation
Other
633 stars 138 forks source link

use a map with resolution other than 1.0 will raise errors #13

Closed ashleyzero closed 3 months ago

ashleyzero commented 7 months ago

If I use a custom map (resolution: 0.5), run run_hybrid_a_star.launch will raise following errors:

Stack trace (most recent call last):
#4    Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#3    Object "/home/ashley/catkin_ws/devel/lib/hybrid_a_star/run_hybrid_astar", at 0x55f7fd649d4d, in 
#2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff9423c0082, in __libc_start_main
#1    Object "/home/ashley/catkin_ws/devel/lib/hybrid_a_star/run_hybrid_astar", at 0x55f7fd649bd7, in 
#0    Object "/home/ashley/catkin_ws/devel/lib/libPATH_SEARCHER_LIB.so", at 0x7ff942a10910, in HybridAStarFlow::Run()
Segmentation fault (Invalid permissions for mapped object [0x7ff930021980])
[run_hybrid_astar-7] process has died [pid 74874, exit code -11, cmd /home/ashley/catkin_ws/devel/lib/hybrid_a_star/run_hybrid_astar __name:=run_hybrid_astar __log:=/home/ashley/.ros/log/c1b9ff38-d1f8-11ee-829d-63b789bf8946/run_hybrid_astar-7.log].
log file: /home/ashley/.ros/log/c1b9ff38-d1f8-11ee-829d-63b789bf8946/run_hybrid_astar-7*.log

I think there is a bug in src/hybrid_a_star_flow.cpp

void HybridAStarFlow::Run() {
 // #95
  unsigned int map_w = std::floor(current_costmap_ptr_->info.width / map_resolution);
  unsigned int map_h = std::floor(current_costmap_ptr_->info.height / map_resolution);
}

add * current_costmap_ptr_->info.resolution can fix it.

qimao7213 commented 4 months ago

yes,thank you

zm0612 commented 3 months ago

hello, Have fixed this bug. thx!