Discussion:
ROS messaging vs. LCM
Markus Achtelik
2010-01-12 16:47:58 UTC
Permalink
Hi all,

I was working in the past with LCM (http://code.google.com/p/lcm/)for
passing messages between processes on multiple machines over LAN as well
as WLAN connections.

I'm now working in a new research group and we would like to make some
decisions which way to go in the future. Comparing ROS and LCM directly
might not be possible, so I have some specific questions especially on
the networking/messaging part of ROS.

Our layout in general: we have a flying robot with a onboard computer
offloading computationally demanding tasks via WLAN to a ground-station
consisting of one or more laptops.

- log-playback: is it possible to playback just certain topics, without
having to filter to another logfile first using "rosbag filter". Can I
rename the topic of messages that get published by "rosbag play"

- Is there something like a "ROS-sniffer" to see what's currently going
on in the ROS network?

- Handling lossy connections like WLAN: the tutorial says that UDP might
be a better choice for lossy connections. Loosing packets might be
tolerable for small messages like the pose on a high rate, but it will
be a problem for larger messages like images. Is there any way to set an
error correction? Or is it possible to set a max. number of retries for
TCP without hacking around in the ROS core code? (in LCM, this was
possible with a "tunnel" relaying/correcting messages)

- Is it possible to avoid that an identical message gets over the WLAN
multiple times, e.g. when the robot is publishing an image to multiple
subscribers? Is there a way to enforce the connection type when
subscribing to a topic?

- Close to the question above: how does ROS perform for multiple
subscribers of the same topic. Will the message get over the network
multiple times, or do all nodes somehow reestablish their connections
and use e.g. multicast? (I assume that the nodes won't subscribe at the
same time, so that multicast won't be the best choice from the beginning
on)

LCM is using UDP Multicast and the two issues above could be handled
setting the TTL appropriately and using multicast groups with IGMP
snooping on the switch - would something similar be possible?

Sorry for that ton of questions, but I would appreciate every
comment ;-) !

Best, Markus
Ken Conley
2010-01-12 17:43:09 UTC
Permalink
Hi Markus,

There's probably more questions that I can personally answer, so I'll
do my best with the ones I can.

On Tue, Jan 12, 2010 at 8:47 AM, Markus Achtelik
Post by Markus Achtelik
Hi all,
I was working in the past with LCM (http://code.google.com/p/lcm/)for
passing messages between processes on multiple machines over LAN as well
as WLAN connections.
I'm now working in a new research group and we would like to make some
decisions which way to go in the future. Comparing ROS and LCM directly
might not be possible, so I have some specific questions especially on
the networking/messaging part of ROS.
The major difference, I believe, is that LCM is optimized for a
different case. We built ROS around TCP/IP to optimize for reliable
message transport. (As someone who hasn't used LCM) it seems that LCM
is optimized around UDP multicast. This leads to different use cases.
LCM is targeted at LAN setups as well as wireless. ROS is targeted at
LAN setups, isn't as strong on wireless, but can also be used over the
Internet. LCM is "targeted at real-time systems", whereas we use ROS
for our non-realtime computation (the majority of it), and bind it to
a separate process for our real-time work.

UDP multicast is something we are currently working on implementing,
but will not be in ROS 1.0. ROS does have pluggable transports, which
is how UDP support was first added, so one possibility is using LCM to
implement a UDP multicast layer, though the LGPL license creates
issues as we want to keep the ROS core BSD. One of the nice things
about ROS is many people have been able to integrate it with a variety
of other systems (OpenRAVE, Orocos RTT, Player, etc...) that provide
the capabilities that ROS lacks and use the two together effectively.
Post by Markus Achtelik
Our layout in general: we have a flying robot with a onboard computer
offloading computationally demanding tasks via WLAN to a ground-station
consisting of one or more laptops.
- log-playback: is it possible to playback just certain topics, without
having to filter to another logfile first using "rosbag filter". Can I
rename the topic of messages that get published by "rosbag play"
There is a programmatic API that would enable to do what you describe.
There currently isn't a command-line tool to do so, but it's something
we could consider for a future ROS release.

You can rename, yes.
Post by Markus Achtelik
- Is there something like a "ROS-sniffer" to see what's currently going
on in the ROS network?
ROS has a variety of sniffers, so it depends on what you mean. rxgraph
shows connectivity, "rostopic echo" shows you the contents of the
messages, rxplot will plot the messages, rosnode displays information
about the active processes, and, of course, there are the normal Linux
sniffers.
Post by Markus Achtelik
- Handling lossy connections like WLAN: the tutorial says that UDP might
be a better choice for lossy connections. Loosing packets might be
tolerable for small messages like the pose on a high rate, but it will
be a problem for larger messages like images. Is there any way to set an
error correction? Or is it possible to set a max. number of retries for
TCP without hacking around in the ROS core code? (in LCM, this was
possible with a "tunnel" relaying/correcting messages)
The UDP support is still immature in this regard. In the "topic_tools"
package, we provide a set of tools that we use to deal with our WLAN,
including relaying and throttling, but this remains an area to
improve. We are optimized for reliable transport.
Post by Markus Achtelik
- Is it possible to avoid that an identical message gets over the WLAN
multiple times, e.g. when the robot is publishing an image to multiple
subscribers? Is there a way to enforce the connection type when
subscribing to a topic?
- Close to the question above: how does ROS perform for multiple
subscribers of the same topic. Will the message get over the network
multiple times, or do all nodes somehow reestablish their connections
and use e.g. multicast? (I assume that the nodes won't subscribe at the
same time, so that multicast won't be the best choice from the beginning
on)
The current TCP and UDP transports in ROS will create copies as we do
not support multicast (yet).

- Ken
Post by Markus Achtelik
LCM is using UDP Multicast and the two issues above could be handled
setting the TTL appropriately and using multicast groups with IGMP
snooping on the switch - would something similar be possible?
Sorry for that ton of questions, but I would appreciate every
comment ;-) !
Best, Markus
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
ros-users mailing list
https://lists.sourceforge.net/lists/listinfo/ros-users
Jeremy Leibs
2010-01-12 18:19:44 UTC
Permalink
Post by Ken Conley
Hi Markus,
There's probably more questions that I can personally answer, so I'll
do my best with the ones I can.
<SNIP>
On Tue, Jan 12, 2010 at 8:47 AM, Markus Achtelik
Post by Markus Achtelik
Hi all,
- log-playback: is it possible to playback just certain topics, without
having to filter to another logfile first using "rosbag filter". Can I
rename the topic of messages that get published by "rosbag play"
There is a programmatic API that would enable to do what you describe.
There currently isn't a command-line tool to do so, but it's something
we could consider for a future ROS release.
You can rename, yes.
If you only want to filter by topic name, and not some other message
criteria, you could do a primitive form of filtering with renaming.

You could either move topics you explicitly don't want published to some
other name where nodes won't subscribe to it.

rosbag play my.bag bad_topic:=hidden/bad_topic

Or, you could probably do the opposite as well, pushing the whole player
into a namespace and then renaming the topics you want pulled out, though to
do so would require using an absolute name, which is generally frowned upon.
Also, it won't work if you recorded your topics with absolute, rather than
relative names (which is part of why they're frowned upon in ths first
place. The basic idea though would be:

rosbag play my.bag __ns:=hidden good_topic:=/good_topic

In the future there will be better support for this finer-grained control,
but for now you're stuck with some long command-line invocations.

Any more complicated filtering will require writing a custom node that
iterates through the bag with one of the programmatic APIs.

Good luck!
--Jeremy
Markus Achtelik
2010-01-15 10:14:44 UTC
Permalink
Ken, Jeremy,

thanks a lot for your comments, those were really helpful!
It seems like we're going to use ROS and in case going to use LCM as
transport Layer as Jeremy described.

Best, Markus
Post by Ken Conley
Hi Markus,
There's probably more questions that I can personally answer, so I'll
do my best with the ones I can.
<SNIP>
On Tue, Jan 12, 2010 at 8:47 AM, Markus Achtelik
Post by Markus Achtelik
Hi all,
- log-playback: is it possible to playback just certain
topics, without
Post by Markus Achtelik
having to filter to another logfile first using "rosbag
filter". Can I
Post by Markus Achtelik
rename the topic of messages that get published by "rosbag
play"
There is a programmatic API that would enable to do what you describe.
There currently isn't a command-line tool to do so, but it's something
we could consider for a future ROS release.
You can rename, yes.
If you only want to filter by topic name, and not some other message
criteria, you could do a primitive form of filtering with renaming.
You could either move topics you explicitly don't want published to
some other name where nodes won't subscribe to it.
rosbag play my.bag bad_topic:=hidden/bad_topic
Or, you could probably do the opposite as well, pushing the whole
player into a namespace and then renaming the topics you want pulled
out, though to do so would require using an absolute name, which is
generally frowned upon. Also, it won't work if you recorded your
topics with absolute, rather than relative names (which is part of why
they're frowned upon in ths first place. The basic idea though would
rosbag play my.bag __ns:=hidden good_topic:=/good_topic
In the future there will be better support for this finer-grained
control, but for now you're stuck with some long command-line
invocations.
Any more complicated filtering will require writing a custom node that
iterates through the bag with one of the programmatic APIs.
Good luck!
--Jeremy
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
Loading...