how to convert .bag file into .pcd in matlab (Lidar Data) ?

Technical Source
2 min readJun 7, 2023

I’m using L515 Lidar for data collection, I’m getting data .bag format from Realsense Viewer . I need to convert to .pcd format, How can I achieve that using Matlab ?

NOTE:- provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

To achieve this with MATLAB, you would need both ROS Toolbox license and Computer Vision Toolbox license. You can check whether you have these with:

>> ver

If you have both licenses, you can follow these steps and examples to read from .bag format, convert to point cloud, and save to .pcd format:

  • Read .bag files with rosbagreader, this example shows how to read specific message from the .bag file. You would need to select the topic that correspond to the sensor_msgs/PointCloud2 message in .bag file.
  • Use rosReadXYZ (and rosReadRGB if you also want the color of the point cloud) from each of those ROS messages.




Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.