ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 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