PCL ROS Publisher, latched or not?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PCL ROS Publisher, latched or not?

Gonçalo Cabrita
Hi everyone!

I was browsing the pcl wiki but I was not able to find an answer for this question.

Are the PCL ROS publishers for PointCloud2 latched or not?

On a regular ROS publisher you can define if you want it to be latched or not, on a PCL ROS publisher that option does not seem to exist. Due to the nature of the PointCloud2 data structure I would say that latching would be nice.

Thanks for the help in advance,

Gonçalo Cabrita
ISR - University of Coimbra
Portugal




_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: PCL ROS Publisher, latched or not?

Radu B. Rusu
Administrator
Gonçalo,


On 12/16/2010 04:15 AM, Gonçalo Cabrita wrote:
> Hi everyone!
>
> I was browsing the pcl wiki but I was not able to find an answer for this question.
>
> Are the PCL ROS publishers for PointCloud2 latched or not?

Nope, by default they are not.

> On a regular ROS publisher you can define if you want it to be latched or not, on a PCL ROS publisher that option does
> not seem to exist. Due to the nature of the PointCloud2 data structure I would say that latching would be nice.

Good point. Do you have time to contribute this change? It shouldn't take too many lines of code to add this to the
pcl_ros::Publisher class.

> Thanks for the help in advance,


Cheers,
Radu.
--
http://pointclouds.org
_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: PCL ROS Publisher, latched or not?

Patrick Mihelich
Proper support for using pcl::PointCloud<T> with the standard ros::Publisher and ros::Subscriber has finally bubbled back up to the top of my priority list, so we'll soon (tomorrow?) be able to do away with pcl_ros::Publisher/Subscriber. Then of course you'll have all the options you usually get from ROS.

Cheers,
Patrick

On Thu, Dec 16, 2010 at 9:18 AM, Radu Bogdan Rusu <[hidden email]> wrote:
Gonçalo,


On 12/16/2010 04:15 AM, Gonçalo Cabrita wrote:
> Hi everyone!
>
> I was browsing the pcl wiki but I was not able to find an answer for this question.
>
> Are the PCL ROS publishers for PointCloud2 latched or not?

Nope, by default they are not.

> On a regular ROS publisher you can define if you want it to be latched or not, on a PCL ROS publisher that option does
> not seem to exist. Due to the nature of the PointCloud2 data structure I would say that latching would be nice.

Good point. Do you have time to contribute this change? It shouldn't take too many lines of code to add this to the
pcl_ros::Publisher class.

> Thanks for the help in advance,


Cheers,
Radu.
--
http://pointclouds.org
_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: PCL ROS Publisher, latched or not?

Radu B. Rusu
Administrator
Hooray! Patrick and I just brainstormed on a new solution that should cover the latched case.

First, let me explain really quickly how pcl_ros works (maybe someone can find it in their hearts to copy this to a wiki
page in a better form ;) ):

  * most nodelets implement a "use_indices" ROS parameter
  * all nodelets that need to subscribe to multiple topics implement an "approximate_sync" ROS parameter

  * if "approximate_sync", then use an ApproximateTimeSynchronizer, if not, use an ExactTimeSynchronizer. This code is a
hog btw, and this is what contributes to PCL_ROS compiling so slowly most of the time.  Each
message_filter<Synchronizer> object takes about 150MB extra RAM and about 5seconds more to compile. It's on our todo
list to change this in the future and make it more efficient.

  * if "use_indices" is set, we point to a callback function that expects PointCloud+PointIndices. If not, we point to a
callback function that expects PointCloud only. In the former case, we expect PointIndices + PointCloud to be at least
approximately synchronized, time-wise.


The new changes, introduce a new parameter: "latched_indices". If "latched_indices" is set to true, then we create a
separate Subscriber and point to a callback that expects only PointIndices, which will store the data in a member of the
class. This would enable cases such as the ones described below to function (send indices once, use them for N point
cloud messages).

Moreover, we realized that the current code structure from the callback that expects PointCloud and the callback that
expects PointCloud+PointIndices is not extremely good because a lot of code gets repeated twice. To solve this, we'll
use some boost::bind magic and make sure that we only create 1 callback that always uses PointCloud+PointIndices. This
means that:

  * when "use_indices" is set to false, we'll pass an empty shared_ptr;
  * when "use_indices" is set to true, and "latched_indices" is set to false, we'll subscribe to both
PointCloud+PointIndicies using a time synchronizer;
  * when "use_indices" is set to true, and "latched_indices" is set to true, we'll subscribe and get a separate callback
for PointIndices that will save the indices internally, and a PointCloud + PointIndices callback will take care of
meshing the new PointClouds with the old saved indices.


If no one has any additions to this scheme, we'll implement it today, so this will make it in 0.7 (which we should
release asap :) ).


Cheers,
Radu.
--
http://pointclouds.org

On 12/16/2010 06:12 PM, Patrick Mihelich wrote:

> Proper support for using pcl::PointCloud<T> with the standard ros::Publisher and ros::Subscriber has finally bubbled
> back up to the top of my priority list, so we'll soon (tomorrow?) be able to do away with pcl_ros::Publisher/Subscriber.
> Then of course you'll have all the options you usually get from ROS.
>
> Cheers,
> Patrick
>
> On Thu, Dec 16, 2010 at 9:18 AM, Radu Bogdan Rusu <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Gonçalo,
>
>
>     On 12/16/2010 04:15 AM, Gonçalo Cabrita wrote:
>      > Hi everyone!
>      >
>      > I was browsing the pcl wiki but I was not able to find an answer for this question.
>      >
>      > Are the PCL ROS publishers for PointCloud2 latched or not?
>
>     Nope, by default they are not.
>
>      > On a regular ROS publisher you can define if you want it to be latched or not, on a PCL ROS publisher that option
>     does
>      > not seem to exist. Due to the nature of the PointCloud2 data structure I would say that latching would be nice.
>
>     Good point. Do you have time to contribute this change? It shouldn't take too many lines of code to add this to the
>     pcl_ros::Publisher class.
>
>      > Thanks for the help in advance,
>
>
>     Cheers,
>     Radu.
>     --
>     http://pointclouds.org
>     _______________________________________________
>     [hidden email] <mailto:[hidden email]> / http://pointclouds.org
>     https://code.ros.org/mailman/listinfo/pcl-users
>
>
_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users