ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You need to allocate enough space in your new point cloud before you try to put any data into it:
sensor_msgs::PointCloud2Modifier modifier(lidarscan);
// create iterators
modifier.resize(<number_of_points_to_allocate>);
// loop through all your points, incrementing the pc iterators