-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
Bug report
Required Info:
- Operating System:
- Ubuntu 22.04
- Installation type:
- apt
- Version or commit hash:
- DDS implementation:
- CycloneDDS
- Client library (if applicable):
- rclcpp
Steps to reproduce issue
sensor_msgs::msg::PointCloud2::SharedPtr pcl(new sensor_msgs::msg::PointCloud2);
sensor_msgs::PointCloud2Modifier modifier(*pcl);
modifier.setPointCloud2FieldsByString(2, "xyz", "intensity");
Expected behavior
Intensity field is created with correct datatype as expected.
Actual behavior
The code crashes with a runtime error.
[deskew_node-1] terminate called after throwing an instance of 'std::runtime_error'
[deskew_node-1] what(): Field intensity does not exist
Additional information
The intensity field is claimed to be supported here:
# Common PointField names are x, y, z, intensity, rgb, rgba |
Yet it is not implemented here:
common_interfaces/sensor_msgs/include/sensor_msgs/impl/point_cloud2_iterator.hpp
Line 195 in c0c0bc5
inline void PointCloud2Modifier::setPointCloud2FieldsByString(int n_fields, ...) |
Was there a reason for not including the intensity field?
In the meantime, I think I can work around this as follows:
modifier.setPointCloud2Fields(
4, // Number of fields
"x", 1, sensor_msgs::msg::PointField::FLOAT32, // x field
"y", 1, sensor_msgs::msg::PointField::FLOAT32, // y field
"z", 1, sensor_msgs::msg::PointField::FLOAT32, // z field
"intensity", 1, sensor_msgs::msg::PointField::FLOAT32 // intensity field
);
Thank you for your time.
Metadata
Metadata
Assignees
Labels
No labels