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

About count > 1 #3

Open
mxlnk opened this issue Mar 2, 2020 · 0 comments
Open

About count > 1 #3

mxlnk opened this issue Mar 2, 2020 · 0 comments

Comments

@mxlnk
Copy link

mxlnk commented Mar 2, 2020

Hi,

I'm currently trying to write a pcd file like this:

def make_xyz_label_layers_point_cloud(points, labels, layers):
    assert(len(points) == len(labels) and len(points) == len(layers))
    md = {'version': .7,
          'fields': ['x', 'y', 'z', 'label', 'layers'],
          'type': ['F', 'F', 'F', 'I', 'F'],
          'size': [4, 4, 4, 4, 4],
          'count': [1, 1, 1, 1, len(layers[0])],
          'width': len(points),
          'height': 1,
          'viewpoint': [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0],
          'points': len(points),
          'data': 'ASCII'}

    dt = np.dtype([('x', np.float32), ('y', np.float32), ('z', np.float32),
                   ('label', np.int32), ('layers', np.float32, (len(layers[0]),))]) # len(layers[0]) == 20
    pc_data = np.rec.fromarrays([points[:, 0], points[:, 1], points[:, 2],
                                 labels, layers], dtype=dt)

    pc = pypcd.PointCloud(md, pc_data)
    return pc

Writing this to ascii I get an error as the package tries to write it as 24 consecutive values but gets 4 consecutive values and an array with 20 values.

Do you happen to know if the format of wanting to write 24 consecutive values is correct (I think so)?

Am I using this right? If so would you be interested in a pull request fixing the saving problem?

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

1 participant