Public Member Functions | Protected Attributes
sensor_msgs::PointCloud2Modifier Class Reference

Enables modifying a sensor_msgs::PointCloud2 like a container. More...

#include <point_cloud2_iterator.h>

List of all members.

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_

Detailed Description

Enables modifying a sensor_msgs::PointCloud2 like a container.

Definition at line 105 of file point_cloud2_iterator.h.


Constructor & Destructor Documentation

sensor_msgs::PointCloud2Modifier::PointCloud2Modifier ( PointCloud2 &  cloud_msg) [inline]

Default constructor.

Parameters:
cloud_msgThe sensor_msgs::PointCloud2 to modify

Definition at line 101 of file impl/point_cloud2_iterator.h.


Member Function Documentation

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]
Parameters:
sizeThe 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]
Parameters:
sizeThe 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.

Parameters:
n_fieldsthe 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.

Parameters:
n_fieldsthe 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.

Parameters:
n_fieldsthe 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)
Returns:
void

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]
Returns:
the number of T's in the original sensor_msgs::PointCloud2

Definition at line 105 of file impl/point_cloud2_iterator.h.


Member Data Documentation

A reference to the original sensor_msgs::PointCloud2 that we read

Definition at line 166 of file point_cloud2_iterator.h.


The documentation for this class was generated from the following files:


sensor_msgs
Author(s):
autogenerated on Thu Jun 6 2019 18:15:45