PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.92k stars 4.61k forks source link

[Registration]ndt_omp running error #5712

Closed kitzhongzhengqi closed 1 year ago

kitzhongzhengqi commented 1 year ago

hello,my code is here,using ndtomp for registration,the error comes from ndtomp_map_->setInputTarget(cloudPointer):

pcl::PointCloud<RsPointXYZIRT> cloud;
  // Fill in the cloud data
  cloud.width    = 5;
  cloud.height   = 1;
  cloud.is_dense = false;
  cloud.resize (cloud.width * cloud.height);
  for (auto& point: cloud)
  {
    point.x = 1024 * rand () / (RAND_MAX + 1.0f);
    point.y = 1024 * rand () / (RAND_MAX + 1.0f);
    point.z = 1024 * rand () / (RAND_MAX + 1.0f);
    point.intensity = 0;
    point.ring = 0;
    point.timestamp = 0;
  }
 pcl::PointCloud < RsPointXYZIRT>::Ptr cloudPointer(new pcl::PointCloud<RsPointXYZIRT>);
 cloudPointer = cloud.makeShared();
 ndtomp_map_->setInputTarget(cloudPointer);

and the gdb output:

I0516 17:16:46.193235 1416 lidar_l10n.cpp:1924] start set localization_adapter: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = pclomp::NormalDistributionsTransform<apal_sensor_service::RsPointXYZIRT, apal_sensor_service::RsPointXYZIRT>; typename boost::detail::sp_member_access::type = pclomp::NormalDistributionsTransform<apal_sensor_service::RsPointXYZIRT, apal_sensor_service::RsPointXYZIRT>*]: Assertion `px != 0' failed.

Thread 23 "localization_ad" received signal SIGABRT, Aborted. [Switching to Thread 0x7fffa37fe700 (LWP 1416)] __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50

1 0x00007ffff42d3859 in __GI_abort () at abort.c:79

2 0x00007ffff42d3729 in __assert_fail_base (fmt=0x7ffff4469588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff6a0763c "px != 0",

file=0x7ffff6a07610 "/usr/include/boost/smart_ptr/shared_ptr.hpp", line=734, function=<optimized out>) at assert.c:92

3 0x00007ffff42e4fd6 in __GI___assert_fail (assertion=0x7ffff6a0763c "px != 0", file=0x7ffff6a07610 "/usr/include/boost/smart_ptr/shared_ptr.hpp", line=734,

function=0x7ffff6a08d80 "typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = pclomp::NormalDistributionsTransform<apal_sensor_service::RsPointXYZIRT, apal_sensor_service::RsPoi"...) at assert.c:101

4 0x00007ffff6567adb in boost::shared_ptr<pclomp::NormalDistributionsTransform<apal_sensor_service::RsPointXYZIRT, apal_sensor_service::RsPointXYZIRT> >::operator-> (this=0x7fffa400c220)

at /usr/include/boost/smart_ptr/shared_ptr.hpp:734

5 0x00007ffff653193e in LidarL10n::DynamicLoadMap (this=0x7fffa4009060) at /home/apal-robo-percp/colcon_ws/src/ros2_loc_node/apal_localization/src/l10n/src/lidar_l10n/lidar_l10n.cpp:1925

6 0x00007ffff63e9c7b in apal::localization::Localization::loadmap (this=0x7fffa4001eb0)

at /home/apal-robo-percp/colcon_ws/src/ros2_loc_node/apal_localization/src/interface/src/localization_impl.cpp:287

7 0x0000555555ac53b3 in std::invoke_impl<void, void (apal::localization::LocalizationInterface::*)(), std::shared_ptr>(std::invoke_memfun_deref, void (apal::localization::LocalizationInterface::*&&)(), std::shared_ptr&&) (f=@0x555556151d28: &virtual table offset 328, t=...)

at /usr/include/c++/9/bits/invoke.h:73

8 0x0000555555aab98d in std::__invoke<void (apal::localization::LocalizationInterface::*)(), std::shared_ptr > (

__fn=@0x555556151d28: &virtual table offset 328) at /usr/include/c++/9/bits/invoke.h:95

9 0x0000555555a8a431 in std::thread::_Invoker<std::tuple<void (apal::localization::LocalizationInterface::*)(), std::shared_ptr > >::_M_invoke<0ul, 1ul> (

this=0x555556151d18) at /usr/include/c++/9/thread:244

10 0x0000555555a09874 in std::thread::_Invoker<std::tuple<void (apal::localization::LocalizationInterface::*)(), std::shared_ptr > >::operator() (

this=0x555556151d18) at /usr/include/c++/9/thread:251

11 0x00005555559ee028 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (apal::localization::LocalizationInterface::*)(), std::shared_ptr > > >::_M_run (this=0x555556151d10) at /usr/include/c++/9/thread:195

12 0x00007ffff4706de4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

13 0x00007ffff44ab609 in start_thread (arg=) at pthread_create.c:477

14 0x00007ffff43d0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

seems to have some problem with null pointer,thanks for your help!!!

mvieth commented 1 year ago

ndt_omp (pclomp::NormalDistributionsTransform) is not an official part of PCL. Unless you get the same error with the ndt from PCL (pcl::NormalDistributionsTransform), I suggest you seek help at https://github.com/koide3/ndt_omp