Robotics StackExchange | Archived questions

Cannot delete octomap::OcTree object

I am currently working with the octomap library in ROS to provide mapping capabilities for a SLAM solution I am working on. I am developing a particle filter, and for each particle, I would like to have a different map. I do this by keeping an octomap::OcTree *octo_map as a member of the particle class. On all constructors of the class, I call this->octo_map = new octomap::OcTree(0.5) (where 0.5 is just a parameter for the resolution). Naturally, in the class destructor, I call delete this->octo_map. The program compiles correctly and it gives me no warnings (I added the lines find_package(octomap REQUIRED) and include_directories(${OCTOMAP_INCLUDE_DIRS}), as well as the dependencies octomap_msgs and octomap_ros in the find_packages() declaration to the 'CMakeLists.txt').

During the program's execution, everything works fine up until the moment when it receives a 'SIGABORT'. I debugged this and found that this happens when the delete is called on the OcTree for trying to deallocate an invalid pointer (this code is part of the library, it doesn't happen inside my own code).

This is what I get when running gdb:

*** Error in `/home/daniel/Jacobs/Thesis/ros_ws/devel/lib/bt_particle_filter/bt_particle_filter': free(): invalid pointer: 0x0000000006a0c300 ***

Backtrace:

    (gdb) backtrace

#0  0x00007ffff58f0428 in __GI_raise (sig=sig@entry=6)

    at ../sysdeps/unix/sysv/linux/raise.c:54

#1  0x00007ffff58f202a in __GI_abort () at abort.c:89

#2  0x00007ffff59327ea in __libc_message (do_abort=do_abort@entry=2, 

    fmt=fmt@entry=0x7ffff5a4bed8 "*** Error in `%s': %s: 0x%s ***\n")

    at ../sysdeps/posix/libc_fatal.c:175

#3  0x00007ffff593b37a in malloc_printerr (ar_ptr=<optimized out>, 

    ptr=<optimized out>, str=0x7ffff5a48caf "free(): invalid pointer", 

    action=3) at malloc.c:5006

#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)

    at malloc.c:3867

#5  0x00007ffff593f53c in __GI___libc_free (mem=<optimized out>)

    at malloc.c:2968

#6  0x00000000004e13e5 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x6a0c300)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:676

#7  0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x7b59d10)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#8  0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x75ec980)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#9  0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x7cffd0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#10 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x73019e0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#11 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x4aab870)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#12 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x5362bd0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#13 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x61812b0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#14 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x649a390)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#15 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x816bc0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#16 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x5020910)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#17 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x4784e70)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#18 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x3381660)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#19 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x4ab2810)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#20 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x477b010)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#21 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x58d4e30)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#22 0x00000000004e13a0 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::deleteNodeRecurs (this=0x79bed0, node=0x33ed7d0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:669

#23 0x00000000004dc068 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::clear (this=0x79bed0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:514

#24 0x00000000004ced1b in particle::~particle (this=0x79a180, 

    __in_chrg=<optimized out>)

    at /home/daniel/Jacobs/Thesis/ros_ws/src/bt_particle_filter/src/particle.h:114

#25 0x00000000004d0e59 in particleFilter::sampleNext (this=0x7fffffffbf50, 

    next_odom=0x72d81a0, timestamp=522209, loop_closure_timestamp=0, trans=...)

    at /home/daniel/Jacobs/Thesis/ros_ws/src/bt_particle_filter/src/particle_filter.h:265

#26 0x00000000004d18ad in particleFilterIteration (pt_cloud_ptr=..., 

    tstamp_ptr=..., filter=..., listener=..., map_pub=..., br=...)

    at /home/daniel/Jacobs/Thesis/ros_ws/src/bt_particle_filter/src/bt_particle_filter.cpp:68

#27 0x000000000050a3d3 in boost::_bi::list6<boost::arg<1>, boost::arg<2>, boost::reference_wrapper<particleFilter>, boost::reference_wrapper<tf::TransformListener>, boost::reference_wrapper<ros::Publisher>, boost::reference_wrapper<tf::TransformBroadcaster> >::operator()<void (*)(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, particleFilter&, tf::TransformListener&, ros::Publisher&, tf::TransformBroadcaster&), boost::_bi::list9<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&> > (this=0x7a0e58, 

    f=@0x7a0e50: 0x4d134e <particleFilterIteration(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, particleFilter&, tf::TransformListener&, ros::Publisher&, tf::TransformBroadcaster&)>, a=...)

    at /usr/include/boost/bind/bind.hpp:596

#28 0x0000000000506a73 in boost::_bi::bind_t<void, void (*)(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, particleFilter&, tf::TransformListener&, ros::Publisher&, tf::TransformBroadcaster&), boost::_bi::list6<boost::arg<1>, boost::arg<2>, boost::reference_wrapper<particleFilter>, boost::reference_wrapper<tf::TransformListener>, boost::reference_wrapper<ros::Publisher>, boost::reference_wrapper<tf::TransformBroadcaster> > >::operator()<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&> (this=0x7a0e50, a1=..., a2=..., a3=..., a4=..., a5=..., 

    a6=..., a7=..., a8=..., a9=...) at /usr/include/boost/bind/bind.hpp:1102

#29 0x0000000000501d19 in boost::_bi::list9<boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7>, boost::arg<8>, boost::arg<9> >::operator()<boost::_bi::bind_t<void, void (*)(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, particleFilter&, tf::TransformListener&, ros::Publisher&, tf::TransformBroadcaster&), boost::_bi::list6<boost::arg<1>, boost::arg<2>, boost::reference_wrapper<particleFilter>, boost::reference_wrapper<tf::TransformListener>, boost::reference_wrapper<ros::Publisher>, boost::reference_wrapper<tf::TransformBroadcaster> > >, boost::_bi::list9<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&> > (this=0x7a0e78, f=..., a=...)

    at /usr/include/boost/bind/bind.hpp:827

#30 0x00000000004fd3d3 in boost::_bi::bind_t<boost::_bi::unspecified, boost::_bi::bind_t<void, void (*)(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, particleFilter&, tf::TransformListener&, ros::Publisher&, tf::TransformBroadcaster&), boost::_bi::list6<boost::arg<1>, boost::arg<2 >, boost::reference_wrapper<particleFilter>, boost::reference_wrapper<tf::TransformListener>, boost::reference_wrapper<ros::Publisher>, boost::reference_wrapper<tf::TransformBroadcaster> > >, boost::_bi::list9<boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7>, boost::arg<8>, boost::arg<9> > >::operator()<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&> (this=0x7a0e50, 

    a1=..., a2=..., a3=..., a4=..., a5=..., a6=..., a7=..., a8=..., a9=...)

    at /usr/include/boost/bind/bind.hpp:1102

#31 0x00000000004f8833 in boost::detail::function::void_function_obj_invoker9<boost::_bi::bind_t<boost::_bi::unspecified, boost::_bi::bind_t<void, void (*)(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, particleFilter&, tf::TransformListener&, ros::Publisher&, tf::TransformBroadcaster&), boost::_bi::list6<boost::arg<1>, boost::arg<2>, boost::reference_wrapper<particleFilter>, boost::reference_wrapper<tf::TransformListener>, boost::reference_wrapper<ros::Publisher>, boost::reference_wrapper<tf::TransformBroadcaster> > >, boost::_bi::list9<boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7>, boost::arg<8>, boost::arg<9> > >, void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&>::invoke (function_obj_ptr=..., a0=..., a1=..., 

    a2=..., a3=..., a4=..., a5=..., a6=..., a7=..., a8=...)

    at /usr/include/boost/function/function_template.hpp:159

#32 0x0000000000501f77 in boost::function9<void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&>::operator()

    (this=0x7a2790, a0=..., a1=..., a2=..., a3=..., a4=..., a5=..., a6=..., 

    a7=..., a8=...) at /usr/include/boost/function/function_template.hpp:773

#33 0x00000000004fd5ff in boost::detail::function::void_function_obj_invoker9<boost::function<void (boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&)>, void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const>, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const> >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const>, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>) (function_obj_ptr=..., a0=..., a1=..., a2=..., a3=..., a4=..., a5=..., 

    a6=..., a7=..., a8=...)

    at /usr/include/boost/function/function_template.hpp:159

#34 0x000000000052ebea in boost::function9<void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const>, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const>, boost::shared_ptr<message_filters::NullType const> >::operator() (this=0x7a12e8, a0=..., a1=..., a2=..., a3=..., a4=..., 

    a5=..., a6=..., a7=..., a8=...)

    at /usr/include/boost/function/function_template.hpp:773

#35 0x000000000052a02b in message_filters::CallbackHelper9T<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, boost::shared_ptr<bt_loop_detection::Tstamp_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&>::call (this=0x7a12e0, nonconst_force_copy=false, e0=..., e1=..., e2=..., e3=..., 

    e4=..., e5=..., e6=..., e7=..., e8=...)

    at /opt/ros/kinetic/include/message_filters/signal9.h:128

#36 0x00000000005242f4 in message_filters::Signal9<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>::call (this=0x7fffffffda98, e0=..., e1=..., e2=..., 

    e3=..., e4=..., e5=..., e6=..., e7=..., e8=...)

    at /opt/ros/kinetic/include/message_filters/signal9.h:304

#37 0x0000000000521299 in message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >::signal (this=0x7fffffffd2b0, e0=..., e1=..., e2=..., e3=..., e4=..., e5=..., 

    e6=..., e7=..., e8=...)

    at /opt/ros/kinetic/include/message_filters/synchronizer.h:332

#38 0x000000000051b85b in message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>::publishCandidate (

    this=0x7fffffffd2b0)

    at /opt/ros/kinetic/include/message_filters/sync_policies/approximate_time.h:500

#39 0x0000000000512bd1 in message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>::process (this=0x7fffffffd2b0)

    at /opt/ros/kinetic/include/message_filters/sync_policies/approximate_time.h:767

#40 0x000000000050d046 in message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>::add<0> (this=0x7fffffffd2b0, 

    evt=...)

    at /opt/ros/kinetic/include/message_filters/sync_policies/approximate_time.h:213

#41 0x00000000005099cf in message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >::cb<0> (this=0x7fffffffd2b0, evt=...)

    at /opt/ros/kinetic/include/message_filters/synchronizer.h:358

#42 0x0000000000526f36 in boost::_mfi::mf1<void, message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::operator() (this=0x7a0d10, p=0x7fffffffd2b0, a1=...)

    at /usr/include/boost/bind/mem_fn_template.hpp:165

#43 0x0000000000525049 in boost::_bi::list2<boost::_bi::value<message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >*>, boost::arg<1> >::operator()<boost::_mfi::mf1<void, message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list1<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&> > (this=0x7a0d20, f=..., a=...) at /usr/include/boost/bind/bind.hpp:313

#44 0x00000000005221bb in boost::_bi::bind_t<void, boost::_mfi::mf1<void, message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >*>, boost::arg<1> > >::operator()<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&> (this=0x7a0d10, a1=...) at /usr/include/boost/bind/bind.hpp:905

#45 0x000000000051c6ca in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2_<std::allocator<void> >, bt_loop_detection::Tstamp_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >*>, boost::arg<1> > >, void, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::invoke (

    function_obj_ptr=..., a0=...)

    at /usr/include/boost/function/function_template.hpp:159

#46 0x000000000052e753 in boost::function1<void, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::operator() (this=0x7a0d08, 

    a0=...) at /usr/include/boost/function/function_template.hpp:773

#47 0x00000000005298c9 in message_filters::CallbackHelper1T<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, sensor_msgs::PointCloud2_<std::allocator<void> > >::call (this=0x7a0d00, event=..., 

    nonconst_force_copy=false)

    at /opt/ros/kinetic/include/message_filters/signal1.h:76

#48 0x00000000004f1ae3 in message_filters::Signal1<sensor_msgs::PointCloud2_<std::allocator<void> > >::call (this=0x7fffffffc1d8, event=...)

    at /opt/ros/kinetic/include/message_filters/signal1.h:119

#49 0x00000000004ecba5 in message_filters::SimpleFilter<sensor_msgs::PointCloud2_<std::allocator<void> > >::signalMessage (this=0x7fffffffc1d8, event=...)

    at /opt/ros/kinetic/include/message_filters/simple_filter.h:136

#50 0x00000000004e7c71 in message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >::cb (this=0x7fffffffc1d0, e=...)

    at /opt/ros/kinetic/include/message_filters/subscriber.h:206

#51 0x0000000000502dec in boost::_mfi::mf1<void, message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::operator() (this=0x79eaf0, p=0x7fffffffc1d0, a1=...)

    at /usr/include/boost/bind/mem_fn_template.hpp:165

#52 0x00000000004feb6d in boost::_bi::list2<boost::_bi::value<message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >*>, boost::arg<1> >::operator()<boost::_mfi::mf1<void, message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list1<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&> > (this=0x79eb00, 

    f=..., a=...) at /usr/include/boost/bind/bind.hpp:313

#53 0x00000000004fa325 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >*>, boost::arg<1> > >::operator()<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&> (

    this=0x79eaf0, a1=...) at /usr/include/boost/bind/bind.hpp:905

#54 0x00000000004f6086 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<message_filters::Subscriber<sensor_msgs::PointCloud2_<std::allocator<void> > >*>, boost::arg<1> > >, void, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::invoke (function_obj_ptr=..., a0=...)

    at /usr/include/boost/function/function_template.hpp:159

#55 0x000000000052e753 in boost::function1<void, ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::operator() (this=0x79eae8, 

    a0=...) at /usr/include/boost/function/function_template.hpp:773

#56 0x000000000052aa59 in ros::SubscriptionCallbackHelperT<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, void>::call (

    this=0x79eae0, params=...)

    at /opt/ros/kinetic/include/ros/subscription_callback_helper.h:144

#57 0x00007ffff70edd8d in ros::SubscriptionQueue::call() ()

   from /opt/ros/kinetic/lib/libroscpp.so

#58 0x00007ffff7093838 in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) () from /opt/ros/kinetic/lib/libroscpp.so

#59 0x00007ffff709523b in ros::CallbackQueue::callAvailable(ros::WallDuration)

    () from /opt/ros/kinetic/lib/libroscpp.so

#60 0x00007ffff70f1e39 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*)

    () from /opt/ros/kinetic/lib/libroscpp.so

#61 0x00007ffff70d6e9b in ros::spin() () from /opt/ros/kinetic/lib/libroscpp.so

#62 0x00000000004d2862 in main (argc=2, argv=0x7fffffffdec8)

    at /home/daniel/Jacobs/Thesis/ros_ws/src/bt_particle_filter/src/bt_particle_filter.cpp:166

Frames (25 and 24 are my code):

(gdb) frame 25

#25 0x00000000004d0e59 in particleFilter::sampleNext (this=0x7fffffffbf50, 

    next_odom=0x72d81a0, timestamp=522209, loop_closure_timestamp=0, trans=...)

    at /home/daniel/Jacobs/Thesis/ros_ws/src/bt_particle_filter/src/particle_filter.h:265

265         delete [] this->particles;

(gdb) frame 24

#24 0x00000000004ced1b in particle::~particle (this=0x79a180, 

    __in_chrg=<optimized out>)

    at /home/daniel/Jacobs/Thesis/ros_ws/src/bt_particle_filter/src/particle.h:114

114         this->octo_map->clear();

(gdb) frame 23

#23 0x00000000004dc068 in octomap::OcTreeBaseImpl<octomap::OcTreeNode, octomap::AbstractOccupancyOcTree>::clear (this=0x79bed0)

    at /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.hxx:514

514       deleteNodeRecurs(root);

My question is, has any of you experienced a similar issue with this library? What can I do to get around it? I know there is a ROS node in the octomap_server package that can be used, but I will only use this if I have no other choice, I need the capability to delete and create these maps on the fly for the resampling stage of my particle filter.

I am running ROS Kinetic on a virtual machine with Ubuntu 16.04. My host is a Windows 10 system and I am using VirtualBox.

Asked by erdanielx on 2019-05-07 15:14:16 UTC

Comments

Please don't use images to display text. Images are not searchable and cannot be copied and pasted. Please update your question with a copy and paste of the text using the preformatted text (101010) button. See the support page

Asked by jayess on 2019-05-07 18:29:17 UTC

Thank you for the advice! I have updated the question.

Asked by erdanielx on 2019-05-08 04:36:12 UTC

Answers