ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Alright, I have gotten it. :)
void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& input)
{
// Create a container for the data.
sensor_msgs::PointCloud2 output;
output = *input;
// Publishing the camera frame id
ROS_INFO("Frame ID is: [%s]", output.header.frame_id.c_str());
// Publishing the name string in PointField array
for(int i = 0; i < output.fields.size(); ++i) {
ROS_INFO("PointField array consists of: [%s]", output.fields[i].name.c_str());
}
pub.publish (output);
}
2 | No.2 Revision |
Alright, I have gotten it. figured it out! :)
void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& input)
{
// Create a container for the data.
sensor_msgs::PointCloud2 output;
output = *input;
// Publishing the camera frame id
ROS_INFO("Frame ID is: [%s]", output.header.frame_id.c_str());
// Publishing the name string in PointField array
for(int i = 0; i < output.fields.size(); ++i) {
ROS_INFO("PointField array consists of: [%s]", output.fields[i].name.c_str());
}
pub.publish (output);
}