Provides getters and setters for given field names. More...
#include <point_cloud_accessor.h>
Public Member Functions | |
template<class T > | |
T | getField (uint32_t pointIndex, uint32_t fieldIndex) |
PointCloudAccessor (sensor_msgs::PointCloud2::Ptr pcl, std::vector< std::string > fieldNames) | |
template<class T > | |
void | setField (uint32_t pointIndex, uint32_t fieldIndex, T value) |
template<> | |
void | setField (uint32_t pointIndex, uint32_t fieldIndex, float value) |
Private Attributes | |
std::vector< std::string > | fieldNames |
std::vector< uint32_t > | fieldOffsets |
sensor_msgs::PointCloud2::Ptr | pcl |
Provides getters and setters for given field names.
Given a set field names, it provides getters and setters for the corresponding fields. It does not handle memory allocation, nor any sanity checks; this has be ensured by the user.
Definition at line 13 of file point_cloud_accessor.h.
point_cloud_color::PointCloudAccessor::PointCloudAccessor | ( | sensor_msgs::PointCloud2::Ptr | pcl, |
std::vector< std::string > | fieldNames | ||
) |
Definition at line 8 of file point_cloud_accessor.cpp.
float point_cloud_color::PointCloudAccessor::getField | ( | uint32_t | pointIndex, |
uint32_t | fieldIndex | ||
) |
Definition at line 18 of file point_cloud_accessor.cpp.
void point_cloud_color::PointCloudAccessor::setField | ( | uint32_t | pointIndex, |
uint32_t | fieldIndex, | ||
T | value | ||
) |
Definition at line 24 of file point_cloud_accessor.cpp.
void point_cloud_color::PointCloudAccessor::setField | ( | uint32_t | pointIndex, |
uint32_t | fieldIndex, | ||
float | value | ||
) |
Definition at line 27 of file point_cloud_accessor.cpp.
std::vector<std::string> point_cloud_color::PointCloudAccessor::fieldNames [private] |
Definition at line 20 of file point_cloud_accessor.h.
std::vector<uint32_t> point_cloud_color::PointCloudAccessor::fieldOffsets [private] |
Definition at line 21 of file point_cloud_accessor.h.
sensor_msgs::PointCloud2::Ptr point_cloud_color::PointCloudAccessor::pcl [private] |
Definition at line 19 of file point_cloud_accessor.h.