ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Custom msg for diference package

asked 2011-07-06 20:06:49 -0600

embeddedheaven gravatar image

Hello,

I am doing the communication between two computer, and I use 2 difference package name.

How can I create and general and custom msg to comunicate between 2 node.

For Example in Package A, I create msg.

Position.msg

float64 x
float64 y
float64 x

and the msg type will be A/Position

and in Package B, I create msg.

Position.msg

float64 x
float64 y
float64 x

and the msg type will be B/Position

:( Thanks all

edit retag flag offensive close merge delete

Comments

If you want the message like the ones you defined, geometry_msgs/Point already does that.
dornhege gravatar image dornhege  ( 2011-07-06 22:16:48 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
7

answered 2011-07-06 20:36:11 -0600

Lorenz gravatar image

I assume that you have all packages in one single repository and both computers have it checked out. Then the following should work: B could either use A's message definition or A could use B's message definition. However, it is pretty common in ROS to create a separate package C that only contains the message and no code. All you need to do is to create that package C, put the message file into the msg/ sub-directory and update your CMakeLists.txt to build that message. Then edit A's manifest and let it depend on C, edit B's manifest respectively. In A and B, instead of including A/Position.h or B/Position.h, include C/Position.h.

edit flag offensive delete link more
0

answered 2011-07-20 03:21:39 -0600

embeddedheaven gravatar image

Thanks you I got it

edit flag offensive delete link more

Comments

Can you accept the answer by clicked the checkmark, please.
dornhege gravatar image dornhege  ( 2011-07-20 04:20:12 -0600 )edit

Question Tools

Stats

Asked: 2011-07-06 20:06:49 -0600

Seen: 1,079 times

Last updated: Jul 20 '11