Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Own datasets #27

Open
EloyAldao opened this issue Sep 26, 2022 · 9 comments
Open

Own datasets #27

EloyAldao opened this issue Sep 26, 2022 · 9 comments

Comments

@EloyAldao
Copy link

Hi:

As I can see this work runs on individual scans in pcd format, and a csv containing the poses.
Will be there an option to use other datasets, as our own bags?

BALM v1 alowed to use own datasets, isolated or with LOAM odometry.

Will be there any utility to capture external odometry to make the PCDs and the pose file?

Thanks in advance

@Zale-Liu
Copy link
Member

The code we opened mainly shows the basic function of the BA for readers to understand, instead of a completed system. You can take it as a sub-module in your own projects. If you want to use your own dataset, your should save the PCDs and pose file, which are generated by a front-end (like FAST-LIO2). The PCD file is saved by the function "pcl::io::savePCDFileBinary()" and the pose file is the pose matrix (4*4 matrix). The pose and PCD must corresponding one by one. Moreover, according to the quality of front-end, you need to adjust the parameters of adaptive voxelization (like "voxel_size" and "eigen_value_array[]"). For the completed system for global BA, you can see the paper "Large-Scale LiDAR Consistent Mapping using Hierarchical LiDAR Bundle Adjustment", which will be opened in several weeks.

@antun008
Copy link

antun008 commented Sep 26, 2022

can we use pcd from r3live?
How can I set in fastlio/r3live to publish pose matrix and use it for balm in format like yours?

Thanks in advance

@Zale-Liu
Copy link
Member

can we use pcd from r3live? How can I set in fastlio/r3live to publish pose matrix and use it for balm in format like yours?

Thanks in advance

Of course you can use r3live. You need to add some codes to fastlio, r3live or you own project. You can use the std class "ofstream" and operation "<<" to input your pose 4*4 matrix into the file.

@antun008
Copy link

Can you maybe help us and create modified code for fast lio or even better for r3live. Hope its not inconvenient for you😅

@EloyAldao
Copy link
Author

EloyAldao commented Sep 27, 2022

Only as a comment:

I tried the last version on Ubuntu 18.4 with ROS Melodic and everything compiled and worked like a charm:
rviz_screenshot_2022_09_27-14_00_35

I'm now trying to use my own data and odometry.
I'll give you feedback.
The only thing that could be better is to have the paths and poses files as a parameter in the launchfile, instead of have them hardcoded con the cpp
@antun008 I use FAST-LIO on Livox Horizon datasets. If I find an easy way to make it work I'll notice to you

@Zale-Liu
Copy link
Member

Can you maybe help us and create modified code for fast lio or even better for r3live. Hope its not inconvenient for yousweat_smile

ofstream outFile;
outFile.open(yourpath + "alidarPose.csv", ios::out);
Eigen::Matrix4d outT;
outT << state.rot_end, state.pos_end, 0, 0, 0,
LidarMeasures.lidar_beg_time;
outFile << fixed;
for (int j = 0; j < 4; j++)
{
for (int k = 0; k < 4; k++)
outFile << outT(j, k) << ",";
outFile << endl;
}
string filename = yourpath + "full" + to_string(count) + ".pcd";
pcl::PointCloudpcl::PointXYZI::Ptr pcl_body(new pcl::PointCloudpcl::PointXYZI);
transformLidar(Eye3d, Zero3d, feats_undistort, pcl_imu_body);
pcl::io::savePCDFileBinary(filename, *pcl_body);

You can add this piece of code to the end of each loop in fastlio2. You need to assign some variables like "yourpath". BALM2.0 is just an instruction to show you how to use lidar BA, so it cannot deal with too long dataset due to the time and space complexity (so does visual BA). Moreover, for your own dataset, you need to adjust "voxel_size" and "eigen_value_array" to control the quality of planes that you give to the BALM2.0 solver. If you give too much bad planes or the number of planes is too less, the solver may fail. The main limitation for lidar BA is the point association (namely finding planes) which we are trying to solve.

@antun008
Copy link

Thanks a lot, I will try with this modified code. I want to say additionally that you have done a really excellent thing. That's what every odometry needs to become a real slam product!

@antun008
Copy link

antun008 commented Sep 29, 2022

Only as a comment:

I tried the last version on Ubuntu 18.4 with ROS Melodic and everything compiled and worked like a charm: rviz_screenshot_2022_09_27-14_00_35

I'm now trying to use my own data and odometry. I'll give you feedback. The only thing that could be better is to have the paths and poses files as a parameter in the launchfile, instead of have them hardcoded con the cpp @antun008 I use FAST-LIO on Livox Horizon datasets. If I find an easy way to make it work I'll notice to you

Thank you!:)
did you maybe succeed?

@bloom256
Copy link

The code we opened mainly shows the basic function of the BA for readers to understand, instead of a completed system. You can take it as a sub-module in your own projects. If you want to use your own dataset, your should save the PCDs and pose file, which are generated by a front-end (like FAST-LIO2). The PCD file is saved by the function "pcl::io::savePCDFileBinary()" and the pose file is the pose matrix (4*4 matrix). The pose and PCD must corresponding one by one. Moreover, according to the quality of front-end, you need to adjust the parameters of adaptive voxelization (like "voxel_size" and "eigen_value_array[]"). For the completed system for global BA, you can see the paper "Large-Scale LiDAR Consistent Mapping using Hierarchical LiDAR Bundle Adjustment", which will be opened in several weeks.

Are there any plans to add an open-source license?

@Zale-Liu Zale-Liu reopened this Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants