Giter Club home page Giter Club logo

lidar_imu_calib's People

Contributors

icameling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lidar_imu_calib's Issues

What is the best moving trajectory for calibration

Thank you for your great work.
I'm going to try this calibration tool. How should I move the platform to make the trajectory and pose more suitable for calibration and make the result more accurate?
Thank you for your time a lot.

ERROR: cannot launch node of type [li_calib/li_calib_gui]

Hi,

I am trying to use clidar_IMU_calib to align my lidar and IMU, however, after building the project and loading li_calib_gui node with command: ./src/lidar_IMU_calib/calib.sh, I got following message:

... logging to /home/neousys/.ros/log/5225dbb0-3b87-11ec-a470-0028f8cacfa1/roslaunch-nuvo-jl-19945.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://nuvo-jl:37309/

SUMMARY

PARAMETERS

  • /li_calib_gui/LidarModel: VLP_16
  • /li_calib_gui/bag_durr: 30.0
  • /li_calib_gui/bag_start: 1.0
  • /li_calib_gui/ndtResolution: 0.5
  • /li_calib_gui/path_bag: /home/neousys/ros...
  • /li_calib_gui/scan4map: 15.0
  • /li_calib_gui/show_ui: False
  • /li_calib_gui/time_offset_padding: 0.015
  • /li_calib_gui/topic_imu: /imu1/raw/data_wi...
  • /li_calib_gui/topic_lidar: /velodyne_packets
  • /rosdistro: melodic
  • /rosversion: 1.14.12

NODES
/
li_calib_gui (li_calib/li_calib_gui)

auto-starting new master
process[master]: started with pid [19955]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 5225dbb0-3b87-11ec-a470-0028f8cacfa1
process[rosout-1]: started with pid [19966]
started core service [/rosout]
ERROR: cannot launch node of type [li_calib/li_calib_gui]: Cannot locate node of type [li_calib_gui] in package [li_calib]. Make sure file exists in package path and permission is set to executable (chmod +x)

Instructions typo

Just a tiny thing. There's a typo in the instructions. It should be cd lidar_imu_calib, not cd lidar_imu_calib_beta.

Thanks for open sourcing!

build wrong in debug mode

hi, @icameling , when i build the code in debug mode by change set(CMAKE_BUILD_TYPE "DEBUG"), then build with some error:

/home/xxx/catkin_dev/src/lidar_IMU_calib/include/utils/dataset_reader.h: In member function ‘void licalib::IO::LioDataset::adjustDataset()’:
/home/xxx/catkin_dev/src/lidar_IMU_calib/include/utils/dataset_reader.h:180:12: error: ‘imu_data’ was not declared in this scope
     assert(imu_data.size() > 0 && "No IMU data. Check your bag and imu topic");
            ^
/home/xxx/catkin_dev/src/lidar_IMU_calib/include/utils/dataset_reader.h:181:12: error: ‘scan_data’ was not declared in this scope
     assert(scan_data.size() > 0 && "No scan data. Check your bag and lidar topic");
            ^
/home/xxx/catkin_dev/src/lidar_IMU_calib/include/utils/dataset_reader.h:183:12: error: ‘scan_timestamps’ was not declared in this scope
     assert(scan_timestamps.front() < imu_data.back().timestamp

The variable imu_data , scan_data and scan_timestamps was not declared in this scope, i am confused why it can build successful in release mode

作者,您好,有个问题请教一下

想问一下这个函数的作用:TrajectoryManager::evaluateLidarPose(),包括这里的q_LtoG变量和p_LinG变量的含义,还有result->orientation的含义,感谢,都来自于下面的代码里
bool TrajectoryManager::evaluateLidarPose(double lidar_time,
Eigen::Quaterniond &q_LtoG,
Eigen::Vector3d &p_LinG) const {
double traj_time = lidar_time + lidar_->time_offset();
if (traj_->MinTime() > traj_time || traj_->MaxTime() <= traj_time)
return false;
Result result = traj_->Evaluate( traj_time, EvalOrientation | EvalPosition);
q_LtoG = result->orientation * calib_param_manager->q_LtoI;
p_LinG = result->orientation * calib_param_manager->p_LinI + result->position;
return true;
}

Is this algorithm suitable for unmanned vehicle platform?

Initialization failed, because conv (2) is smaller than 0.25. Those are what I got in the initialization phase:
cov() 0.188305 0.187903 0.0202252 0.00665783
cov() 0.220604 0.22034 0.0221111 0.00756393
cov() 0.233234 0.232986 0.0222588 0.00762748
cov() 0.235271 0.235019 0.0224777 0.00770385
cov() 0.235397 0.23508 0.0236421 0.00800224

What's the problem with that? Is it because IMU is not fully motivated?

is there any reference for vlp_common.h?

thx for your transcendent work!

but i don't konw the following concept, is there any paper or document ?

  1. float vert_correction[16] // is it the tan of corresponding scan_mapping_16[]?

  2. there 're two void unpack_scan() reload in VelodyneCorrection,is velodyne_msgs::VelodyneScan::ConstPtr more accurate than sensor_msgs::PointCloud2::ConstPtr ?

thanks you so much!

结果求出来啦!如何填写进yaml呢!

image
mapping:
acc_cov: 0.208587
gyr_cov: 0.97676
b_acc_cov: 0.00314634
b_gyr_cov: 0.0492061
fov_degree: 180
det_range: 100.0
extrinsic_est_en: false # true: enable the online estimation of IMU-LiDAR extrinsic,
extrinsic_T: [ 0.576033,-0.134497,0.19392]
extrinsic_R: [7.36366,0.434608,-6.43675,
0.000291061,2.85E-05,4.55E-05,
0.38544,-0.453856,0.00630897]

按照作者的程序,标定结果如下,但是我真的不专业,只不过是个测绘技术人员,现在把这个数据写进yaml一起上传,麻烦您看掌掌眼!指导一下!

Interface Xsens with Lidar

Hello guys,

do you have any diagram in which you are explain how did you connect everything?What converters did you use etc.

Thanks in advance.

process died exit code -11 with default bag files.

Hi,
I am using ros noetic. I setup the whole thing and was trying to run with your given dataset "Garage-01.bag".

Still i am getting error-

Load dataset from /opt/src/Garage-01.bag
/velodyne_packets: 298
/imu1/data_sync: 12001
[li_calib_gui-2] process has died [pid 5367, exit code -11, cmd /opt/catkin_ws/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/root/.ros/log/01f29ad4-0201-11ed-86a7-0242ac110002/li_calib_gui-2.log].
log file: /root/.ros/log/01f29ad4-0201-11ed-86a7-0242ac110002/li_calib_gui-2*.log

^C[rosout-1] killing on exit

No idea what is the issue.
Any suggestion?
Thanks.

ndt_omp_ = ndtInit(ndt_resolution); core dumped

image
[li_calib_gui-2] process has died [pid 2414, exit code -6, cmd /home/ubuntu/catkin_LtoI/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/ubuntu/.ros/log/1b21c2be-25a3-11eb-bf5b-00163e4b6f10/li_calib_gui-2.log].
log file: /home/ubuntu/.ros/log/1b21c2be-25a3-11eb-bf5b-00163e4b6f10/li_calib_gui-2*.log

There are some problem in Ubuntu 20.04

Hi guys, firstly thanks for your generosity.
I followed your tips, and finishing catkin_make the program well. However, when running the program, the terminal shows Load dataset from /home/peng/catkin_li_calib/bag/Garage-01.bag /velodyne_packets: 298 /imu1/data_sync: 12001 [li_calib_gui-2] process has died [pid 13222, exit code -11, cmd /home/peng/catkin_li_calib/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/peng/.ros/log/e4d4be00-2b23-11ec-a65d-c7a458efd3d2/li_calib_gui-2.log]. log file: /home/peng/.ros/log/e4d4be00-2b23-11ec-a65d-c7a458efd3d2/li_calib_gui-2*.log
Then I use gdb to find the problem. The gdb shows like this:
`[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe1038700 (LWP 7384)]
[New Thread 0x7fffe0837700 (LWP 7385)]
[New Thread 0x7fffdbfff700 (LWP 7386)]
[New Thread 0x7fffdb7fe700 (LWP 7387)]

Load dataset from /home/peng/catkin_li_calib/bag/Garage-01.bag
/velodyne_packets: 298
/imu1/data_sync: 12001
--Type for more, q to quit, c to continue without paging--c

Thread 1 "li_calib_gui" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) where
#0 0x0000000000000000 in ()
#1 0x00005555555ad0dd in licalib::IO::LioDataset::read(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, double, double) ()
#2 0x000055555558ea9c in licalib::CalibrHelper::CalibrHelper(ros::NodeHandle&)
()
#3 0x00005555555af67d in CalibInterface::CalibInterface(ros::NodeHandle&) ()
#4 0x0000555555585548 in main ()

`
I have no idea where is wrong. Could you help me find it.

Using livox mid-70

I encounter the following error when I try to calibrate my livox-mid70 with handsfree imu

===========================================================================

ubuntu@ubuntu-desktop:~/ws_livox$ ./src/lidar_IMU_calib/calib.sh
topic_imu:=/handsfree/imu
path_bag:=/home/ubuntu/lidar_imu/test1.bag
ndtResolution:=0.5

... logging to /home/ubuntu/.ros/log/14cbd238-2660-11ec-b544-00044bde7cf1/roslaunch-ubuntu-desktop-8159.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu-desktop:44951/

SUMMARY

PARAMETERS

  • /li_calib_gui/LidarModel: livox_mid70
  • /li_calib_gui/bag_durr: 30.0
  • /li_calib_gui/bag_start: 1.0
  • /li_calib_gui/ndtResolution: 0.5
  • /li_calib_gui/path_bag: /home/ubuntu/lida...
  • /li_calib_gui/scan4map: 15.0
  • /li_calib_gui/show_ui: True
  • /li_calib_gui/time_offset_padding: 0.015
  • /li_calib_gui/topic_imu: /handsfree/imu
  • /li_calib_gui/topic_lidar: /livox/lidar
  • /rosdistro: melodic
  • /rosversion: 1.14.11

NODES
/
li_calib_gui (li_calib/li_calib_gui)

ROS_MASTER_URI=http://localhost:11311

process[li_calib_gui-1]: started with pid [8178]
[ WARN] [1633502308.162116800]: LiDAR model livox_mid70 not support yet.

Load dataset from /home/ubuntu/lidar_imu/test1.bag
terminate called after throwing an instance of 'pcl::IsNotDenseException'
what(): : Can't use 2D indexing with a unorganized point cloud
[li_calib_gui-1] process has died [pid 8178, exit code -6, cmd /home/ubuntu/ws_livox/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/ubuntu/.ros/log/14cbd238-2660-11ec-b544-00044bde7cf1/li_calib_gui-1.log].
log file: /home/ubuntu/.ros/log/14cbd238-2660-11ec-b544-00044bde7cf1/li_calib_gui-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
ubuntu@ubuntu-desktop:~/ws_livox$

===========================================================================================

What changes can I make to support the lidar livox mid-70? Thanks!

when i run with my data(vel_16), there is an error

Load dataset from /home/z/Downloads/t3.bag
terminate called after throwing an instance of 'pcl::IsNotDenseException'
what(): : Can't use 2D indexing with a unorganized point cloud
[li_calib_gui-1] process has died [pid 1492, exit code -6, cmd /home/z/catkin_li_calib/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/z/.ros/log/ed42ec02-4699-11eb-89f8-80e82cca7b75/li_calib_gui-1.log].
log file: /home/z/.ros/log/ed42ec02-4699-11eb-89f8-80e82cca7b75/li_calib_gui-1*.log

Is it suitable for ground vehicle calibration?

Hi,

Suppose a vehicle has a LiDAR and a IMU that has 90 degree rotation in YAW only, what part of the extrinsic can we calibrate here? Is there a bag similar to this scenario?

Thanks for trying to help!

Understanding undistortion of pointcloud

First of all, thanks for this awesome open source package.

void undistort(const Eigen::Quaterniond& q_G_to_target,
const Eigen::Vector3d& p_target_in_G,
const TPointCloud& scan_raw,
const VPointCloud::Ptr& scan_in_target,
bool correct_position = false) const {
scan_in_target->header = scan_raw.header;
scan_in_target->height = scan_raw.height;
scan_in_target->width = scan_raw.width;
scan_in_target->resize(scan_raw.height * scan_raw.width);
scan_in_target->is_dense = false;
VPoint NanPoint;
NanPoint.x = NAN; NanPoint.y = NAN; NanPoint.z = NAN;
for (int h = 0; h < scan_raw.height; h++) {
for (int w = 0; w < scan_raw.width; w++) {
VPoint vpoint;
if (pcl_isnan(scan_raw.at(w,h).x)) {
vpoint = NanPoint;
scan_in_target->at(w,h) = vpoint;
continue;
}
double point_timestamp = scan_raw.at(w,h).timestamp;
Eigen::Quaterniond q_Lk_to_G;
Eigen::Vector3d p_Lk_in_G;
if (!traj_manager_->evaluateLidarPose(point_timestamp, q_Lk_to_G, p_Lk_in_G)) {
continue;
}
Eigen::Quaterniond q_LktoL0 = q_G_to_target * q_Lk_to_G;
Eigen::Vector3d p_Lk(scan_raw.at(w,h).x, scan_raw.at(w,h).y, scan_raw.at(w,h).z);
Eigen::Vector3d point_out;
if (!correct_position) {
point_out = q_LktoL0 * p_Lk;
} else {
point_out = q_LktoL0 * p_Lk + q_G_to_target * (p_Lk_in_G - p_target_in_G);
}
vpoint.x = point_out(0);
vpoint.y = point_out(1);
vpoint.z = point_out(2);
vpoint.intensity = scan_raw.at(w,h).intensity;
scan_in_target->at(w,h) = vpoint;
}
}
}
TrajectoryManager::Ptr traj_manager_;
std::shared_ptr<IO::LioDataset> dataset_reader_;
std::map<pcl::uint64_t, VPointCloud::Ptr> scan_data_;
std::map<pcl::uint64_t, VPointCloud::Ptr> scan_data_in_map_;
VPointCloud::Ptr map_cloud_;
};

I am trying to understand the cloud un-distortion process referenced above. It looks like, in the code you iterate through the entire point cloud in order to deskew it. Basically, you obtain the time stamp of each point and try to determine the IMU pose associated with it and then using the best estimate of the extrinsic calibration you deskew the point cloud. This is what I understand, please correct me if I am wrong.

My question is, doesn't it make the system very slow when you iterate through the entire point cloud? For instance, I am using a 128 channel lidar with 200,000 points and when I try to iterate through the entire pointcloud, it really takes a long time. Please let me know what you think about it and suggest me some ways in which I can undistort faster.

Thanks!

Pangolin Build Error

Hi @icameling !
Thank you for your team's excellent work! I followed the instructions to build the project, when I came to the following steps:

# Pangolin
cd lidar_imu_calib_beta
./build_submodules.sh

I couldn't find the lidar_imu_calib_beta folder. Alternatively, I executed the ./lidar_imu_calib/build_submodules.sh and encountered the following error:

/usr/bin/ld: warning: found local symbol '__bss_start' in global part of symbol table in file /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libGL.so
/usr/bin/ld: warning: found local symbol '_end' in global part of symbol table in file /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libGL.so
/usr/bin/ld: warning: found local symbol '_edata' in global part of symbol table in file /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libGL.so
/usr/bin/ld: error: can't create dynamic relocation R_X86_64_TLSLD against symbol: guard variable for pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: guard variable for pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_TLSLD against symbol: guard variable for pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_TLSLD against symbol: guard variable for pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: pangolin::GlSlUtilities::Instance()::instance in readonly segment; recompile object files with -fPIC
>>> defined in CMakeFiles/pangolin.dir/display/image_view.cpp.o
>>> referenced by image_view.cpp
>>>               CMakeFiles/pangolin.dir/display/image_view.cpp.o:(pangolin::ImageView::Render())

/usr/bin/ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
collect2: error: ld returned 1 exit status
src/CMakeFiles/pangolin.dir/build.make:2774: recipe for target 'src/libpangolin.so' failed
make[2]: *** [src/libpangolin.so] Error 1
CMakeFiles/Makefile2:139: recipe for target 'src/CMakeFiles/pangolin.dir/all' failed
make[1]: *** [src/CMakeFiles/pangolin.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I browsed to see if there were any solutions to this error but failed. It means so much if you could help me with this.

Best wishes.

ceres fails to run well with imu data

I try to use my data with HDL32E and SBG Ellipse-A (6 axis). The only thing i change is data import and scan undistortion.

Everything is good before TrajectoryManager::trajInitFromSurfel ,include EstimateRotation() and undistortScanInMap with NDT odom pose.I got a nice map but not sharp enough.

Screenshot from 2020-10-17 11-49-24

And i got 500 surfels,but when i added addGyroscopeMeasurementst() or addAccelerometerMeasurement() into ceres by TrajectoryManager::trajInitFromSurfel(),the map would mess up(laser pose was totally calculate by Bspline, addSurfMeasurement is ok).
And ceres log like following.

WARNING: Logging before InitGoogleLogging() is written to STDERR W20201017 20:57:45.519047 11140 levenberg_marquardt_strategy.cc:114] Linear solver failure. Failed to compute a step: CHOLMOD warning: Matrix not positive definite.

Screenshot from 2020-10-17 11-59-44

Is it any problem with my imu data? and how can i solve it?

Ubuntu 20.04 issues

1.src/ndt_omp CMakeLists.txt
-std=c++14
PCL 1.10

2.src/lidar_IMU_calib/include/utils/dataset_reader.h
bool read(const std::string pat...) ->void read(const std::string pat...)

3.src/lidar_IMU_calib/thirdparty/Kontiki/include/kontiki/sensors/constant_bias_imu.h
bool LockGyroscopeBias(bool lock) ->void LockGyroscopeBias(bool lock)
bool LockAccelerometerBias(bool lock) -> void LockAccelerometerBias(bool lock)

I have an error. can you help me? thank you

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::create_directory: Not a directory: "/home/zDownloads/out_bag/t11.bag/Garage-01"
[li_calib_gui-1] process has died [pid 30504, exit code -6, cmd /home/z/catkin_li_calib/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/z/.ros/log/ed42ec02-4699-11eb-89f8-80e82cca7b75/li_calib_gui-1.log].
log file: /home/z/.ros/log/ed42ec02-4699-11eb-89f8-80e82cca7b75/li_calib_gui-1*.log
all processes on machine have died, roslaunch will exit

run initialization crush

hi, @icameling , thanks for your great work, when i run the code, when i click initializaiton on licalib_gui, it happens to a crush, could you help me to fix it out?

Load dataset from /home/XXX/data/test_data/LI-calib/Garage-01.bag
/velodyne_packets: 298
/imu1/data_sync: 12001
Ceres Solver Report: Iterations: 12, Initial cost: 1.179723e+07, Final cost: 1.305846e+02, Termination: CONVERGENCE
[li_calib_gui-2] process has died [pid 9979, exit code -11, cmd /home/XXX/catkin_dev/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/XXX/.ros/log/8ce0d29e-a3e0-11eb-9107-6c4b9090a754/li_calib_gui-2.log].
log file: /home/XXX/.ros/log/8ce0d29e-a3e0-11eb-9107-6c4b9090a754/li_calib_gui-2*.log
^C[rosout-1] killing on exit

my env is ubuntu 16.04, the bug happened in the following code

ndt_omp_->setInputTarget(map_cloud_);

the following is my cpu:
Screenshot from 2021-04-23 11-41-04
The moment when crush, the cpu come to max

Initialization fails.

Ceres Solver Report: Iterations: 14, Initial cost: 3.073979e+02, Final cost: 7.853994e-18, Termination: CONVERGENCE
[ WARN] [1606536377.199574253]: [Initialization] fails.
Ceres Solver Report: Iterations: 2, Initial cost: 7.994445e-18, Final cost: 7.422366e-18, Termination: CONVERGENCE
[ WARN] [1606536390.827585457]: [Initialization] fails.
Ceres Solver Report: Iterations: 2, Initial cost: 7.709791e-18, Final cost: 7.606703e-18, Termination: CONVERGENCE
[ WARN] [1606536418.308922434]: [Initialization] fails.
Ceres Solver Report: Iterations: 2, Initial cost: 7.761621e-18, Final cost: 7.714067e-18, Termination: CONVERGENCE
[ WARN] [1606536496.896175485]: [Initialization] fails.
Ceres Solver Report: Iterations: 2, Initial cost: 7.816852e-18, Final cost: 7.785927e-18, Termination: CONVERGENCE
[ WARN] [1606536581.424251185]: [Initialization] fails.
Ceres Solver Report: Iterations: 2, Initial cost: 7.862062e-18, Final cost: 7.837863e-18, Termination: CONVERGENCE
[ WARN] [1606536670.097768013]: [Initialization] fails.

What is the proper scene for the LiDAR-IMU calibration on a CAR?

Thank you so much for the great open-source.
Can you please suggest to me the proper scene for the two sensors that are mounted on a CAR?
It's not easy to fulfill the requirement: at least two rotations about different axes are necessary. Have you ever calibrated LiDAR-IMU on the CAR?

a bug need to fix

bool read(const std::string path,
            const std::string imu_topic,
            const std::string lidar_topic,
            const double bag_start = -1.0,
            const double bag_durr = -1.0) {

    data_.reset(new LioDataset(lidar_model_));
    data_->bag_.reset(new rosbag::Bag);
    data_->bag_->open(path, rosbag::bagmode::Read);

    init();

    rosbag::View view;
    {
      std::vector<std::string> topics;
      topics.push_back(imu_topic);
      topics.push_back(lidar_topic);

      rosbag::View view_full;
      view_full.addQuery(*data_->bag_);
      ros::Time time_init = view_full.getBeginTime();
      time_init += ros::Duration(bag_start);
      ros::Time time_finish = (bag_durr < 0)?
                              view_full.getEndTime() : time_init + ros::Duration(bag_durr);
      view.addQuery(*data_->bag_, rosbag::TopicQuery(topics), time_init, time_finish);
    }
    for (rosbag::MessageInstance const m : view) {
      const std::string &topic = m.getTopic();

      if (lidar_topic == topic) {
        TPointCloud pointCloudPtr;
        double timestamp = 0;
        std::cout << "find lidar topic data type " << m.getDataType() << std::endl;
        if (m.getDataType() == std::string("velodyne_msgs/VelodyneScan")) {
          velodyne_msgs::VelodyneScan::ConstPtr vlp_msg =
                  m.instantiate<velodyne_msgs::VelodyneScan>();
          timestamp = vlp_msg->header.stamp.toSec();
          p_VelodyneLidarConvert_->unpack_scan(vlp_msg, pointCloudPtr);
          std::cout << "velodyne_msgs/VelodyneScan" << std::endl;
        }
        if (m.getDataType() == std::string("sensor_msgs/PointCloud2")) {
          sensor_msgs::PointCloud2::ConstPtr scan_msg =
                  m.instantiate<sensor_msgs::PointCloud2>();
          timestamp = scan_msg->header.stamp.toSec();
          p_VelodyneLidarConvert_->unpack_scan(scan_msg, pointCloudPtr);
          std::cout << "add sensor_msgs/PointCloud2" << std::endl;
        }
        if(m.getDataType() == std::string("livox_ros_driver/CustomMsg")) {
          li_calib::LivoxPointCloud ::ConstPtr scan_msg =
                  m.instantiate<li_calib::LivoxPointCloud>();
          timestamp = scan_msg->header.stamp.toSec();
          p_LivoxLidarConvert_->unpack_scan(scan_msg, pointCloudPtr);

          std::cout << "scan_msg header stamp: "<< scan_msg->header.stamp << std::endl;
          std::cout << "scan msg header frame id: " << scan_msg->header.frame_id << std::endl;
          std::cout << "scan msg point num: " << scan_msg->point_num << std::endl;
          std::cout << "scan msg point size: " << scan_msg->points.size() << std::endl;
          std::cout << "add livox_ros_driver/CustomMsg" << std::endl;
        }

        data_->scan_data_.emplace_back(pointCloudPtr);
        data_->scan_timestamps_.emplace_back(timestamp);
      }

      if (imu_topic == topic) {
        sensor_msgs::ImuConstPtr imu_msg = m.instantiate<sensor_msgs::Imu>();
        double time = imu_msg->header.stamp.toSec();
        data_->imu_data_.emplace_back();
        data_->imu_data_.back().timestamp = time;
        data_->imu_data_.back().accel = Eigen::Vector3d(
                imu_msg->linear_acceleration.x, imu_msg->linear_acceleration.y,
                imu_msg->linear_acceleration.z);
        data_->imu_data_.back().gyro = Eigen::Vector3d(
                imu_msg->angular_velocity.x, imu_msg->angular_velocity.y,
                imu_msg->angular_velocity.z);
      }
    }

    std::cout << lidar_topic << ": " << data_->scan_data_.size() << std::endl;
    std::cout << imu_topic << ": " << data_->imu_data_.size() << std::endl;

    return true;
  }

this function must return.

运行时遇到的错误

录制rosbag后运行,终端提示如下错误:
Load dataset from /home/go/test.bag
/velodyne_packets: 793
/imu/data: 31998
[li_calib_gui-2] process has died [pid 128526, exit code -11, cmd /home/go/zheda_lidar_imu_cailb/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/go/.ros/log/ded989d8-a9cf-11ec-a92c-0942836b3eb8/li_calib_gui-2.log].
log file: /home/go/.ros/log/ded989d8-a9cf-11ec-a92c-0942836b3eb8/li_calib_gui-2*.log
不知道出错的原因

How to make /imu/data_sync data?

@icameling
Thanks for your great work!
I have some questions about this tool with the Custom ROS bag file.

I have only topics named /velodyne_points and imu/data.
Is this algorithm works with these topics without imu/data_sync?

If not, How to make imu/data_sync topic?
I'd appreciate your help.

Thanks,

Understanding the Undistortion Process

First of all, thanks for this awesome open source package.

void undistort(const Eigen::Quaterniond& q_G_to_target,
const Eigen::Vector3d& p_target_in_G,
const TPointCloud& scan_raw,
const VPointCloud::Ptr& scan_in_target,
bool correct_position = false) const {
scan_in_target->header = scan_raw.header;
scan_in_target->height = scan_raw.height;
scan_in_target->width = scan_raw.width;
scan_in_target->resize(scan_raw.height * scan_raw.width);
scan_in_target->is_dense = false;
VPoint NanPoint;
NanPoint.x = NAN; NanPoint.y = NAN; NanPoint.z = NAN;
for (int h = 0; h < scan_raw.height; h++) {
for (int w = 0; w < scan_raw.width; w++) {
VPoint vpoint;
if (pcl_isnan(scan_raw.at(w,h).x)) {
vpoint = NanPoint;
scan_in_target->at(w,h) = vpoint;
continue;
}
double point_timestamp = scan_raw.at(w,h).timestamp;
Eigen::Quaterniond q_Lk_to_G;
Eigen::Vector3d p_Lk_in_G;
if (!traj_manager_->evaluateLidarPose(point_timestamp, q_Lk_to_G, p_Lk_in_G)) {
continue;
}
Eigen::Quaterniond q_LktoL0 = q_G_to_target * q_Lk_to_G;
Eigen::Vector3d p_Lk(scan_raw.at(w,h).x, scan_raw.at(w,h).y, scan_raw.at(w,h).z);
Eigen::Vector3d point_out;
if (!correct_position) {
point_out = q_LktoL0 * p_Lk;
} else {
point_out = q_LktoL0 * p_Lk + q_G_to_target * (p_Lk_in_G - p_target_in_G);
}
vpoint.x = point_out(0);
vpoint.y = point_out(1);
vpoint.z = point_out(2);
vpoint.intensity = scan_raw.at(w,h).intensity;
scan_in_target->at(w,h) = vpoint;
}
}
}
TrajectoryManager::Ptr traj_manager_;
std::shared_ptr<IO::LioDataset> dataset_reader_;
std::map<pcl::uint64_t, VPointCloud::Ptr> scan_data_;
std::map<pcl::uint64_t, VPointCloud::Ptr> scan_data_in_map_;
VPointCloud::Ptr map_cloud_;
};

I am trying to understand the cloud un-distortion process referenced above. It looks like, in the code you iterate through the entire point cloud in order to deskew it. Basically, you obtain the time stamp of each point and try to determine the IMU pose associated with it and then using the best estimate of the extrinsic calibration you deskew the point cloud. This is what I understand, please correct me if I am wrong.

My question is, doesn't it make the system very slow when you iterate through the entire point cloud? For instance, I am using a 128 channel lidar with 200,000 points and when I try to iterate through the entire pointcloud, it really takes a long time. Please let me know what you think about it and suggest me some ways in which I can undistort faster.

Thanks!

Reference frame of generated IMU-centric spline trajectories

Hello,

I have used li_calib to calibrate individual LiDAR-IMU pairs on my robotic platform successfully.
However, the sensor configuration I work with features multiple LiDAR sensors (all of them VLP-16 models, compatible with the provided software implementation). I have developed a simple method to interpolate these trajectories at some given timestamps (for visualization and debugging purposes), and I have come across a doubt while doing that.

If we assume that we are using a system with two LiDARs, L1 and L2, and a common IMU, I1, we could generate two IMU-centric trajectories: one through the L1-I1 pair calibration, and another one through the L2-I1 calibration. Then, in li_calib's paper, at the end of section III - Trajectory Representation and Notation, below Equations 6 and 7, one can find the following claim:
[...] As described in the above equations, we set the first IMU frame{I0} as the reference frame for the IMU trajectory, [...]
Thus, I would expect that, given the same set of IMU data (from I1), both LiDAR-IMU trajectories should share a common origin / reference frame. Furthermore, were the LiDAR-IMU calibrations an exact representation of the physical system, the two trajectories would overlap on top of each other.

xyz_trajectories
rpy_trajectories
These plots have been generated using evo (https://github.com/MichaelGrupp/evo)

However, as you can see in the images above, the origin pose of the trajectories produced by the L1-I1 and L2-I1 is not the same. The fact that the trajectories' shape does not coincide is (at least partially) explained by the fact that the L2-I1 calibration in this run was not accurate.

Could you please help me understand if my assumptions are correct? In case they are not, how can I indicate to the TrajectoryEstimator that there is a common sensor (in this case, I1) to constrain the trajectory estimation?

Thank you for your time.

How to use my own data?

Thanks for your good job. But I have some questions about how to use my own data. My lidar device is RoboSense Lidar-16. and there is a error:

Load dataset from /home/qian/rosbag/lidarimu0903.bag
/rslidar_packets: 300
/imu/data: 5999
[li_calib_gui-2] process has died [pid 2424, exit code -11, cmd /home/qian/catkin_li_calib/devel/lib/li_calib/li_calib_gui __name:=li_calib_gui __log:=/home/qian/.ros/log/1caebfe4-ecf3-11ea-b9b2-244bfe93b8c4/li_calib_gui-2.log].
log file: /home/qian/.ros/log/1caebfe4-ecf3-11ea-b9b2-244bfe93b8c4/li_calib_gui-2*.log

Initialization probelm

Hi, thank you for the excellent work. I am learning the codes recently, but I have a question. when I modify the q0 to Quaternion::Identity,
solve failed.
`Parameter Block 0, size: 4

       0 |         -nan 
       0 |         -nan 
       0 |         -nan 
       1 |         -nan 

Parameter Block 1, size: 4

       0 |         -nan 
       0 |         -nan 
       0 |         -nan 
       1 |         -nan 

Parameter Block 2, size: 4

       0 |         -nan 
       0 |         -nan 
       0 |         -nan 
       1 |         -nan 

Parameter Block 3, size: 4

       0 |         -nan 
       0 |         -nan 
       0 |         -nan 
       1 |         -nan`

Could you please explain this problem? Thx.

Build Error

There is an error when i was trying to build this project :

[ 55%] Linking CXX shared library /home/lovebc/workspace/ros/slam_simulation_ws/devel/lib/libli_calib_lib.so
/usr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libgflags.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
slam_simulation/lidar_IMU_calib-master/CMakeFiles/li_calib_lib.dir/build.make:630: recipe for target '/home/lovebc/workspace/ros/slam_simulation_ws/devel/lib/libli_calib_lib.so' failed
make[2]: *** [/home/lovebc/workspace/ros/slam_simulation_ws/devel/lib/libli_calib_lib.so] Error 1
CMakeFiles/Makefile2:2889: recipe for target 'slam_simulation/lidar_IMU_calib-master/CMakeFiles/li_calib_lib.dir/all' failed
make[1]: *** [slam_simulation/lidar_IMU_calib-master/CMakeFiles/li_calib_lib.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

I tried with compile option -fPIC,but it didn't work, so I just build static library, will that be a problem?

And by the way, I suggest you could point out that ndt_omp should be your version,
instead of https://github.com/koide3/ndt_omp.

Thanks for your help in advance!

RS_LiDAR rewrite problems and Initialization failed

Based on authors suggets and rs_16 manual, I have rewritten vlp_common.h as follows:

`void unpack_scan_rs(const rslidar_msgs::rslidarScan::ConstPtr &lidarMsg, TPointCloud &outPointCloud) const{
outPointCloud.clear();
outPointCloud.header = pcl_conversions::toPCL(lidarMsg->header);
if (m_modelType == ModelType::RS_16) {
outPointCloud.height = 16;
outPointCloud.width = 24*(int)lidarMsg->packets.size();
outPointCloud.is_dense = false;
outPointCloud.resize(outPointCloud.height * outPointCloud.width);
}

int block_counter = 0;

double scan_timestamp = lidarMsg->header.stamp.toSec();

for (size_t i = 0; i < lidarMsg->packets.size(); ++i) {
  float azimuth;
  float azimuth_diff;
  float last_azimuth_diff=0;
  float azimuth_corrected_f;
  int azimuth_corrected;
  float x, y, z;

  const raw_packet_t *raw = (const raw_packet_t *) &lidarMsg->packets[i].data[0];

  for (int block = 0; block < BLOCKS_PER_PACKET; block++, block_counter++) {
    // Calculate difference between current and next block's azimuth angle.
    azimuth = (float)(raw->blocks[block].rotation);

    if (block < (BLOCKS_PER_PACKET-1)){
      azimuth_diff = (float)((36000 + raw->blocks[block+1].rotation - raw->blocks[block].rotation)%36000);
      last_azimuth_diff = azimuth_diff;
    }
    else {
      azimuth_diff = last_azimuth_diff; //11th and 0th
    }

    for (int firing=0, k=0; firing < FIRINGS_PER_BLOCK; firing++) {
      for (int dsr=0; dsr < SCANS_PER_FIRING; dsr++, k += RAW_SCAN_SIZE) {

        /** Position Calculation */
        union two_bytes tmp;
        tmp.bytes[0] = raw->blocks[block].data[k];
        tmp.bytes[1] = raw->blocks[block].data[k+1];

        /** correct for the laser rotation as a function of timing during the firings **/
        azimuth_corrected_f = azimuth + (azimuth_diff * ((dsr*DSR_TOFFSET) + (firing*FIRING_TOFFSET)) / BLOCK_TDURATION);
        azimuth_corrected = ((int)round(azimuth_corrected_f)) % 36000;

        /*condition added to avoid calculating points which are not
      in the interesting defined area (min_angle < area < max_angle)*/
        if ((azimuth_corrected >= m_config.min_angle
             && azimuth_corrected <= m_config.max_angle
             && m_config.min_angle < m_config.max_angle)
            || (m_config.min_angle > m_config.max_angle
                && (azimuth_corrected <= m_config.max_angle
                    || azimuth_corrected >= m_config.min_angle))) {
          // convert polar coordinates to Euclidean XYZ
          float distance = tmp.uint * DISTANCE_RESOLUTION;

          float cos_vert_angle = cos_vert_angle_[dsr];
          float sin_vert_angle = sin_vert_angle_[dsr];

          float cos_rot_angle = cos_rot_table_[azimuth_corrected];
          float sin_rot_angle = sin_rot_table_[azimuth_corrected];

          x = distance * cos_vert_angle * sin_rot_angle;
          y = distance * cos_vert_angle * cos_rot_angle;
          z = distance * sin_vert_angle;

          /** Use standard ROS coordinate system (right-hand rule) */
          float x_coord = y;
          float y_coord = -x;
          float z_coord = z;

          float intensity = raw->blocks[block].data[k+2];  // 反射率
          double point_timestamp = scan_timestamp + getExactTime(scan_mapping_16[dsr], 2*block_counter+firing);

          TPoint point;
          point.timestamp = point_timestamp;
          if (pointInRange(distance)) {
            point.x = x_coord;
            point.y = y_coord;
            point.z = z_coord;
            point.intensity = intensity;
          } else {
            point.x = NAN;
            point.y = NAN;
            point.z = NAN;
            point.intensity = 0;
          }
          if(m_modelType == ModelType::RS_16)
            outPointCloud.at(2*block_counter+firing, scan_mapping_16[dsr]) = point;
        }
      }
    }
  }
}

}`

`private:
void setParameters(ModelType modelType) {
m_modelType = modelType;
m_config.max_range = 200;
m_config.min_range = 0.2;
m_config.min_angle = 0;
m_config.max_angle = 36000;
// Set up cached values for sin and cos of all the possible headings
for (uint16_t rot_index = 0; rot_index < ROTATION_MAX_UNITS; ++rot_index) {
float rotation = angles::from_degrees(ROTATION_RESOLUTION * rot_index);
cos_rot_table_[rot_index] = cosf(rotation);
sin_rot_table_[rot_index] = sinf(rotation);
}

//finished
//MSOP packet has 12 blocks, each block has 2 groups of 16-line LiDAR data
if (modelType == RS_16) {
  FIRINGS_PER_BLOCK =   2;
  SCANS_PER_FIRING  =  16;
  BLOCK_TDURATION   = 100.0f;   // [µs]
  DSR_TOFFSET       =   3.0f;   // [µs]
  FIRING_TOFFSET    =  50.0f;   // [µs]
  PACKET_TIME = (BLOCKS_PER_PACKET*2*FIRING_TOFFSET);

  //Not_finished
  float vert_correction[16] = {
         -0.2617993877991494,//1
         -0.22689280275926285,//2
         -0.19198621771937624,//3
         -0.15707963267948966,
         -0.12217304763960307,
         -0.08726646259971647,
         -0.05235987755982989,
         -0.017453292519943295,
          0.2617993877991494,//9
         0.22689280275926285,
         0.19198621771937624,
         0.15707963267948966,
         0.12217304763960307,
         0.08726646259971647,
         0.05235987755982989,
         0.017453292519943295,
  };
  for(int i = 0; i < 16; i++) {
    cos_vert_angle_[i] = std::cos(vert_correction[i]);
    sin_vert_angle_[i] = std::sin(vert_correction[i]);
  }
  scan_mapping_16[0]=0;
  scan_mapping_16[1]=1;
  scan_mapping_16[2]=2;
  scan_mapping_16[3]=3;
  scan_mapping_16[4]=4;
  scan_mapping_16[5]=5;
  scan_mapping_16[6]=6;
  scan_mapping_16[7]=7;
  scan_mapping_16[8]=8;
  scan_mapping_16[9]=9;
  scan_mapping_16[10]=10;
  scan_mapping_16[11]=11;
  scan_mapping_16[12]=12;
  scan_mapping_16[13]=13;
  scan_mapping_16[14]=14;
  scan_mapping_16[15]=15;

  for(unsigned int w = 0; w < 1824; w++) {
    for(unsigned int h = 0; h < 16; h++) {
      mVLP16TimeBlock[w][h] = h * 3 * 1e-6 + w * 50 * 1e-6; 
    }
  }
}

}`

And the code runs with some problems. I don't know whether caused by my wrong code or other kind of things.
In Initialization, after optimization with data collected from a car platform, the terminal shows
[pcl::VoxelGrid::applyFilter] Leaf size is too small for the input dataset. Integer indices would overflow.
and Initialization failed.
I show my rewritten code and desirely hope someone will check it.
And sincerely thank for autorths' sharing!

作者您好,有个问题请教一下

当我用我自己的IMU,100Hz,使用陀螺仪角速度估计的姿态轨迹,打印了IMU一秒100帧的数据,Z轴的偏转异常,不知道什么问题?Z轴角速度是-5左右,第1帧到第100帧(一秒的数据)Z轴的姿态变化达到了240度,不知道作者有没有意见?

当前陀螺仪时间>1651575260.0079998970
当前IMU陀螺仪角速度>
0.164747
0.424143
-4.88585
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>27.1341 156.969 153.685
当前IMU ID ------------------------------------->1

当前陀螺仪时间>1651575260.0179998875
当前IMU陀螺仪角速度>
0.248669
0.439402
-4.84007
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>27.3712 156.805 150.812
当前IMU ID ------------------------------------->2

当前陀螺仪时间>1651575260.0280001163
当前IMU陀螺仪角速度>
0.0731954
0.263928
-4.80193
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>27.5863 156.675 147.963
当前IMU ID ------------------------------------->3

当前陀螺仪时间>1651575260.0380001068
当前IMU陀螺仪角速度>
0.149488
0.309704
-4.86296
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>27.7436 156.58 145.13
当前IMU ID ------------------------------------->4

当前陀螺仪时间>1651575260.0480000973
当前IMU陀螺仪角速度>
0.248669
0.225781
-4.8477
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>27.9189 156.517 142.284
当前IMU ID ------------------------------------->5

当前陀螺仪时间>1651575260.0580000877
当前IMU陀螺仪角速度>
0.225781
0.294445
-4.84007
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>28.1392 156.483 139.419
当前IMU ID ------------------------------------->6

当前陀螺仪时间>1651575260.0680000782
当前IMU陀螺仪角速度>
0.126601
0.180006
-4.83244
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>28.3396 156.465 136.565
当前IMU ID ------------------------------------->7

当前陀螺仪时间>1651575260.0780000687
当前IMU陀螺仪角速度>
0.202894
0.225781
-4.84007
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>28.5013 156.445 133.732
当前IMU ID ------------------------------------->8

当前陀螺仪时间>1651575260.0880000591
当前IMU陀螺仪角速度>
0.195264
0.332592
-4.76378
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>28.6919 156.419 130.902
当前IMU ID ------------------------------------->9

当前陀螺仪时间>1651575260.0980000496
当前IMU陀螺仪角速度>
0.195264
0.302074
-4.7943
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>28.9312 156.386 128.067
当前IMU ID ------------------------------------->10

当前陀螺仪时间>1651575260.1080000401
当前IMU陀螺仪角速度>
0.0655661
0.324962
-4.7943
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.1509 156.346 125.237
当前IMU ID ------------------------------------->11

当前陀螺仪时间>1651575260.1180000305
当前IMU陀螺仪角速度>
0.0960833
0.172376
-4.8477
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.3099 156.306 122.417
当前IMU ID ------------------------------------->12

当前陀螺仪时间>1651575260.1280000210
当前IMU陀螺仪角速度>
0.111342
0.164747
-4.80193
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.4208 156.295 119.598
当前IMU ID ------------------------------------->13

当前陀螺仪时间>1651575260.1380000114
当前IMU陀螺仪角速度>
0.0655661
0.0808247
-4.85533
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.5098 156.309 116.781
当前IMU ID ------------------------------------->14

当前陀螺仪时间>1651575260.1480000019
当前IMU陀螺仪角速度>
-0.0183562
0.286816
-4.83244
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.625 156.292 113.981
当前IMU ID ------------------------------------->15

当前陀螺仪时间>1651575260.1579999924
当前IMU陀螺仪角速度>
0.0579368
0.180006
-4.67986
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.7764 156.234 111.2
当前IMU ID ------------------------------------->16

当前陀螺仪时间>1651575260.1679999828
当前IMU陀螺仪角速度>
-0.0565027
0.263928
-4.7943
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.9001 156.192 108.42
当前IMU ID ------------------------------------->17

当前陀螺仪时间>1651575260.1779999733
当前IMU陀螺仪角速度>
0.0579368
0.0274196
-4.8477
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>29.9711 156.187 105.634
当前IMU ID ------------------------------------->18

当前陀螺仪时间>1651575260.1879999638
当前IMU陀螺仪角速度>
0.0197903
0.141859
-4.80193
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.0457 156.176 102.84
当前IMU ID ------------------------------------->19

当前陀螺仪时间>1651575260.1979999542
当前IMU陀螺仪角速度>
-0.0717613
0.141859
-4.75615
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.1484 156.141 100.056
当前IMU ID ------------------------------------->20

当前陀螺仪时间>1651575260.2079999447
当前IMU陀螺仪角速度>
-0.0565027
0.256299
-4.65697
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.2353 156.104 97.3227
当前IMU ID ------------------------------------->21

当前陀螺仪时间>1651575260.2179999352
当前IMU陀螺仪角速度>
-0.0336148
0.012161
-4.67223
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.294 156.069 94.6406
当前IMU ID ------------------------------------->22

当前陀螺仪时间>1651575260.2279999256
当前IMU陀螺仪角速度>
-0.109908
0.111342
-4.60357
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.3741 156.021 91.9406
当前IMU ID ------------------------------------->23

当前陀螺仪时间>1651575260.2379999161
当前IMU陀螺仪角速度>
-0.140425
0.225781
-4.76378
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.492 155.947 89.1998
当前IMU ID ------------------------------------->24

当前陀螺仪时间>1651575260.2479999065
当前IMU陀螺仪角速度>
-0.285382
0.225781
-4.62645
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.6018 155.836 86.4786
当前IMU ID ------------------------------------->25

当前陀螺仪时间>1651575260.2579998970
当前IMU陀螺仪角速度>
-0.224347
0.0731954
-4.58831
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.685 155.691 83.8048
当前IMU ID ------------------------------------->26

当前陀螺仪时间>1651575260.2679998875
当前IMU陀螺仪角速度>
-0.262494
-0.0412441
-4.55779
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.7712 155.554 81.1441
当前IMU ID ------------------------------------->27

当前陀螺仪时间>1651575260.2780001163
当前IMU陀螺仪角速度>
-0.178571
0.271557
-4.58831
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.8711 155.442 78.4744
当前IMU ID ------------------------------------->28

当前陀螺仪时间>1651575260.2880001068
当前IMU陀螺仪角速度>
-0.30827
0.0579368
-4.6646
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.9648 155.324 75.8001
当前IMU ID ------------------------------------->29

当前陀螺仪时间>1651575260.2980000973
当前IMU陀螺仪角速度>
-0.148054
0.0731954
-4.54253
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.0425 155.214 73.1322
当前IMU ID ------------------------------------->30

当前陀螺仪时间>1651575260.3080000877
当前IMU陀螺仪角速度>
0.13423
0.0426782
-4.51964
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.1051 155.201 70.4921
当前IMU ID ------------------------------------->31

当前陀螺仪时间>1651575260.3180000782
当前IMU陀螺仪角速度>
0.103713
0.24104
-4.51964
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.1633 155.297 67.8798
当前IMU ID ------------------------------------->32

当前陀螺仪时间>1651575260.3280000687
当前IMU陀螺仪角速度>
-0.0565027
0.218152
-4.56542
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.2593 155.389 65.2511
当前IMU ID ------------------------------------->33

当前陀螺仪时间>1651575260.3380000591
当前IMU陀螺仪角速度>
0.0350489
0.271557
-4.49676
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.4061 155.433 62.5914
当前IMU ID ------------------------------------->34

当前陀螺仪时间>1651575260.3480000496
当前IMU陀螺仪角速度>
0.0426782
0.195264
-4.49676
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.5491 155.507 59.9456
当前IMU ID ------------------------------------->35

当前陀螺仪时间>1651575260.3580000401
当前IMU陀螺仪角速度>
0.111342
0.317333
-4.47387
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.6497 155.629 57.3375
当前IMU ID ------------------------------------->36

当前陀螺仪时间>1651575260.3680000305
当前IMU陀螺仪角速度>
-0.0259855
0.0197903
-4.50438
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.7186 155.708 54.7412
当前IMU ID ------------------------------------->37

当前陀螺仪时间>1651575260.3780000210
当前IMU陀螺仪角速度>
-0.0183562
0.202894
-4.55016
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.7882 155.732 52.126
当前IMU ID ------------------------------------->38

当前陀螺仪时间>1651575260.3880000114
当前IMU陀螺仪角速度>
0.103713
0.378367
-4.52727
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.8977 155.835 49.4694
当前IMU ID ------------------------------------->39

当前陀螺仪时间>1651575260.3980000019
当前IMU陀螺仪角速度>
0.149488
0.302074
-4.59594
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.0279 156.046 46.7917
当前IMU ID ------------------------------------->40

当前陀螺仪时间>1651575260.4079999924
当前IMU陀螺仪角速度>
0.0503075
0.225781
-4.52727
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.0934 156.195 44.1677
当前IMU ID ------------------------------------->41

当前陀螺仪时间>1651575260.4179999828
当前IMU陀螺仪角速度>
0.0426782
-0.0183562
-4.44335
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.0887 156.234 41.6049
当前IMU ID ------------------------------------->42

当前陀螺仪时间>1651575260.4279999733
当前IMU陀螺仪角速度>
0.202894
0.317333
-4.54253
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.1141 156.346 39.0104
当前IMU ID ------------------------------------->43

当前陀螺仪时间>1651575260.4379999638
当前IMU陀螺仪角速度>
0.172376
0.363109
-4.60357
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.1874 156.591 36.3567
当前IMU ID ------------------------------------->44

当前陀螺仪时间>1651575260.4479999542
当前IMU陀螺仪角速度>
0.0350489
0.363109
-4.58831
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.2118 156.787 33.7202
当前IMU ID ------------------------------------->45

当前陀螺仪时间>1651575260.4579999447
当前IMU陀螺仪角速度>
0.256299
-0.148054
-4.50438
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.1596 156.858 31.1382
当前IMU ID ------------------------------------->46

当前陀螺仪时间>1651575260.4679999352
当前IMU陀螺仪角速度>
0.157118
0.202894
-4.46624
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.0996 156.951 28.5831
当前IMU ID ------------------------------------->47

当前陀螺仪时间>1651575260.4779999256
当前IMU陀螺仪角速度>
0.202894
0.218152
-4.45861
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>32.0565 157.125 26.0399
当前IMU ID ------------------------------------->48

当前陀螺仪时间>1651575260.4879999161
当前IMU陀螺仪角速度>
0.187635
0.263928
-4.4815
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.9916 157.271 23.5158
当前IMU ID ------------------------------------->49

当前陀螺仪时间>1651575260.4979999065
当前IMU陀螺仪角速度>
0.218152
-0.0717613
-4.38995
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.8895 157.345 21.0142
当前IMU ID ------------------------------------->50

当前陀螺仪时间>1651575260.5079998970
当前IMU陀螺仪角速度>
0.286816
0.126601
-4.38995
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.7645 157.439 18.5357
当前IMU ID ------------------------------------->51

当前陀螺仪时间>1651575260.5179998875
当前IMU陀螺仪角速度>
0.294445
0.118971
-4.4052
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.6322 157.586 16.074
当前IMU ID ------------------------------------->52

当前陀螺仪时间>1651575260.5280001163
当前IMU陀螺仪角速度>
0.0960833
0.401255
-4.3518
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.5184 157.707 13.6085
当前IMU ID ------------------------------------->53

当前陀螺仪时间>1651575260.5380001068
当前IMU陀螺仪角速度>
0.187635
-0.170942
-4.38232
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.4364 157.77 11.1304
当前IMU ID ------------------------------------->54

当前陀螺仪时间>1651575260.5480000973
当前IMU陀螺仪角速度>
0.164747
0.103713
-4.38232
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.3673 157.827 8.65418
当前IMU ID ------------------------------------->55

当前陀螺仪时间>1651575260.5580000877
当前IMU陀螺仪角速度>
0.0579368
0.118971
-4.31365
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.3078 157.896 6.18505
当前IMU ID ------------------------------------->56

当前陀螺仪时间>1651575260.5680000782
当前IMU陀螺仪角速度>
-0.0870199
0.0960833
-4.33654
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.291 157.929 3.70678
当前IMU ID ------------------------------------->57

当前陀螺仪时间>1651575260.5780000687
当前IMU陀螺仪角速度>
-0.0259855
-0.0717613
-4.32891
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.3287 157.913 1.21584
当前IMU ID ------------------------------------->58

当前陀螺仪时间>1651575260.5880000591
当前IMU陀螺仪角速度>
-0.0870199
-0.132796
-4.23736
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.3859 157.896 -1.26539
当前IMU ID ------------------------------------->59

当前陀螺仪时间>1651575260.5980000496
当前IMU陀螺仪角速度>
-0.0870199
0.118971
-4.29839
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.4394 157.909 -3.72882
当前IMU ID ------------------------------------->60

当前陀螺仪时间>1651575260.6080000401
当前IMU陀螺仪角速度>
-0.170942
0.149488
-4.25262
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.4967 157.943 -6.1945
当前IMU ID ------------------------------------->61

当前陀螺仪时间>1651575260.6180000305
当前IMU陀螺仪角速度>
-0.0336148
0.0503075
-4.29076
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.5576 157.995 -8.67458
当前IMU ID ------------------------------------->62

当前陀螺仪时间>1651575260.6280000210
当前IMU陀螺仪角速度>
-0.125166
-0.0107269
-4.37469
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.6054 158.065 -11.1642
当前IMU ID ------------------------------------->63

当前陀螺仪时间>1651575260.6380000114
当前IMU陀螺仪角速度>
-0.0183562
0.256299
-4.22973
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.6287 158.146 -13.6446
当前IMU ID ------------------------------------->64

当前陀螺仪时间>1651575260.6480000019
当前IMU陀螺仪角速度>
-0.0565027
0.13423
-4.24499
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.6277 158.223 -16.0788
当前IMU ID ------------------------------------->65

当前陀螺仪时间>1651575260.6579999924
当前IMU陀螺仪角速度>
0.0274196
0.0960833
-4.18395
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.6061 158.28 -18.4669
当前IMU ID ------------------------------------->66

当前陀螺仪时间>1651575260.6679999828
当前IMU陀螺仪角速度>
0.111342
-0.0946492
-4.21447
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.5699 158.304 -20.8702
当前IMU ID ------------------------------------->67

当前陀螺仪时间>1651575260.6779999733
当前IMU陀螺仪角速度>
0.0426782
0.180006
-4.32891
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.5216 158.313 -23.3129
当前IMU ID ------------------------------------->68

当前陀螺仪时间>1651575260.6879999638
当前IMU陀螺仪角速度>
0.0045317
0.187635
-4.32891
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>31.4522 158.364 -25.749
当前IMU ID ------------------------------------->69

当前陀螺仪时间>1651575260.6979999542
当前IMU陀螺仪角速度>
0.118971
0.24104
-4.19158
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.3581 158.457 -28.1521
当前IMU ID ------------------------------------->70

当前陀螺仪时间>1651575260.7079999447
当前IMU陀螺仪角速度>
0.187635
-0.102278
-4.21447
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.2584 158.49 -30.5415
当前IMU ID ------------------------------------->71

当前陀螺仪时间>1651575260.7179999352
当前IMU陀螺仪角速度>
0.157118
0.118971
-4.2221
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.1582 158.44 -32.9203
当前IMU ID ------------------------------------->72

当前陀螺仪时间>1651575260.7279999256
当前IMU陀螺仪角速度>
0.187635
0.225781
-4.12292
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 31.0221 158.42 -35.2543
当前IMU ID ------------------------------------->73

当前陀螺仪时间>1651575260.7379999161
当前IMU陀螺仪角速度>
0.225781
0.180006
-4.07714
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.8531 158.463 -37.5394
当前IMU ID ------------------------------------->74

当前陀螺仪时间>1651575260.7479999065
当前IMU陀螺仪角速度>
0.0274196
-0.0565027
-4.04663
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.7361 158.464 -39.8291
当前IMU ID ------------------------------------->75

当前陀螺仪时间>1651575260.7579998970
当前IMU陀螺仪角速度>
0.24104
-0.0336148
-4.0924
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>30.6887 158.386 -42.14
当前IMU ID ------------------------------------->76

当前陀螺仪时间>1651575260.7679998875
当前IMU陀螺仪角速度>
0.24104
0.180006
-3.97033
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.5972 158.31 -44.4174
当前IMU ID ------------------------------------->77

当前陀螺仪时间>1651575260.7780001163
当前IMU陀螺仪角速度>
0.202894
0.118971
-3.99322
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.4176 158.272 -46.6407
当前IMU ID ------------------------------------->78

当前陀螺仪时间>1651575260.7880001068
当前IMU陀螺仪角速度>
0.271557
0.111342
-4.01611
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.2441 158.234 -48.8564
当前IMU ID ------------------------------------->79

当前陀螺仪时间>1651575260.7980000973
当前IMU陀螺仪角速度>
0.180006
0.0731954
-3.92456
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 30.1173 158.18 -51.0858
当前IMU ID ------------------------------------->80

当前陀螺仪时间>1651575260.8080000877
当前IMU陀螺仪角速度>
0.210523
0.279187
-3.95507
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.9694 158.124 -53.2987
当前IMU ID ------------------------------------->81

当前陀螺仪时间>1651575260.8180000782
当前IMU陀螺仪角速度>
0.35548
0.172376
-3.92456
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.7719 158.068 -55.4742
当前IMU ID ------------------------------------->82

当前陀螺仪时间>1651575260.8280000687
当前IMU陀螺仪角速度>
0.218152
0.0426782
-3.7796
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.5769 157.988 -57.6149
当前IMU ID ------------------------------------->83

当前陀螺仪时间>1651575260.8380000591
当前IMU陀螺仪角速度>
0.34785
0.233411
-3.77197
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.4091 157.877 -59.7239
当前IMU ID ------------------------------------->84

当前陀螺仪时间>1651575260.8480000496
当前IMU陀螺仪角速度>
0.370738
0.149488
-3.77197
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.235 157.752 -61.8004
当前IMU ID ------------------------------------->85

当前陀螺仪时间>1651575260.8580000401
当前IMU陀螺仪角速度>
0.332592
0.180006
-3.65753
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 29.0436 157.622 -63.8562
当前IMU ID ------------------------------------->86

当前陀螺仪时间>1651575260.8680000305
当前IMU陀螺仪角速度>
0.279187
0.0503075
-3.75671
当前IMU角度: roll(x) pitch(y) yaw(z) ------------>28.8692 157.48 -65.924
当前IMU ID ------------------------------------->87

当前陀螺仪时间>1651575260.8780000210
当前IMU陀螺仪角速度>
0.378367
0.157118
-3.7262
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 28.7264 157.33 -68.0097
当前IMU ID ------------------------------------->88

当前陀螺仪时间>1651575260.8880000114
当前IMU陀螺仪角速度>
0.279187
0.149488
-3.6499
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 28.5896 157.191 -70.0724
当前IMU ID ------------------------------------->89

当前陀螺仪时间>1651575260.8980000019
当前IMU陀螺仪角速度>
0.286816
0.187635
-3.61939
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 28.4463 157.065 -72.0986
当前IMU ID ------------------------------------->90

当前陀螺仪时间>1651575260.9079999924
当前IMU陀螺仪角速度>
0.263928
-0.0336148
-3.65753
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 28.3139 156.929 -74.1258
当前IMU ID ------------------------------------->91

当前陀螺仪时间>1651575260.9179999828
当前IMU陀螺仪角速度>
0.370738
0.218152
-3.58887
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 28.1965 156.772 -76.1644
当前IMU ID ------------------------------------->92

当前陀螺仪时间>1651575260.9279999733
当前IMU陀螺仪角速度>
0.263928
0.202894
-3.60413
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 28.0709 156.611 -78.1732
当前IMU ID ------------------------------------->93

当前陀螺仪时间>1651575260.9379999638
当前IMU陀螺仪角速度>
0.302074
0.012161
-3.51258
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.9488 156.456 -80.1511
当前IMU ID ------------------------------------->94

当前陀螺仪时间>1651575260.9479999542
当前IMU陀螺仪角速度>
0.271557
-0.0030976
-3.55835
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.9028 156.31 -82.1696
当前IMU ID ------------------------------------->95

当前陀螺仪时间>1651575260.9579999447
当前IMU陀螺仪角速度>
0.210523
-0.0793906
-3.6499
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.9383 156.171 -84.2552
当前IMU ID ------------------------------------->96

当前陀螺仪时间>1651575260.9679999352
当前IMU陀螺仪角速度>
0.271557
-0.0107269
-3.71094
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.9463 156.022 -86.3516
当前IMU ID ------------------------------------->97

当前陀螺仪时间>1651575260.9779999256
当前IMU陀螺仪角速度>
0.309704
0.0960833
-3.61176
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.887 155.854 -88.4296
当前IMU ID ------------------------------------->98

当前陀螺仪时间>1651575260.9879999161
当前IMU陀螺仪角速度>
0.340221
0.111342
-3.69568
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.8458 155.677 -90.5149
当前IMU ID ------------------------------------->99

当前陀螺仪时间>1651575260.9979999065
当前IMU陀螺仪角速度>
0.271557
-0.132796
-3.62702
当前IMU角度: roll(x) pitch(y) yaw(z) ------------> 27.863 155.501 -92.6139
当前IMU ID ------------------------------------->100

imu's params overwritten

Hi author @icameling,
The most details in paper are realized and encapsulated in modified Kontiki and lidar_surfel_point.h, Maybe i will take some more time to learn this Toolkit to better understand paper. Thanks for your this excellent work! :)
In CalibParamManager ctor, acc, gyro and laser weight used in trajectory_manager.cpp is overwritten by const value.

// fine-tuned parameter
global_opt_gyro_weight = 28.0;
global_opt_acce_weight = 18.5;
global_opt_lidar_weight = 10.0; 

When use my own imu, its price is about dozens of RMB, how to set three params? Thanks a lot!
Best

LZ4_stream_t, LZ4_streamDecode_t build error

Hi author,
When building on ubuntu18.04 and melodic, system's pcl version is 1.8, run catkin_make, the output is:

####
#### Running command: "make -j12 -l12" in "/home/jxl/catkin_li_calib/build"
####
Scanning dependencies of target ndt_omp
[ 20%] Building CXX object ndt_omp/CMakeFiles/ndt_omp.dir/src/pclomp/ndt_omp.cpp.o
[ 20%] Building CXX object ndt_omp/CMakeFiles/ndt_omp.dir/src/pclomp/voxel_grid_covariance_omp.cpp.o
[ 20%] Building CXX object ndt_omp/CMakeFiles/ndt_omp.dir/src/pclomp/gicp_omp.cpp.o
In file included from /usr/include/pcl-1.8/pcl/sample_consensus/sac_model.h:52:0,
	             from /usr/include/pcl-1.8/pcl/sample_consensus/sac.h:45,
	             from /usr/include/pcl-1.8/pcl/sample_consensus/ransac.h:44,
	             from /usr/include/pcl-1.8/pcl/registration/icp.h:45,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/include/pclomp/gicp_omp.h:44,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/src/pclomp/gicp_omp.cpp:1:
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h: In function ‘void __static_initialization_and_destruction_0(int, int)’:
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
   SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
   ^~~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: note: declared here
[ 26%] Linking CXX shared library /home/jxl/catkin_li_calib/devel/lib/libndt_omp.so
[ 26%] Built target ndt_omp
Scanning dependencies of target li_calib_lib
Scanning dependencies of target align
[ 33%] Building CXX object ndt_omp/CMakeFiles/align.dir/apps/align.cpp.o
[ 40%] Building CXX object lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/trajectory_manager.cpp.o
[ 46%] Building CXX object lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/surfel_association.cpp.o
[ 53%] Building CXX object lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/lidar_odometry.cpp.o
[ 60%] Building CXX object lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/inertial_initializer.cpp.o
In file included from /usr/include/flann/util/serialization.h:9:0,
	             from /usr/include/flann/util/matrix.h:35,
	             from /usr/include/flann/flann.hpp:41,
	             from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50,
	             from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45,
	             from /usr/include/pcl-1.8/pcl/search/kdtree.h:44,
	             from /usr/include/pcl-1.8/pcl/registration/registration.h:48,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/include/pclomp/ndt_omp.h:44,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/surfel_association.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:37,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/trajectory_manager.cpp:21:
/usr/include/flann/ext/lz4.h:196:57: error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’
 typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
	                                                     ^~~~~~~~~~~~
In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0,
	             from /opt/ros/melodic/include/rosbag/stream.h:46,
	             from /opt/ros/melodic/include/rosbag/chunked_file.h:46,
	             from /opt/ros/melodic/include/rosbag/bag.h:41,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/utils/dataset_reader.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:36,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/trajectory_manager.cpp:21:
/usr/include/lz4.h:196:57: note: previous declaration as ‘typedef struct LZ4_stream_t LZ4_stream_t’
 typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
	                                                     ^~~~~~~~~~~~
In file included from /usr/include/flann/util/serialization.h:9:0,
	             from /usr/include/flann/util/matrix.h:35,
	             from /usr/include/flann/flann.hpp:41,
	             from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50,
	             from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45,
	             from /usr/include/pcl-1.8/pcl/search/kdtree.h:44,
	             from /usr/include/pcl-1.8/pcl/registration/registration.h:48,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/include/pclomp/ndt_omp.h:44,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/surfel_association.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:37,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/trajectory_manager.cpp:21:
/usr/include/flann/ext/lz4.h:249:72: error: conflicting declaration ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’
 typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
	                                                                    ^~~~~~~~~~~~~~~~~~
In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0,
	             from /opt/ros/melodic/include/rosbag/stream.h:46,
	             from /opt/ros/melodic/include/rosbag/chunked_file.h:46,
	             from /opt/ros/melodic/include/rosbag/bag.h:41,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/utils/dataset_reader.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:36,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/trajectory_manager.cpp:21:
/usr/include/lz4.h:249:72: note: previous declaration as ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’
 typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
	                                                                    ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/flann/util/serialization.h:9:0,
	             from /usr/include/flann/util/matrix.h:35,
	             from /usr/include/flann/flann.hpp:41,
	             from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50,
	             from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45,
	             from /usr/include/pcl-1.8/pcl/search/kdtree.h:44,
	             from /usr/include/pcl-1.8/pcl/registration/registration.h:48,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/include/pclomp/ndt_omp.h:44,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/surfel_association.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:37,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/inertial_initializer.h:26,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/inertial_initializer.cpp:21:
/usr/include/flann/ext/lz4.h:196:57: error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’
 typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
	                                                     ^~~~~~~~~~~~
In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0,
	             from /opt/ros/melodic/include/rosbag/stream.h:46,
	             from /opt/ros/melodic/include/rosbag/chunked_file.h:46,
	             from /opt/ros/melodic/include/rosbag/bag.h:41,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/utils/dataset_reader.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:36,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/inertial_initializer.h:26,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/inertial_initializer.cpp:21:
/usr/include/lz4.h:196:57: note: previous declaration as ‘typedef struct LZ4_stream_t LZ4_stream_t’
 typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
	                                                     ^~~~~~~~~~~~
In file included from /usr/include/flann/util/serialization.h:9:0,
	             from /usr/include/flann/util/matrix.h:35,
	             from /usr/include/flann/flann.hpp:41,
	             from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50,
	             from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45,
	             from /usr/include/pcl-1.8/pcl/search/kdtree.h:44,
	             from /usr/include/pcl-1.8/pcl/registration/registration.h:48,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/include/pclomp/ndt_omp.h:44,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/surfel_association.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:37,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/inertial_initializer.h:26,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/inertial_initializer.cpp:21:
/usr/include/flann/ext/lz4.h:249:72: error: conflicting declaration ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’
 typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
	                                                                    ^~~~~~~~~~~~~~~~~~
In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0,
	             from /opt/ros/melodic/include/rosbag/stream.h:46,
	             from /opt/ros/melodic/include/rosbag/chunked_file.h:46,
	             from /opt/ros/melodic/include/rosbag/bag.h:41,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/utils/dataset_reader.h:24,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/trajectory_manager.h:36,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/include/core/inertial_initializer.h:26,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/inertial_initializer.cpp:21:
/usr/include/lz4.h:249:72: note: previous declaration as ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’
 typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
	                                                                    ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/pcl-1.8/pcl/sample_consensus/sac_model.h:52:0,
	             from /usr/include/pcl-1.8/pcl/sample_consensus/sac.h:45,
	             from /usr/include/pcl-1.8/pcl/segmentation/sac_segmentation.h:49,
	             from /home/jxl/catkin_li_calib/src/lidar_IMU_calib/src/core/surfel_association.cpp:23:
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h: In function ‘void __static_initialization_and_destruction_0(int, int)’:
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
   SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
   ^~~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: note: declared here
In file included from /usr/include/pcl-1.8/pcl/sample_consensus/sac_model.h:52:0,
	             from /usr/include/pcl-1.8/pcl/sample_consensus/sac.h:45,
	             from /usr/include/pcl-1.8/pcl/sample_consensus/ransac.h:44,
	             from /usr/include/pcl-1.8/pcl/registration/icp.h:45,
	             from /usr/include/pcl-1.8/pcl/registration/gicp.h:44,
	             from /home/jxl/catkin_li_calib/src/ndt_omp/apps/align.cpp:7:
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h: In function ‘void __static_initialization_and_destruction_0(int, int)’:
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
   SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
   ^~~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: note: declared here
lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/build.make:62: recipe for target 'lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/trajectory_manager.cpp.o' failed
make[2]: *** [lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/trajectory_manager.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/build.make:86: recipe for target 'lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/inertial_initializer.cpp.o' failed
make[2]: *** [lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/src/core/inertial_initializer.cpp.o] Error 1
CMakeFiles/Makefile2:3374: recipe for target 'lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/all' failed
make[1]: *** [lidar_IMU_calib/CMakeFiles/li_calib_lib.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 66%] Linking CXX executable /home/jxl/catkin_li_calib/devel/lib/ndt_omp/align
[ 66%] Built target align
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed
jxl@lenevo:~/catkin_li_calib$ 

Thanks for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.