# Working with PointCloud2 Data

PointCloud2 is a common sensor message type used for point cloud data from LiDAR sensors. I will be using Ouster 0 - 64 Channel LiDAR and Ouster 2 - 128 Channel LiDAR for my explanations. These LiDARs are 3D LiDARs.

A 64 Channel LiDAR means the sensor has 64 laser emitters stacked on top of each other. So yes, a 128 Channel LiDAR will have 128 laser emitters stacked on top of each other. These laser emitters are then rotated about the central axis.&#x20;

<figure><img src="https://1375086659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPvjB9UuBzGwkyWVheSoO%2Fuploads%2FM2rz4YAmNHOS9PldMJ7b%2Fimage.png?alt=media&#x26;token=45382594-1048-4653-b30e-7046e1ce8271" alt=""><figcaption><p>LiDAR Channel Types</p></figcaption></figure>

In the case of an Ouster 64-Channel LiDAR, at one timestamp, you will have a column of laser points and a column of laser reflections received by the sensor. Each receiver sensor will give a measurement for a single "point".&#x20;

With 64 "points" in this single instance, we obtain a "column" in a scan. As the emitters rotate, these "columns" are then stacked next to each other to form a 2D "picture".&#x20;

In one full revolution, this 2D "picture" obtained in the end is known as a "frame" and it contains all the measurements in a single revolution.&#x20;

All information about a single "frame" is then packaged into a single data structure called the PointCloud2 data structure.

Documentation on PointCloud2 Data Structure: <https://docs.ros.org/en/api/sensor_msgs/html/msg/PointCloud2.html>

<figure><img src="https://1375086659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPvjB9UuBzGwkyWVheSoO%2Fuploads%2Fd9PVp78WDlj5zSNZhYrd%2Fimage.png?alt=media&#x26;token=ab4d6f61-7c3f-4289-9fa8-235476018200" alt=""><figcaption><p>Compact Message Definition of PointCloud2 Data</p></figcaption></figure>

For an Ouster 0 - 64 Channel LiDAR operating at 1024x10 Mode (1024 divisions in one revolution and 10Hz Rotation Speed)

<figure><img src="https://1375086659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPvjB9UuBzGwkyWVheSoO%2Fuploads%2FjBil3ZunUjqdNWoRepCR%2Fimage.png?alt=media&#x26;token=962a665d-11f6-4350-a186-29f1e70e4849" alt=""><figcaption><p>Column-Diagram of PointCloud2 Data of an Ouster 0 - 64 Channel LiDAR</p></figcaption></figure>

Here is an example of a single timestamp of a LiDAR PointCloud2 Data of an Ouster 2 - 128 Channel LiDAR operating at (1024x10 Mode). Try to look at the PointCloud2 Data Documentation and see if you can decipher the data content!

<figure><img src="https://1375086659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPvjB9UuBzGwkyWVheSoO%2Fuploads%2F4OjTlVXzJi1OWbA6L7dZ%2Fimage.png?alt=media&#x26;token=4ca623a3-6cab-483c-ad81-92942e3dfabb" alt=""><figcaption><p>Visualisation of PointCloud2 Data of an Ouster 2 - 128 Channel LiDAR</p></figcaption></figure>
