Skip to content

Error when trying to publish a PointCloud2 message from dora to ros2 #10

Answered by haixuanTao
GoAfteraDeer asked this question in Q&A
Discussion options

You must be logged in to vote

It's possible that the error comes from downcasting your data to uint8. Can you replace your line with:

               "data": np.asarray(points, np.float32).ravel().view(np.uint8),

Basically you need to .view(np.uint8) https://numpy.org/doc/stable/reference/generated/numpy.ndarray.view.html your data as uint8 to interpret your float32 as uint8.

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@GoAfteraDeer
Comment options

@haixuanTao
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@phil-opp
Comment options

@haixuanTao
Comment options

Answer selected by haixuanTao
@GoAfteraDeer
Comment options

@phil-opp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants