필터 지우기
필터 지우기

real time pointcloud streaming in simulink on ubuntu

조회 수: 2 (최근 30일)
I have an intenrealsense camera and i am working on ubuntu 18.04. I want to stream live feeds of point cloud in simulink via ros(i was able to stream color feed) I realized point clouds cant just be treated as pixels. Also there are some functions 'pcfromkinect' that say it helps in streaming pointclouds live but on windows. Please guide me through. I want to publish pointclouds as ros messages in simulink.

채택된 답변

Cam Salzberger
Cam Salzberger 2022년 2월 7일
Hello Abirami,
If you are broadcasting the point cloud data over the ROS network already, then you can simply create a rossubscriber and a pcplayer, set up something like this:
rosinit(<masterURI>)
player = pcplayer(<map limits>);
pcSub = rossubscriber(<point cloud topic>, "sensor_msgs/PointCloud2", ...
"DataFormat", "struct", ...
"NewMessageFcn", @(~, msg) processLidarMsg(msg, player)
function processLidarMsg(msg, player)
xyz = rosReadXYZ(msg);
rgb = rosReadRGB(msg);
view(player, xyz, rgb)
end
This code makes several assumptions about the type of the point cloud message and the structure of its fields (as well as your release of MATLAB). But it can serve as a starting point for your code.
If you are working with velodyne_msgs/VelodyneScan instead of sensor_msgs/PointCloud2, check out this documentation.
-Cam

추가 답변 (1개)

Abirami Jambulingam Segar
Abirami Jambulingam Segar 2022년 2월 25일
Many thanks for the response.
Is it possible to use the inbuilt matlab function, 'bboxCameraToLidar' for real time point clouds?
The problem I face is that, I am using a simulink ROS block called as 'Read a Point cloud' which does the exact job that your code snippet does. Now that i am able to stream the point cloud stream, I want to build my work further. I am not able to declare these live stream of xyz data as point clouds. Please help me resolve the issue. Thank you

카테고리

Help CenterFile Exchange에서 Specialized Messages에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by