[ros-users] callback function on one topic with different message types

Ugo Cupcic ugo at shadowrobot.com
Tue Mar 23 15:59:56 UTC 2010


OK, thanks for those precisions

Cheers,

Brian Gerkey wrote:
> On Tue, Mar 23, 2010 at 8:13 AM, Ugo Cupcic <ugo at shadowrobot.com> wrote:
>> Ok, thanks for your answers. I'm now using a type flag in my message,
>> but I wanted to be sure I was doing it properly.
> 
> hi Ugo,
> 
> Rather than use a flag in a message to switch between types, you
> should consider defining multiple message types.  We designed ROS to
> make it easy to define new messages, and to hook up multiple
> publishers and subscribers.  You're free to use a flag, of course;
> it's just not the recommended design pattern.
> 
> 	brian.
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
> 


-- 
Ugo Cupcic         |  Shadow Robot Company | ugo at shadowrobot.com
Software Engineer      251 Liverpool Road
need a Hand?           London  N1 1LX       | +44 20 7700 2487
http://www.shadowrobot.com/hand/              @shadowrobot




More information about the ros-users mailing list