How to access Intensity from ROS PointCloud2 message?

21 ビュー (過去 30 日間)
Rita Chattopadhyay
Rita Chattopadhyay 2017 年 4 月 26 日
コメント済み: Pasindu Ranasinghe 2024 年 1 月 23 日
I am able to access xyz using readxyz function from ROS PointCloud2 message. How can I access Intensity and ring values?
  1 件のコメント
Pasindu Ranasinghe
Pasindu Ranasinghe 2024 年 1 月 23 日
% Visualize point cloud data for PointCloud2 messages
Point_to_display=34;
Data_Range=1:200;
bSel = select(bag,'Topic','/livox/lidar');
msgStructs = readMessages(bSel,Data_Range,'DataFormat','struct');
intensities=msgStructs{Point_to_display}
%intensities=msgStructs{Point_to_display}.readFile('intensity')
pc2msg=msgStructs{Point_to_display};
intensities=rosReadField(pc2msg,'intensity');
pcobj = pointCloud(rosReadXYZ(msgStructs{Point_to_display}),"Intensity",intensities);
viewer = pcviewer(pcobj);

サインインしてコメントする。

回答 (1 件)

Will Nitsch
Will Nitsch 2017 年 5 月 1 日
With PointCloud2 objects you should be able to get the intensity values using 'readRGB': https://www.mathworks.com/help/robotics/ref/readrgb.html
Here is the documentation on 'PointCloud2' objects: https://www.mathworks.com/help/robotics/ref/pointcloud2-object.html
I wasn't able to find any mention of a 'ring' parameter in that documentation, perhaps it is described differently? Explore the different object properties of that object class.

カテゴリ

Help Center および File ExchangePublishers and Subscribers についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by