Ask Your Question
0

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

Hi

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
3

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 841 times

Last updated: Jun 06 '13