46 #ifndef SENSOR_MSGS_POINT_FIELD_CONVERSION_H 47 #define SENSOR_MSGS_POINT_FIELD_CONVERSION_H 90 template<
int po
int_field_type,
typename T>
93 return static_cast<T>(*(
reinterpret_cast<type
const *
>(data_ptr)));
107 return readPointCloud2BufferValue<sensor_msgs::PointField::INT8, T>(data_ptr);
109 return readPointCloud2BufferValue<sensor_msgs::PointField::UINT8, T>(data_ptr);
111 return readPointCloud2BufferValue<sensor_msgs::PointField::INT16, T>(data_ptr);
113 return readPointCloud2BufferValue<sensor_msgs::PointField::UINT16, T>(data_ptr);
115 return readPointCloud2BufferValue<sensor_msgs::PointField::INT32, T>(data_ptr);
117 return readPointCloud2BufferValue<sensor_msgs::PointField::UINT32, T>(data_ptr);
119 return readPointCloud2BufferValue<sensor_msgs::PointField::FLOAT32, T>(data_ptr);
121 return readPointCloud2BufferValue<sensor_msgs::PointField::FLOAT64, T>(data_ptr);
133 template<
int po
int_field_type,
typename T>
136 *(
reinterpret_cast<type*
>(data_ptr)) =
static_cast<type
>(
value);
151 writePointCloud2BufferValue<sensor_msgs::PointField::INT8, T>(data_ptr,
value);
154 writePointCloud2BufferValue<sensor_msgs::PointField::UINT8, T>(data_ptr,
value);
157 writePointCloud2BufferValue<sensor_msgs::PointField::INT16, T>(data_ptr,
value);
160 writePointCloud2BufferValue<sensor_msgs::PointField::UINT16, T>(data_ptr,
value);
163 writePointCloud2BufferValue<sensor_msgs::PointField::INT32, T>(data_ptr,
value);
166 writePointCloud2BufferValue<sensor_msgs::PointField::UINT32, T>(data_ptr,
value);
169 writePointCloud2BufferValue<sensor_msgs::PointField::FLOAT32, T>(data_ptr,
value);
172 writePointCloud2BufferValue<sensor_msgs::PointField::FLOAT64, T>(data_ptr,
value);
void writePointCloud2BufferValue(unsigned char *data_ptr, T value)
const char * datatype()
returns DataType<M>::value();
Tools for manipulating sensor_msgs.
T readPointCloud2BufferValue(const unsigned char *data_ptr)