Copy sensor_msgs::LaserScanPtr& from callback function
I have a local class member that I have defined as follows
sensor_msgs::LaserScan *current_scan_ = new sensor_msgs::LaserScan;
I also have a callback function which is called when a new laser scan is available on a /scan topic:
void CallbackHandler::getCurLaserScan(const sensor_msgs::LaserScanConstPtr& laser_in)
The question is, how can I assign a LaserScanConstPtr& object to a LaserScan* object? Is this assignment even possible? What is the advised way in manipulating incoming laser scans from the function?
The purpose of this, is to have a LaserScan object on the heap with the most recent laser scan contents.
Thanks in advance,