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

adding rgb data into a point cloud?

asked 2012-09-18 06:24:16 -0500

thornsap gravatar image

updated 2012-09-18 23:47:44 -0500

Hi, i'm currently working on a single line ladar which we've managed to transform into a point cloud via rviz so now i want to add some rgb data from a camera onto this point cloud.

assuming i have worked out which pixel to add to which point cloud point, is it possible to do this?

thanks

*edit:

im using pointcloud and not pointcloud2 at the moment

edit retag flag offensive close merge delete

Comments

thanks for the answer, but we're currently using pointcloud 1, is it still possible to do this?

thornsap gravatar image thornsap  ( 2012-09-18 23:36:39 -0500 )edit
1

Yes, by using the channels, but I'd recommed switching to pointcoud2, if possible.

dornhege gravatar image dornhege  ( 2012-09-19 00:50:18 -0500 )edit

thanks, i'll do that in that case

thornsap gravatar image thornsap  ( 2012-09-19 00:57:53 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-09-18 10:06:12 -0500

yes it is possible and quit common. Just check this link and you will find a description of the data type PointCloud2.

edit flag offensive delete link more
2

answered 2012-09-20 12:31:24 -0500

dejanpan gravatar image

I think that PointCloud2 type is not that super easy to use. I'd suggest you to go over the pcl::PointCloud<pcl::pointxyzrgb> cloud and then convert pcl point cloud back to PointCloud2 using pcl::toROSMsg() method as suggested here: http://www.pcl-users.org/Combine-sensor-msgs-PointCloud2-msg-rgb-sensor-msgs-Image-into-a-properly-colored-PointCloud2-td2814133.html.

edit flag offensive delete link more

Comments

Also if it is true that sensor_msg::PointCloud is easier to understand, it is still not any longer standard. PointCloud2 is the current standard in ROS. To use the PCL is of course an option, but it takes more load and computational power if you need to convert a lot in between ROS and PCL.

tlinder gravatar image tlinder  ( 2012-09-21 00:13:17 -0500 )edit

I was not alluding to sensor_msg::PointCloud at all and fully agree with what you are saying.

dejanpan gravatar image dejanpan  ( 2012-09-21 14:42:54 -0500 )edit

Question Tools

Stats

Asked: 2012-09-18 06:24:16 -0500

Seen: 6,329 times

Last updated: Sep 20 '12