[ros-users] Multi-robot communication

Brian Gerkey gerkey at willowgarage.com
Mon Jul 12 16:57:26 UTC 2010


2010/7/12 Gonçalo Cabrita <goncabrita at gmail.com>:
> We've been working on our comm node and we have encountered a problem.
> We are thinking about creating a ROS msg to send over foreign_relay that
> looks like this:
> int robot_id
> ShapeShifter msg
> We would like to know if ShapeShifter can be used to hold any message we
> might want to send and if we need an extra field like msg_type or not.

No, ShapeShifter is not a ROS message.  It's a a C++ class that is
used by certain tools to handle messages without knowing their types
(and it's a pretty hacky way of doing that).  All ROS messages are
explicitly typed when sent over the wire.  If you really want to send
an opaque blob of data (not recommended, as you'd be circumventing the
ROS marshaling support, and would lose the ability to introspect
messages), then you can do something like:

uint8[] msg

	brian.



More information about the ros-users mailing list