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 can always write a node to do this. I have done something similar for LiDAR data so it should be also quite simple for the RGBD data you have.

What you need to do is the following:
Subscribe to the topic where you have the RGBD data. From camera_info you can get the camera model:

camera_model.fromCameraInfo(info_msg);

Using pcl_ros::transformPointCloud you can transform your pointcloud to the camera frame (you can get the camera frame with camera_model.tfFrame()) .
Then project those points from 3D to 2D onto the image frame. You can create an object from image_geometry::PinholeCameraModel:

pixel2d = cam_model_.project3dToPixel(point3d);

You will need to also pass the RGB values for each point.

You can always write a node to do this. I have done something similar for LiDAR data so it should be also quite simple for the RGBD data you have.

What you need to do is the following:
Subscribe to the topic where you have the RGBD data. From camera_info you can get the camera model:

camera_model.fromCameraInfo(info_msg);

Using pcl_ros::transformPointCloud you can transform your pointcloud to the camera frame (you can get the camera frame with camera_model.tfFrame()) .
Then project those points from 3D to 2D onto the image frame. You can create an object from image_geometry::PinholeCameraModel:

pixel2d = cam_model_.project3dToPixel(point3d);
camera_model.project3dToPixel(point3d);

You will need to also pass the RGB values for each point.