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 More... | |
PointCloud2Modifier (PointCloud2 &cloud_msg) | |
Default constructor. More... | |
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. More... | |
void | setPointCloud2FieldsByString (int n_fields,...) |
Function setting some fields in a PointCloud and adjusting the internals of the PointCloud2. More... | |
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.
|
inline |
Default constructor.
cloud_msg | The sensor_msgs::PointCloud2 to modify |
Definition at line 102 of file impl/point_cloud2_iterator.h.
remove all T's from the original sensor_msgs::PointCloud2
Definition at line 134 of file impl/point_cloud2_iterator.h.
size | The number of T's to reserve in the original sensor_msgs::PointCloud2 for |
Definition at line 111 of file impl/point_cloud2_iterator.h.
size | The number of T's to change the size of the original sensor_msgs::PointCloud2 by |
Definition at line 116 of file impl/point_cloud2_iterator.h.
|
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 166 of file impl/point_cloud2_iterator.h.
|
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 198 of file impl/point_cloud2_iterator.h.
Definition at line 106 of file impl/point_cloud2_iterator.h.
|
protected |
A reference to the original sensor_msgs::PointCloud2 that we read
Definition at line 166 of file point_cloud2_iterator.h.