I can only run for about 20 seconds on a bagged pointcloud. I ran with valgrind to help pinpoint any issues.
==388489== Thread 1:
==388489== Use of uninitialised value of size 8
==388489== at 0x1637FA: PatchWorkpp<pcl::PointXYZI>::estimate_ground(pcl::PointCloud<pcl::PointXYZI>, pcl::PointCloud<pcl::PointXYZI>&, pcl::PointCloud<pcl::PointXYZI>&, double&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x12B765: callbackCloud(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x14E891: boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&)>, void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > >) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x16870C: ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&, void>::call(ros::SubscriptionCallbackHelperCallParams&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x4D43138: ros::SubscriptionQueue::call() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4CF1171: ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4CF2882: ros::CallbackQueue::callAvailable(ros::WallDuration) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124D64: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489==
==388489== Invalid read of size 4
==388489== at 0x1637FA: PatchWorkpp<pcl::PointXYZI>::estimate_ground(pcl::PointCloud<pcl::PointXYZI>, pcl::PointCloud<pcl::PointXYZI>&, pcl::PointCloud<pcl::PointXYZI>&, double&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x12B765: callbackCloud(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x14E891: boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&)>, void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > >) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x16870C: ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&, void>::call(ros::SubscriptionCallbackHelperCallParams&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x4D43138: ros::SubscriptionQueue::call() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4CF1171: ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4CF2882: ros::CallbackQueue::callAvailable(ros::WallDuration) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124D64: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==388489==
==388489==
==388489== Process terminating with default action of signal 11 (SIGSEGV)
==388489== Access not within mapped region at address 0x0
==388489== at 0x1637FA: PatchWorkpp<pcl::PointXYZI>::estimate_ground(pcl::PointCloud<pcl::PointXYZI>, pcl::PointCloud<pcl::PointXYZI>&, pcl::PointCloud<pcl::PointXYZI>&, double&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x12B765: callbackCloud(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x14E891: boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&)>, void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > >) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x16870C: ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > > const&, void>::call(ros::SubscriptionCallbackHelperCallParams&) (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== by 0x4D43138: ros::SubscriptionQueue::call() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4CF1171: ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4CF2882: ros::CallbackQueue::callAvailable(ros::WallDuration) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124D64: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489== If you believe this happened as a result of a stack
==388489== overflow in your program's main thread (unlikely but
==388489== possible), you can try to increase the size of the
==388489== main thread stack using the --main-stacksize= flag.
==388489== The main thread stack size used in this run was 8388608.
pc2czm - 4392 / ==388489==
==388489== HEAP SUMMARY:
==388489== in use at exit: 14,689,441 bytes in 3,827 blocks
==388489== total heap usage: 230,399 allocs, 226,572 frees, 410,519,582 bytes allocated
==388489==
==388489== 140 bytes in 1 blocks are definitely lost in loss record 1,729 of 2,008
==388489== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==388489== by 0x521DF54: __libc_alloc_buffer_allocate (alloc_buffer_allocate.c:26)
==388489== by 0x52C1628: alloc_buffer_allocate (alloc_buffer.h:143)
==388489== by 0x52C1628: __resolv_conf_allocate (resolv_conf.c:411)
==388489== by 0x52BEE21: __resolv_conf_load (res_init.c:592)
==388489== by 0x52C1232: __resolv_conf_get_current (resolv_conf.c:163)
==388489== by 0x52BF3D4: __res_vinit (res_init.c:614)
==388489== by 0x52C05CF: maybe_init (resolv_context.c:122)
==388489== by 0x52C05CF: context_get (resolv_context.c:184)
==388489== by 0x52C05CF: context_get (resolv_context.c:176)
==388489== by 0x52C05CF: __resolv_context_get (resolv_context.c:195)
==388489== by 0x5283880: gaih_inet.constprop.0 (getaddrinfo.c:747)
==388489== by 0x5284F58: getaddrinfo (getaddrinfo.c:2256)
==388489== by 0x647BE76: XmlRpc::XmlRpcSocket::connect(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) (in /opt/ros/noetic/lib/libxmlrpcpp.so)
==388489== by 0x647450E: XmlRpc::XmlRpcClient::doConnect() (in /opt/ros/noetic/lib/libxmlrpcpp.so)
==388489== by 0x64743FB: XmlRpc::XmlRpcClient::setupConnection() (in /opt/ros/noetic/lib/libxmlrpcpp.so)
==388489==
==388489== 368 bytes in 1 blocks are possibly lost in loss record 1,837 of 2,008
==388489== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==388489== by 0x40149DA: allocate_dtv (dl-tls.c:286)
==388489== by 0x40149DA: _dl_allocate_tls (dl-tls.c:532)
==388489== by 0x4896322: allocate_stack (allocatestack.c:622)
==388489== by 0x4896322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==388489== by 0x64A9441: boost::thread::start_thread_noexcept() (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0)
==388489== by 0x4CDC7B7: ros::PollManager::start() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D2FE4C: ros::start() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D0273E: ros::NodeHandle::construct(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D02A12: ros::NodeHandle::NodeHandle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124A51: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489==
==388489== 368 bytes in 1 blocks are possibly lost in loss record 1,838 of 2,008
==388489== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==388489== by 0x40149DA: allocate_dtv (dl-tls.c:286)
==388489== by 0x40149DA: _dl_allocate_tls (dl-tls.c:532)
==388489== by 0x4896322: allocate_stack (allocatestack.c:622)
==388489== by 0x4896322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==388489== by 0x64A9441: boost::thread::start_thread_noexcept() (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0)
==388489== by 0x4CC55DB: ros::XMLRPCManager::start() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D2FE59: ros::start() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D0273E: ros::NodeHandle::construct(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D02A12: ros::NodeHandle::NodeHandle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124A51: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489==
==388489== 368 bytes in 1 blocks are possibly lost in loss record 1,839 of 2,008
==388489== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==388489== by 0x40149DA: allocate_dtv (dl-tls.c:286)
==388489== by 0x40149DA: _dl_allocate_tls (dl-tls.c:532)
==388489== by 0x4896322: allocate_stack (allocatestack.c:622)
==388489== by 0x4896322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==388489== by 0x64A9441: boost::thread::start_thread_noexcept() (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0)
==388489== by 0x4D2BF9E: ros::ROSOutAppender::ROSOutAppender() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D307D4: ros::start() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D0273E: ros::NodeHandle::construct(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D02A12: ros::NodeHandle::NodeHandle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124A51: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489==
==388489== 368 bytes in 1 blocks are possibly lost in loss record 1,840 of 2,008
==388489== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==388489== by 0x40149DA: allocate_dtv (dl-tls.c:286)
==388489== by 0x40149DA: _dl_allocate_tls (dl-tls.c:532)
==388489== by 0x4896322: allocate_stack (allocatestack.c:622)
==388489== by 0x4896322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==388489== by 0x64A9441: boost::thread::start_thread_noexcept() (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0)
==388489== by 0x4D33EAC: boost::thread::thread<void (&)()>(void (&)()) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D3056F: ros::start() (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D0273E: ros::NodeHandle::construct(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x4D02A12: ros::NodeHandle::NodeHandle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) (in /opt/ros/noetic/lib/libroscpp.so)
==388489== by 0x124A51: main (in catkin_ws/devel/.private/patchworkpp/lib/patchworkpp/demo)
==388489==
==388489== LEAK SUMMARY:
==388489== definitely lost: 140 bytes in 1 blocks
==388489== indirectly lost: 0 bytes in 0 blocks
==388489== possibly lost: 1,472 bytes in 4 blocks
==388489== still reachable: 14,687,829 bytes in 3,822 blocks
==388489== suppressed: 0 bytes in 0 blocks
==388489== Reachable blocks (those to which a pointer was found) are not shown.
==388489== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==388489==
==388489== Use --track-origins=yes to see where uninitialised values come from
==388489== For lists of detected and suppressed errors, rerun with: -s
==388489== ERROR SUMMARY: 669212 errors from 11 contexts (suppressed: 0 from 0)