Enables modifying a sensor_msgs::PointCloud2 like a container. More...
#include <point_cloud2_iterator.h>
Public Member Functions | |
void | clear () |
remove all T's from the original sensor_msgs::PointCloud2 | |
PointCloud2Modifier (PointCloud2 &cloud_msg) | |
Default constructor. | |
void | reserve (size_t size) |
void | resize (size_t size) |
void | setPointCloud2Fields (int n_fields,...) |
Function setting some fields in a PointCloud and adjusting the internals of the PointCloud2. | |
void | setPointCloud2FieldsByString (int n_fields,...) |
Function setting some fields in a PointCloud and adjusting the internals of the PointCloud2. | |
size_t | size () const |
Protected Attributes | |
PointCloud2 & | cloud_msg_ |
Enables modifying a sensor_msgs::PointCloud2 like a container.
Definition at line 105 of file point_cloud2_iterator.h.
sensor_msgs::PointCloud2Modifier::PointCloud2Modifier | ( | PointCloud2 & | cloud_msg | ) | [inline] |
Default constructor.
cloud_msg | The sensor_msgs::PointCloud2 to modify |
Definition at line 101 of file impl/point_cloud2_iterator.h.
void sensor_msgs::PointCloud2Modifier::clear | ( | ) | [inline] |
remove all T's from the original sensor_msgs::PointCloud2
Definition at line 133 of file impl/point_cloud2_iterator.h.
void sensor_msgs::PointCloud2Modifier::reserve | ( | size_t | size | ) | [inline] |
size | The number of T's to reserve in the original sensor_msgs::PointCloud2 for |
Definition at line 110 of file impl/point_cloud2_iterator.h.
void sensor_msgs::PointCloud2Modifier::resize | ( | size_t | size | ) | [inline] |
size | The number of T's to change the size of the original sensor_msgs::PointCloud2 by |
Definition at line 115 of file impl/point_cloud2_iterator.h.
void sensor_msgs::PointCloud2Modifier::setPointCloud2Fields | ( | int | n_fields, |
... | |||
) | [inline] |
Function setting some fields in a PointCloud and adjusting the internals of the PointCloud2.
n_fields | the number of fields to add. The fields are given as triplets: name of the field as char*, number of elements in the field, the datatype of the elements in the field |
E.g, you create your PointCloud2 message with XYZ/RGB as follows:
setPointCloud2Fields(cloud_msg, 4, "x", 1, sensor_msgs::PointField::FLOAT32, "y", 1, sensor_msgs::PointField::FLOAT32, "z", 1, sensor_msgs::PointField::FLOAT32, "rgb", 1, sensor_msgs::PointField::FLOAT32);
WARNING: THIS DOES NOT TAKE INTO ACCOUNT ANY PADDING AS DONE UNTIL HYDRO For simple usual cases, the overloaded setPointCloud2FieldsByString is what you want.
n_fields | the number of fields to add. The fields are given as triplets: name of the field as char*, number of elements in the field, the datatype of the elements in the field |
E.g, you create your PointCloud2 message with XYZ/RGB as follows:
setPointCloud2FieldsByString(cloud_msg, 4, "x", 1, sensor_msgs::PointField::FLOAT32, "y", 1, sensor_msgs::PointField::FLOAT32, "z", 1, sensor_msgs::PointField::FLOAT32, "rgb", 1, sensor_msgs::PointField::FLOAT32);
WARNING: THIS DOES NOT TAKE INTO ACCOUNT ANY PADDING AS DONE UNTIL HYDRO For simple usual cases, the overloaded setPointCloud2FieldsByString is what you want.
Definition at line 165 of file impl/point_cloud2_iterator.h.
void sensor_msgs::PointCloud2Modifier::setPointCloud2FieldsByString | ( | int | n_fields, |
... | |||
) | [inline] |
Function setting some fields in a PointCloud and adjusting the internals of the PointCloud2.
n_fields | the number of fields to add. The fields are given as strings: "xyz" (3 floats), "rgb" (3 uchar stacked in a float), "rgba" (4 uchar stacked in a float) |
WARNING: THIS FUNCTION DOES ADD ANY NECESSARY PADDING TRANSPARENTLY
Definition at line 197 of file impl/point_cloud2_iterator.h.
size_t sensor_msgs::PointCloud2Modifier::size | ( | ) | const [inline] |
Definition at line 105 of file impl/point_cloud2_iterator.h.
PointCloud2& sensor_msgs::PointCloud2Modifier::cloud_msg_ [protected] |
A reference to the original sensor_msgs::PointCloud2 that we read
Definition at line 166 of file point_cloud2_iterator.h.