How to change PointCloud2 Piont Data type?
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Cam Salzberger
2019 年 6 月 12 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Specialized Messages についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!