Re: [ros-users] Communicating between two user created packa…

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: Re: [ros-users] Communicating between two user created packages
hi Peshala,

This is very simple, say you have packages packagex and packagey

And have designed messages in either of them, or even both

Say you have a message X.msg in packagex and want to use in packagey

in the manifest.xml of packagex, you need to add the following line

<export>
    <cpp cflags="-I{prefix}/msg/cpp/"/>
</export>



then in manifest.xml of packagey you need to add the following line

<depend package="packagex"/>

The you should be set. To use the message in the cpp code all you need to do
is now include the message headers as

#include <packagex/X.h>

and proceed to use it in the code. For python you will just need to use
'from packagex import *'


There are also a number of tutorials online which explain this.

Have fun

billy

On 5 October 2010 09:49, Peshala Jayasekara <> wrote:

> Dear all,
>
> How can we communicate between two user created packages using a user
> created ROS msg?
> When I referred the tutorials, it only provides a scenario when the two
> executables (publisher and listener) are in the same package.
> Do we have to create the same msg in both the packages?
> Also, I'm having trouble figuring out how to include headers from a user
> created package to another package.
>
> Any advise would be greatly appreciated, since I'm a beginner.
>
> Thanks
> Peshala
>
>
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>
>



--
Viele Gruss/Best Regards,
Billy Okal
Jacobs University Bremen
#5383, MA 333
-------------------------------------------------------------------------------------------------------
"sure vi is user friendly, its just particular about who to be friends with"