segmentation fault when using the inflation layer in costmap2DROS [closed]

asked 2013-11-07 22:43:21 -0500

linde gravatar image

updated 2013-11-18 16:46:15 -0500

tfoote gravatar image


I'm using ROS Hydro on Ubuntu 12.04.03 LTS. When I try to use the inflation layer plugin within my costmap, my whole programm crashes in 4 of 5 times with a segmentation fault. This is what I do...

First I'm doing the initialization of the costmap:

tf_listener_Ptr.reset(new tf::TransformListener());
 cout << "Setting param " << (n_priv.getNamespace()+"/merlin_costmap/robot_base_frame") << endl;
mCostmap_Ptr.reset(new costmap_2d::Costmap2DROS("merlin_costmap",*(tf_listener_Ptr.get())));

Then I'm doing some other stuff, which is unrelated to the costmap...

And now this is the place where the programm possibly crashes:

while(ros::ok() && !map_set && !stChk_Ptr->isTFInitialized()){

with the following stacktrace:

Thread [7] 6755 [core: 2] (Suspended : Signal : SIGSEGV:Segmentation fault) 
std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<signed char>() at stl_algobase.h:366 0x59bc14  
std::__copy_move_a<false, signed char*, signed char*>() at stl_algobase.h:384 0x59a1c1  
std::__copy_move_a2<false, signed char*, signed char*>() at stl_algobase.h:422 0x5975bf 
std::copy<signed char*, signed char*>() at stl_algobase.h:454 0x59385a  
std::__uninitialized_copy<true>::__uninit_copy<signed char*, signed char*>() at stl_uninitialized.h:95 0x59a1ee 
std::uninitialized_copy<signed char*, signed char*>() at stl_uninitialized.h:119 0x5975f3   
std::__uninitialized_copy_a<signed char*, signed char*, signed char>() at stl_uninitialized.h:259 0x593890  
std::__uninitialized_move_a<signed char*, signed char*, std::allocator<signed char> >() at stl_uninitialized.h:269 0x5d35e7 
std::vector<signed char, std::allocator<signed char> >::_M_fill_insert() at vector.tcc:429 0x5d12f6 
costmap_2d::Costmap2DPublisher::prepareGrid() at 0x7ffff603c89c 
costmap_2d::Costmap2DPublisher::onNewSubscription() at 0x7ffff603cc39   
ros::PeerConnDisconnCallback::call() at 0x7ffff71d823e  
ros::CallbackQueue::callOneCB() at 0x7ffff71dd5c9   
ros::CallbackQueue::callAvailable() at 0x7ffff71df08b   
ros::SingleThreadedSpinner::spin() at 0x7ffff722efe8    
ros::spin() at 0x7ffff7213fbb   
spinTask() at rrt_control.cpp:1.111 0x53d583    
boost::detail::thread_data<void () at thread.hpp:61 0x5a0187    
thread_proxy() at 0x7ffff748dce9    
<...more frames...>

This are my costmap.yaml files (in analogy to the move base tutorial): common_costmap_params.yaml

publish_frequency: 1.0
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [ [-1,-1], [1,-1], [1,1], [-1, 1]]
#robot_radius: ir_of_robot
inflation_radius: 0.55

and global_costmap_params.yaml

   - {name: static_map,       type: "costmap_2d::StaticLayer"}
   - {name: obstacles,        type: "costmap_2d::ObstacleLayer"}
   - {name: inflater,         type: "costmap_2d::InflationLayer"}
global_frame: map
robot_base_frame: base_link
update_frequency: 5.0
static_map: false
width: 100
height: 100
#rolling_window: false
  observation_sources: laser_scan_sensor
  laser_scan_sensor: {sensor_frame: /laser, data_type: LaserScan, topic: /scan, marking: true, clearing: true}

When I comment the line with the inflater plugin in the global_costmap_params.yaml and also when I launch move_base with this parameters as described in the ros tutorial everything works fine.

Does anybody know where the segmentation fault comes from? Are there some parameters missing in the configuration file?

Any help will be appreciated...

Update: Today I installed the released patch, but still the problem remains...

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by linde
close date 2014-05-14 22:48:08


Do you still see this behavior with the latest version of the code?

David Lu gravatar image David Lu  ( 2014-05-14 09:16:13 -0500 )edit

sorry I forgot this question. Since a few month it works. I didn't test it with the latest code version, but as it works with older releases, it is likely to work with the latest code version....

linde gravatar image linde  ( 2014-05-14 22:47:29 -0500 )edit