Skip to main content
Question

Convert Pointcloud XYZ to PCD file format

  • April 11, 2019
  • 5 replies
  • 175 views

Hello,

I have a question regarding the PCD Writer. I am trying to write a .xyz point cloud (consisting of ~ 2 million points) to the PCD format. The point cloud represents a segment of a tunnel-like geometry. The output cloud has regular strokes of missing points. From certain angles the point cloud appears to be complete, but when orbitting around one can see these strokes of missing data. Imagine slicing bread and removing every other slice.

Any ideas on what could cause this issue?

 

Thanks!

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

daveatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • April 11, 2019

Hi @linulind,

It sounds like it might be a coordinate rounding issue. Are you writing to Ascii or binary, and if Ascii, what is floating point precision you are using?


  • Author
  • April 15, 2019

Hi @linulind,

It sounds like it might be a coordinate rounding issue. Are you writing to Ascii or binary, and if Ascii, what is floating point precision you are using?

Thanks for your reply @daveatsafe

I've tried writing to both. When it comes to Ascii, i have tried several floating point precisions; 8, 10 , 15.

The point cloud components x, y, z and intensity are structured as following:

x = xxxxxx.xxxx

y = yyyyyyy.yyyy

z = z.zzzzzzzzzzzzzzz

intensity = iiii

There are some differences in the precisions.

Thanks


daveatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • April 15, 2019

Thanks for your reply @daveatsafe

I've tried writing to both. When it comes to Ascii, i have tried several floating point precisions; 8, 10 , 15.

The point cloud components x, y, z and intensity are structured as following:

x = xxxxxx.xxxx

y = yyyyyyy.yyyy

z = z.zzzzzzzzzzzzzzz

intensity = iiii

There are some differences in the precisions.

Thanks

Hi @linulind,

Four decimal places should be OK for ascii. I think the binary file is 32 bit reals, so you may end up with some precision loss if you have large coordinate values (ie. above 100,000). Please try using the CommonLocalReprojector before writing out, and see if the gaps are still there.


  • Author
  • April 25, 2019

Hi @linulind,

Four decimal places should be OK for ascii. I think the binary file is 32 bit reals, so you may end up with some precision loss if you have large coordinate values (ie. above 100,000). Please try using the CommonLocalReprojector before writing out, and see if the gaps are still there.

Thanks @daveatsafe, the gaps are not appearing when using the CommonLocalReprojector!

Is there an efficient way to restore the original coordinates?


daveatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • April 25, 2019

Thanks @daveatsafe, the gaps are not appearing when using the CommonLocalReprojector!

Is there an efficient way to restore the original coordinates?

Hi @linulind,

There are a couple of ways you could do that. The first is to use an Offsetter instead of the CommonLocalReprojector to make the coordinate values smaller. You can then apply the reverse offset once you get the PCD data into the desired application.

Another method is to extract the origin lat/long from the local coordinate system, then store the lat/long of the origin in a sidecar file to send along with the PCD. I am attaching a workspace illustrating a simple way to do this.