Generic transport plugins and shared memory

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

Generic transport plugins and shared memory

Cedric Skybotix
Hi all,

I'm not quite sure who will be interested by this message, but since we
don't have (yet) our official ros repository, I'll send the info here.
Please feel free to contact me or discuss on the list if you want more
information.

Given the long travel time coming back from ICRA, and my experience with
the image_transport plugin architecture, I found that being only able to
make transport_plugin and shared memory only for sensor_msgs::Image was
a bit limiting.

So I've adapted the image_transport framework using templates to make it
generic, and integrated a generic shared memory transport into the
framework. I've also ported the compressed and theora transport, but
still keeping them specialised to Image.

The resulting framework allow to create a starting set of plugins (raw
and sharedmem) for (e.g) PointCloud using the following code:

manifest.cpp:
#include <pluginlib/class_list_macros.h>
#include <message_transport/raw_publisher.h>
#include <message_transport/raw_subscriber.h>
#include <sharedmem_transport/sharedmem_publisher.h>
#include <sharedmem_transport/sharedmem_subscriber.h>
#include <sensor_msgs/PointCloud.h>

// Raw class
PLUGINLIB_REGISTER_CLASS(raw_pub,
    message_transport::RawPublisher<sensor_msgs::PointCloud>,  
    message_transport::PublisherPlugin<sensor_msgs::PointCloud>)
PLUGINLIB_REGISTER_CLASS(raw_sub,
    message_transport::RawSubscriber<sensor_msgs::PointCloud>,
    message_transport::SubscriberPlugin<sensor_msgs::PointCloud>)

// Sharedmem class (the PointCloud message contains a header, which the
publisher uses)
PLUGINLIB_REGISTER_CLASS(sharedmem_pub,
   
sharedmem_transport::SharedmemPublisherWithHeader<sensor_msgs::PointCloud>,
 
    message_transport::PublisherPlugin<sensor_msgs::PointCloud>)
PLUGINLIB_REGISTER_CLASS(sharedmem_sub,
    sharedmem_transport::SharedmemSubscriber<sensor_msgs::PointCloud>,
    message_transport::SubscriberPlugin<sensor_msgs::PointCloud>)

Note that a specialised list_transport must be compiled for each message
classes where plugins are developed:
list_transport.cpp:
#include <message_transport/list_transport.h>
#include <sensor_msgs/PointCloud.h>

using namespace message_transport;

int main(int argc, char** argv)
{
    LIST_TRANSPORT("pointcloud_transport",sensor_msgs::PointCloud);

    return 0;
}

As an instance, the plugin declaration for the compressed images starts
with:

class CompressedPublisher : public    
    message_transport::SimplePublisherPlugin<sensor_msgs::Image,
        sensor_msgs::CompressedImage>
{ ...

protected:
  virtual void publish(const sensor_msgs::Image& message,
          const message_transport::SimplePublisherPlugin<sensor_msgs::Image,
                sensor_msgs::CompressedImage>::PublishFn& publish_fn)
const ;
};


For the moment, my message_transport stack contains -- i.e. written and
tested -- (indentation means dependency):
message_transport_common
->sharedmem_transport
  ->pointcloud_transport
  ->imagem_transport
    ->compressed_imagem_transport
    ->theora_imagem_transport

Other plugins are obviously possible and easy to write, to extend the
library for image and pointcloud or for other types of message.

HTH

--
Dr. Cedric Pradalier
http://www.asl.ethz.ch/people/cedricp

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

Re: Generic transport plugins and shared memory

Dejan Pangercic
Dear Cedric,

where are the packages
message_transport
sharedmem_transport
coming from? Are those yours?

cheers, D.
On Mon, May 10, 2010 at 11:09 PM, Cedric Pradalier
<[hidden email]> wrote:

> Hi all,
>
> I'm not quite sure who will be interested by this message, but since we
> don't have (yet) our official ros repository, I'll send the info here.
> Please feel free to contact me or discuss on the list if you want more
> information.
>
> Given the long travel time coming back from ICRA, and my experience with
> the image_transport plugin architecture, I found that being only able to
> make transport_plugin and shared memory only for sensor_msgs::Image was
> a bit limiting.
>
> So I've adapted the image_transport framework using templates to make it
> generic, and integrated a generic shared memory transport into the
> framework. I've also ported the compressed and theora transport, but
> still keeping them specialised to Image.
>
> The resulting framework allow to create a starting set of plugins (raw
> and sharedmem) for (e.g) PointCloud using the following code:
>
> manifest.cpp:
> #include <pluginlib/class_list_macros.h>
> #include <message_transport/raw_publisher.h>
> #include <message_transport/raw_subscriber.h>
> #include <sharedmem_transport/sharedmem_publisher.h>
> #include <sharedmem_transport/sharedmem_subscriber.h>
> #include <sensor_msgs/PointCloud.h>
>
> // Raw class
> PLUGINLIB_REGISTER_CLASS(raw_pub,
>    message_transport::RawPublisher<sensor_msgs::PointCloud>,
>    message_transport::PublisherPlugin<sensor_msgs::PointCloud>)
> PLUGINLIB_REGISTER_CLASS(raw_sub,
>    message_transport::RawSubscriber<sensor_msgs::PointCloud>,
>    message_transport::SubscriberPlugin<sensor_msgs::PointCloud>)
>
> // Sharedmem class (the PointCloud message contains a header, which the
> publisher uses)
> PLUGINLIB_REGISTER_CLASS(sharedmem_pub,
>
> sharedmem_transport::SharedmemPublisherWithHeader<sensor_msgs::PointCloud>,
>
>    message_transport::PublisherPlugin<sensor_msgs::PointCloud>)
> PLUGINLIB_REGISTER_CLASS(sharedmem_sub,
>    sharedmem_transport::SharedmemSubscriber<sensor_msgs::PointCloud>,
>    message_transport::SubscriberPlugin<sensor_msgs::PointCloud>)
>
> Note that a specialised list_transport must be compiled for each message
> classes where plugins are developed:
> list_transport.cpp:
> #include <message_transport/list_transport.h>
> #include <sensor_msgs/PointCloud.h>
>
> using namespace message_transport;
>
> int main(int argc, char** argv)
> {
>    LIST_TRANSPORT("pointcloud_transport",sensor_msgs::PointCloud);
>
>    return 0;
> }
>
> As an instance, the plugin declaration for the compressed images starts
> with:
>
> class CompressedPublisher : public
>    message_transport::SimplePublisherPlugin<sensor_msgs::Image,
>        sensor_msgs::CompressedImage>
> { ...
>
> protected:
>  virtual void publish(const sensor_msgs::Image& message,
>          const message_transport::SimplePublisherPlugin<sensor_msgs::Image,
>                sensor_msgs::CompressedImage>::PublishFn& publish_fn)
> const ;
> };
>
>
> For the moment, my message_transport stack contains -- i.e. written and
> tested -- (indentation means dependency):
> message_transport_common
> ->sharedmem_transport
>  ->pointcloud_transport
>  ->imagem_transport
>    ->compressed_imagem_transport
>    ->theora_imagem_transport
>
> Other plugins are obviously possible and easy to write, to extend the
> library for image and pointcloud or for other types of message.
>
> HTH
>
> --
> Dr. Cedric Pradalier
> http://www.asl.ethz.ch/people/cedricp
>
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>



--
MSc. Dejan Pangercic
PhD Student/Researcher
Intelligent Autonomous Systems Group
Technische Universität München
Telephone: +49 (89) 289-26908
E-Mail: [hidden email]
WWW: http://ias.cs.tum.edu/people/pangercic
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: Generic transport plugins and shared memory

Cedric Skybotix
On 06/06/2010 04:01 PM, Dejan Pangercic wrote:
> Dear Cedric,
>
> where are the packages
> message_transport
> sharedmem_transport
> coming from? Are those yours?
>
>    
Hi,

Yes I've developed these package myself.
However, if you're looking for shared-memory transfer, there seems to be
more interest&potential in developing the nodelet architecture.
If you're interested in a generic transport plugin architecture, then I
think my packages are doing the job (and also offering some
shared-memory advantages).

I'm happy to share the packages if there is an interest. Note that there
has not been many users yet ;)
We don't have an official ros svn yet, so you would have to contact me
directly at this stage.

Cheers


> cheers, D.
> On Mon, May 10, 2010 at 11:09 PM, Cedric Pradalier
> <[hidden email]>  wrote:
>    
>> Hi all,
>>
>> I'm not quite sure who will be interested by this message, but since we
>> don't have (yet) our official ros repository, I'll send the info here.
>> Please feel free to contact me or discuss on the list if you want more
>> information.
>>
>> Given the long travel time coming back from ICRA, and my experience with
>> the image_transport plugin architecture, I found that being only able to
>> make transport_plugin and shared memory only for sensor_msgs::Image was
>> a bit limiting.
>>
>> So I've adapted the image_transport framework using templates to make it
>> generic, and integrated a generic shared memory transport into the
>> framework. I've also ported the compressed and theora transport, but
>> still keeping them specialised to Image.
>>
>> The resulting framework allow to create a starting set of plugins (raw
>> and sharedmem) for (e.g) PointCloud using the following code:
>>
>> manifest.cpp:
>> #include<pluginlib/class_list_macros.h>
>> #include<message_transport/raw_publisher.h>
>> #include<message_transport/raw_subscriber.h>
>> #include<sharedmem_transport/sharedmem_publisher.h>
>> #include<sharedmem_transport/sharedmem_subscriber.h>
>> #include<sensor_msgs/PointCloud.h>
>>
>> // Raw class
>> PLUGINLIB_REGISTER_CLASS(raw_pub,
>>     message_transport::RawPublisher<sensor_msgs::PointCloud>,
>>     message_transport::PublisherPlugin<sensor_msgs::PointCloud>)
>> PLUGINLIB_REGISTER_CLASS(raw_sub,
>>     message_transport::RawSubscriber<sensor_msgs::PointCloud>,
>>     message_transport::SubscriberPlugin<sensor_msgs::PointCloud>)
>>
>> // Sharedmem class (the PointCloud message contains a header, which the
>> publisher uses)
>> PLUGINLIB_REGISTER_CLASS(sharedmem_pub,
>>
>> sharedmem_transport::SharedmemPublisherWithHeader<sensor_msgs::PointCloud>,
>>
>>     message_transport::PublisherPlugin<sensor_msgs::PointCloud>)
>> PLUGINLIB_REGISTER_CLASS(sharedmem_sub,
>>     sharedmem_transport::SharedmemSubscriber<sensor_msgs::PointCloud>,
>>     message_transport::SubscriberPlugin<sensor_msgs::PointCloud>)
>>
>> Note that a specialised list_transport must be compiled for each message
>> classes where plugins are developed:
>> list_transport.cpp:
>> #include<message_transport/list_transport.h>
>> #include<sensor_msgs/PointCloud.h>
>>
>> using namespace message_transport;
>>
>> int main(int argc, char** argv)
>> {
>>     LIST_TRANSPORT("pointcloud_transport",sensor_msgs::PointCloud);
>>
>>     return 0;
>> }
>>
>> As an instance, the plugin declaration for the compressed images starts
>> with:
>>
>> class CompressedPublisher : public
>>     message_transport::SimplePublisherPlugin<sensor_msgs::Image,
>>         sensor_msgs::CompressedImage>
>> { ...
>>
>> protected:
>>   virtual void publish(const sensor_msgs::Image&  message,
>>           const message_transport::SimplePublisherPlugin<sensor_msgs::Image,
>>                 sensor_msgs::CompressedImage>::PublishFn&  publish_fn)
>> const ;
>> };
>>
>>
>> For the moment, my message_transport stack contains -- i.e. written and
>> tested -- (indentation means dependency):
>> message_transport_common
>> ->sharedmem_transport
>>   ->pointcloud_transport
>>   ->imagem_transport
>>     ->compressed_imagem_transport
>>     ->theora_imagem_transport
>>
>> Other plugins are obviously possible and easy to write, to extend the
>> library for image and pointcloud or for other types of message.
>>
>> HTH
>>
>> --
>> Dr. Cedric Pradalier
>> http://www.asl.ethz.ch/people/cedricp
>>
>> _______________________________________________
>> ros-users mailing list
>> [hidden email]
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>>      
>
>
>    


--
Dr. Cedric Pradalier
http://www.asl.ethz.ch/people/cedricp

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users