Convert Struct to Pointcloud using ROS2
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to convert one structure (a) to point to cloud2.However, I am having problems converting this. Already tried this
ptCloud = pointCloud('a');
댓글 수: 0
채택된 답변
Josh Chen
2021년 9월 10일
Hello Manuel,
The function pointCloud takes 3-D coordinate points as input argument. However, the variable 'a' here in the screenshot seems to be an 'sensor_msgs/PointCloud2' message struct. To return a point cloud, you would have to first use rosReadXYZ to extract the 3-D coordinate points and use it as the input to the pointCloud function.
In this case, the following code shall return the point cloud from a:
>> pts = rosReadXYZ(a);
>> ptCloud = pointCloud(pts);
Hope this helps,
Josh
댓글 수: 0
추가 답변 (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!