LCM is a library for message passing and data marshalling targeted at real-time systems where high-bandwidth and low latency are critical. It provides a publish/subscribe message passing model and an XDR-style message specification language with bindings for applications in C, Java, and Python. It was originally designed and used by the MIT DARPA Urban Challenge Team as its message passing system.
LCM is designed for tightly-coupled systems connected via a dedicated local-area network. It is not intended for message passing over the Internet. LCM has been developed for soft real-time systems: its default messaging model permits dropping messages in order to minimize the latency of new messages.
Features
- Low-latency inter-process communication
- Efficient broadcast mechanism using UDP Multicast
- Provides type-safe message marshaling that automatically detects most types of errors (such as version mismatches between different modules)
- User-friendly logging and playback
- Essentially unlimited packet size
- No centralized "database" or "hub" -- peers communicate directly
- No daemons
- Supports C/C++, Java, Python, and MATLAB
Requirements
- POSIX.1-2001 system (GNU/Linux, OS X, Cygwin, Solaris, etc.)
- GLib >= 2.0
Java >= 1.5 is strongly recommended, as several important utilities distributed with LCM are written in Java.
Documentation
- Technical Report (PDF) -- This document describes the design principles of LCM, and is the best place to start for a comprehensive understanding.
- More Documentation -- Tutorials, API Reference, Troubleshooting, etc.
News
Aug 14, 2009
Release 0.3.1:
This is a maintenance release, and incorporates a number of minor bugfixes and enhancements.
- Java:
- lcm-spy, lcm-logplayer-gui warn if gcj is detected as JRE
- minor enhancements to lcm-spy
- Python:
- update comment docs
- Other:
- add --lcm-url=URL cmd line option to lcm-{spy,logger,logplayer,logplayer-gui}
- updated examples
Jun 29, 2009
Release 0.3.0:
- Java
- Faster serialization classes that provide a 4x-5x speedup. This introduces a backwards-incompatible change to the LCM Java API. Specifically, the messageReceived() method of the LCMSubscriber interface has changed from:
public void messageReceived(LCM lcm, String channel, DataInputStream ins)
to:public void messageReceived(LCM lcm, String channel, LCMDataInputStream ins)
LCMDataInputStream has an almost identical API to DataInputStream, and migration of source code to the new API should only require changing implementations of LCMSubscriber in the manner described above.
- C
- warn on Linux if large packets are being received but the kernel rbuf is small
- Python
- bugfix for decoding arrays of bytes