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

const sensor_msgs::PointCloud2ConstPtr& cloud initialize

asked 2013-06-06 06:24:10 -0500

Sentinal_Bias gravatar image

updated 2014-01-28 17:16:47 -0500

ngrennan gravatar image


I have a function which takes a

const sensor_msgs::PointCloud2ConstPtr& input

as input. I currently have a sensor_msgs::PointCloud2 but i cant turn it into a pointer for some reason.

Is the sensor_msgs::PointCloud2ConstPtr are boost shared_ptr? If so how do you initialize the pointer to an object that already exists?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-06 06:40:09 -0500

mjcarroll gravatar image

You should be able to use the Boost make_shared function to create a pointer to the existing cloud.

sensor_msgs::PointCloud2 p;

const sensor_msgs::PointCloud2ConstPtr& input = boost::make_shared<sensor_msgs::PointCloud2>(p);
edit flag offensive delete link more

Question Tools


Asked: 2013-06-06 06:24:10 -0500

Seen: 1,306 times

Last updated: Jun 06 '13