Template Class GenericCloudIterator
Defined in File cloud.hpp
Inheritance Relationships
Base Type
public cras::impl::GenericCloudIteratorBase< unsigned char, unsigned char, unsigned char, ::sensor_msgs::msg::PointCloud2, GenericCloudIterator >
(Template Class GenericCloudIteratorBase)
Class Documentation
-
template<typename T = unsigned char>
class GenericCloudIterator : public cras::impl::GenericCloudIteratorBase<unsigned char, unsigned char, unsigned char, ::sensor_msgs::msg::PointCloud2, GenericCloudIterator> Generic non-const cloud iterator which can return the data in the raw type.
Public Functions
-
inline GenericCloudIterator(::sensor_msgs::msg::PointCloud2 &cloud_msg, const ::std::string &field_name)
- Parameters:
cloud_msg – [in] The PointCloud2 to iterate upon.
field_name – [in] The field to iterate upon.
-
template<typename D>
inline D *dataAs() const Return the raw data converted to the given datatype. The datatype has to have the same size as the field.
- Template Parameters:
D – Type of the data the field should be converted to.
- Throws:
std::runtime_error – If sizeof(D) is not the same as getFieldSize().
- Returns:
Pointer to the current raw data converted to the given datatype.
-
void copyData(const ::cras::impl::GenericCloudConstIterator<T> &otherIter) const
Copy all values of this field from another iterator.
- Parameters:
otherIter – The other iterator.
-
void copyData(const ::cras::impl::GenericCloudIterator<T> &otherIter) const
Copy all values of this field from another iterator.
- Parameters:
otherIter – The other iterator.
-
inline GenericCloudIterator(::sensor_msgs::msg::PointCloud2 &cloud_msg, const ::std::string &field_name)