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

How to use the lidar.bin file? #2

Open
icameling opened this issue Nov 1, 2021 · 3 comments
Open

How to use the lidar.bin file? #2

icameling opened this issue Nov 1, 2021 · 3 comments

Comments

@icameling
Copy link

Hello, thank you for your excellent work.

I am having some problems about the usage lidar.bin file.

  1. How to extract point cloud from lidar.bin file?
  2. What's the timestamps of each scan? Is the timestamp located in the first point of scan or the last point of the scan?

Looking forward to your reply. And thanks again for kindly making the dataset public.

@clegenti
Copy link
Member

clegenti commented Nov 2, 2021

Hi,
Thanks for the interest in our work.

In my C++ code I used the snark::velodyne::stream object from the snark library that I linked in my cmake. Then I pass the data with pipe like cat lidar.bin | in2laama_exe

By using snark to collect lidar data, you get a timestamp per point which allows for accurate motion distortion correction. The data is a "stream" of points. To have scans, you can segment the full set of points based on the timestamps or the azimuth of the points.

If you don't feel like dealing with snark in your code, you can probably convert the binary files to csv as shown there or velodyne-to-csv.
(it is probably possible to write an independent parser to transform the binary format into csv, but would need to get the underlying structure, not sure what it is. I can look which command we used in our sensor suite if that can help)

@icameling
Copy link
Author

Hello,

Thank you for your quick reply and sorry for my late response.

After installing the latest snark library, I used the following command in the folder /in2laama_datasets/staircase

cat lidar.bin | velodyne-to-csv --model vlp16  > lidar.csv

and got lidar.csv with a size of 2.8GB. Note that the size of lidar.bin is 83.6 MB. The following is some data from the beginning and end of lidar.csv. Each row has thirteen items and the first two items seems to be timestamps and rings of points. Do you have any idea what the rest of the items means?

20190402T074603.248383,1,5355,0,0,0,-1.47004921858,1.37326846792,0.0351142417518,-3.89296598716,2.012,1,1
20190402T074603.248385,2,5865,0,0,0,-1.71026456299,1.59769834041,-0.540332432534,-3.89297507774,2.402,1,1
20190402T074603.248387,3,7395,0,0,0,-1.4405032011,1.3457166597,0.103311177624,-3.89298416833,1.974,1,1
20190402T074603.248390,4,5865,0,0,0,-1.66702335766,1.55735994493,-0.443440105255,-3.89299325891,2.324,1,1
20190402T074603.248392,5,7650,0,0,0,-1.40930461962,1.31661896122,0.168733517959,-3.8930023495,1.936,1,1
20190402T074603.248394,6,5610,0,0,0,-1.61955010209,1.51306481346,-0.35103893955,-3.89301144009,2.244,1,1
20190402T074603.248397,7,9180,0,0,0,-1.38381170544,1.29284975706,0.232526707217,-3.89302053067,1.908,1,1
20190402T074603.248399,8,4590,0,0,0,-1.58832384499,1.48394576378,-0.266893862057,-3.89302962126,2.19,1,1
20190402T074603.248401,9,8415,0,0,0,-1.34959069796,1.26092415073,0.292532449625,-3.89303871184,1.87,1,1
20190402T074603.248404,10,7140,0,0,0,-1.56647456281,1.46358566752,-0.187559158393,-3.89304780243,2.152,1,1
20190402T074603.248406,11,9435,0,0,0,-1.31689885055,1.23042496347,0.350325315511,-3.89305689301,1.836,1,1
20190402T074603.248408,12,4845,0,0,0,-1.52795498646,1.42764815839,-0.109591492373,-3.8930659836,2.094,1,1
20190402T074603.248410,13,9435,0,0,0,-1.2929018731,1.20804777046,0.408511114688,-3.89307507418,1.816,1,1
20190402T074603.248413,14,5865,0,0,0,-1.4874203611,1.38982519341,-0.0355330995063,-3.89308416477,2.036,1,1
20190402T074603.248415,15,9435,0,0,0,-1.26755998345,1.18441225415,0.464839005004,-3.89309325535,1.796,1,1
20190402T074603.248433,0,5100,0,0,0,-1.74417151429,1.6335648689,-0.640318317584,-3.89425672402,2.474,1,1
20190402T074603.248436,1,4590,0,0,0,-1.45366790588,1.361508355,0.0347651936231,-3.8942658146,1.992,1,1
20190402T074603.248438,2,5610,0,0,0,-1.6868518356,1.57993769037,-0.533583900904,-3.89427490519,2.372,1,1
20190402T074603.248440,3,7650,0,0,0,-1.43875278525,1.34758792793,0.103311177624,-3.89428399577,1.974,1,1
20190402T074603.248443,4,5610,0,0,0,-1.65926616144,1.55415705326,-0.441913633292,-3.89429308636,2.316,1,1
20190402T074603.248445,5,7650,0,0,0,-1.4075920521,1.31844970127,0.168733517959,-3.89430217694,1.936,1,1
20190402T074603.248447,6,6375,0,0,0,-1.61469862093,1.51246783492,-0.35041320169,-3.89431126753,2.24,1,1
20190402T074603.248450,7,9180,0,0,0,-1.36329599795,1.27700543537,0.229358104288,-3.89432035811,1.882,1,1
20190402T074603.248452,8,4590,0,0,0,-1.58349610771,1.48329488473,-0.266406384684,-3.8943294487,2.186,1,1
20190402T074603.248454,9,8670,0,0,0,-1.34506725777,1.25997640601,0.291906711765,-3.89433853928,1.866,1,1
20190402T074603.248457,10,7140,0,0,0,-1.5500302101,1.45199956809,-0.185816043538,-3.89434762987,2.132,1,1
20190402T074603.248459,11,10710,0,0,0,-1.30670167682,1.22408249054,0.348035607567,-3.89435672045,1.824,1,1
20190402T074603.248461,12,5355,0,0,0,-1.51443727024,1.41870937705,-0.108754117073,-3.89436581104,2.078,1,1
20190402T074603.248463,13,9690,0,0,0,-1.29417486805,1.21239189637,0.409410918906,-3.89437490162,1.82,1,1
20190402T074603.248466,14,4590,0,0,0,-1.4826938834,1.38902311111,-0.0354632898806,-3.89438399221,2.032,1,1
20190402T074603.248468,15,9690,0,0,0,-1.26742920267,1.18737964061,0.465356643094,-3.8943930828,1.798,1,1
20190402T074603.248486,0,5355,0,0,0,-1.73345985659,1.64211936719,-0.639800679493,-3.89993821358,2.472,1,1
20190402T074603.248489,1,4845,0,0,0,-1.44300565843,1.36699484274,0.0346953839973,-3.89994730417,1.988,1,1
20190402T074603.248491,2,5610,0,0,0,-1.67218941182,1.58413510701,-0.531784292469,-3.89995639475,2.364,1,1
20190402T074603.248493,3,7905,0,0,0,-1.4151241536,1.34063082462,0.102159786586,-3.89996548534,1.952,1,1

......

20190402T074604.599272,1,7650,0,0,0,0.888643238192,-0.658161541003,0.0193023615196,-0.63748143038,1.106,1,15
20190402T074604.599274,2,9180,0,0,0,0.873823393523,-0.647197725426,-0.251045376648,-0.637490520965,1.116,1,15
20190402T074604.599276,3,7905,0,0,0,0.897178433763,-0.664508277423,0.0585115990796,-0.63749961155,1.118,1,15
20190402T074604.599278,4,9180,0,0,0,0.881897418928,-0.65320258619,-0.213324456831,-0.637508702136,1.118,1,15
20190402T074604.599281,5,7650,0,0,0,0.888574758322,-0.658160858086,0.0967428744499,-0.637517792721,1.11,1,15
20190402T074604.599283,6,7650,0,0,0,0.869869942014,-0.644318582783,-0.171452173684,-0.637526883306,1.096,1,15
20190402T074604.599285,7,9180,0,0,0,0.885308445648,-0.655766450984,0.13527497118,-0.637535973892,1.11,1,15
20190402T074604.599288,8,5865,0,0,0,0.890087903145,-0.65931922595,-0.13600618724,-0.637545064477,1.116,1,15
20190402T074604.599290,9,8160,0,0,0,0.900011485009,-0.666682640831,0.177396683356,-0.637554155062,1.134,1,15
20190402T074604.599292,10,9435,0,0,0,0.893347787159,-0.661759090301,-0.0972658089064,-0.637563245647,1.116,1,15
20190402T074604.599295,11,9690,0,0,0,0.875545612537,-0.648584222729,0.211797984868,-0.637572336233,1.11,1,15
20190402T074604.599297,12,5355,0,0,0,0.881075332821,-0.652692918198,-0.0574648799548,-0.637581426818,1.098,1,15
20190402T074604.599299,13,9435,0,0,0,0.900378559533,-0.667005256837,0.258693712495,-0.637590517403,1.15,1,15
20190402T074604.599302,14,7650,0,0,0,0.883745024623,-0.654695487843,-0.019197647081,-0.637599607989,1.1,1,15
20190402T074604.599304,15,8925,0,0,0,0.884802113773,-0.655491057789,0.295053711417,-0.637608698574,1.14,1,15
20190402T074604.599377,1,7650,0,0,0,0.891406799823,-0.66784124357,0.0194419807711,-0.64298838702,1.114,1,15
20190402T074604.599379,2,9180,0,0,0,0.86400774863,-0.647326159934,-0.249245768213,-0.642997477605,1.108,1,15
20190402T074604.599381,3,7905,0,0,0,0.891907030154,-0.668241333965,0.0584069271671,-0.643006568191,1.116,1,15
20190402T074604.599384,4,7905,0,0,0,0.883000431798,-0.661580797914,-0.214469310803,-0.643015658776,1.124,1,15
20190402T074604.599386,5,8160,0,0,0,0.886531320447,-0.664238870391,0.0969171859354,-0.643024749361,1.112,1,15
20190402T074604.599388,6,8160,0,0,0,0.883697940305,-0.662128486654,-0.174893731915,-0.643033839947,1.118,1,15
20190402T074604.599391,7,8670,0,0,0,0.888038239905,-0.665393148561,0.136249925927,-0.643042930532,1.118,1,15
20190402T074604.599393,8,6120,0,0,0,0.881677756772,-0.66063985301,-0.13527497118,-0.643052021117,1.11,1,15
20190402T074604.599395,9,8160,0,0,0,0.899488109449,-0.673997892062,0.178022421216,-0.643061111703,1.138,1,15
20190402T074604.599398,10,9435,0,0,0,0.892878833886,-0.669058151947,-0.0976144318774,-0.643070202288,1.12,1,15
20190402T074604.599400,11,9690,0,0,0,0.887671631612,-0.665168855539,0.215614164775,-0.643079292873,1.13,1,15
20190402T074604.599402,12,5355,0,0,0,0.877467639425,-0.657535040384,-0.0574648799548,-0.643088383459,1.098,1,15
20190402T074604.599404,13,8670,0,0,0,0.888894436787,-0.666110389901,0.256444201952,-0.643097474044,1.14,1,15
20190402T074604.599407,14,7650,0,0,0,0.886527181011,-0.664349025331,-0.0193372663325,-0.643106564629,1.108,1,15
20190402T074604.599409,15,8670,0,0,0,0.890454522656,-0.667304751829,0.298159539958,-0.643115655214,1.152,1,15
20190402T074604.599427,0,8925,0,0,0,0.881954636735,-0.662538750634,-0.295571349507,-0.644279123877,1.142,1,15
20190402T074604.599430,1,6120,0,0,0,0.88893915722,-0.667798278049,0.0194070759583,-0.644288214462,1.112,1,15
20190402T074604.599432,2,9180,0,0,0,0.869397849315,-0.653130613637,-0.251045376648,-0.644297305048,1.116,1,15
20190402T074604.599434,3,7905,0,0,0,0.891037678514,-0.669400094359,0.0584069271671,-0.644306395633,1.116,1,15
20190402T074604.599437,4,9945,0,0,0,0.879000457877,-0.660369524309,-0.213706074822,-0.644315486218,1.12,1,15
20190402T074604.599439,5,8160,0,0,0,0.893631808734,-0.671374375509,0.0977887433629,-0.644324576804,1.122,1,15
20190402T074604.599441,6,6885,0,0,0,0.879677913189,-0.660903499231,-0.174267994055,-0.644333667389,1.114,1,15
20190402T074604.599444,7,7905,0,0,0,0.883998452022,-0.66416209948,0.135762448553,-0.644342757974,1.114,1,15

@icameling
Copy link
Author

icameling commented Nov 23, 2021

With the help of the following command

view-points --fields=t,id,,,,,x,y,z,,,, lidar.csv "lidar.bin;binary=3d,3ub"

I got the visualization of lidar.bin, and I think the meaning of 13 items in each row are

t,id,,,,,x,y,z,,,, 

The remaining work is to split lidar.csv into individual scan.
image

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

2 participants