How to change PointCloud2 Piont Data type?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 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 Kommentare
Antworten (1)
Cam Salzberger
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Specialized Messages finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!