publishing a vector of PointCloud2 vectors in ROS.
Hi all,
I have created a custom message for a vector of PointCloud2 with name clusterVector.msg, and inside that vector I have the following line:
sensor_msgs/PointCloud2[] clusterClouds
This message is inside one of my custom made packages Objectdetectionmodule. Now I am trying to use this so I am doing the following:
1) I am declaring the header:
objectdetectionmodule/clusterVector.h
2) I am instantiating an object of that type:
objectdetectionmodule::clusterVectorConstPtr msg1;
3) I am trying to push_back a type 2 point cloud as follows:
sensormsgs::PointCloud2::Ptr testmessage (new sensormsgs::PointCloud2 ()); msg1->clusterClouds.pushback(test_message);
Unfortunately, when I am trying to compile my code I get the following error:
error: no matching function for call to ‘std::vector
Any ideas what I am doing wrong? Any help would be greatly appreciated.
Best,
Akis
Asked by Zoid on 2016-05-02 11:56:59 UTC
Answers
You declare a
sensor_msgs/PointCloud2[] clusterClouds
and try to push a
sensor_msgs::PointCloud2::Ptr
inside. Second one is a pointer...
Asked by NEngelhard on 2016-05-02 12:31:21 UTC
Comments
Thank you for the answer. However, even if I do the following:
sensor_msgs::PointCloud2 test_message; object_detection_module::clusterVectorConstPtr msg1; msg1->clusterClouds.push_back(test_message);
I am receiving the compilation error:
error: passing ‘const clusterClouds_type {aka const std::vector<sensor_msgs::pointcloud2std::allocator<void >, std::allocator
Thx in advance,
Akis
Asked by Zoid on 2016-05-02 13:01:28 UTC
Comments
Please edit your question as this is no answer to your question!
Asked by NEngelhard on 2016-05-02 15:48:16 UTC
Sorry for that... Unfortunately, I am not familiar with your forum. Could you please let me know how to properly comment your answer since if I only try to "add a comment" to your text, it does not allow me due to max text length. Thx.
Asked by Zoid on 2016-05-03 07:49:24 UTC
Just edit your original question. And BTW: you try to change a Const(!!)Ptr
Asked by NEngelhard on 2016-05-03 08:12:48 UTC
Comments