MATLAB Answers

0

How to change PointCloud2 Piont Data type?

Li Jack 님이 질문을 제출함. 11 Jun 2019
최근 활동 Cam Salzberger 님이 답변함. 12 Jun 2019
I extraced points data from a simulation software, when put x,y,z directly into a bus assigment with PointCloud2 messagetype,I found the Data is uint8, can't accept float format x,y,z,if change data into uint, the微信图片_20190611175118.jpg accuracy will be very low. I tried to define Fields in simulink or matlab worktable,they all didn't work, the Data'type is still uint.

  댓글 수: 0

로그인 to comment.

답변 수: 1

Cam Salzberger 님의 답변 12 Jun 2019

The data type in the sensor_msgs/PointCloud2 ROS message type is hard-locked by the message definition. Note, however, that the uint8 data type does not mean that all of the XYZ positions in the point cloud are expected to be at integer values. The "fields" field in the message helps to define exactly how the data contained in the message should be read, including an option for float64.
When extracting the data from a pointcloud2 message, you can pass the output of the Subscribe block directly to a Read Point Cloud block. Assuming the message has been created correctly, the data will be parsed and output in its correct data type. Sebastian has posted a functionality for creating PointCloud2 messages (from CVST point cloud input).
-Cam

  댓글 수: 0

로그인 to comment.



Translated by