Skip to main content
DimOS uses LCM (Lightweight Communications and Marshalling) for inter-process communication on a local machine (similar to how ROS uses DDS). LCM is a simple UDP multicast pubsub protocol with a straightforward message definition language. The LCM project provides pubsub clients and code generators for many languages. For us the power of LCM is its message definition format, multi-language classes that encode themselves to a compact binary format. This means LCM messages can be sent over any transport (WebSocket, SSH, shared memory, etc.) between differnt programming languages. Our messages are ported from ROS (they are structurally compatible in order to facilitate easy communication to ROS if needed) Repo that hosts our message definitions and autogenerators is at dimos-lcm our LCM implementation significantly outperforms ROS for local communication

Supported languages

Apart from python, we have examples of LCM integrations for: In our /examples/language-interop/ dir Types generated (but no examples yet) for: C# and Java

Native Modules

Given LCM is so portable, we can easily run dimos Modules written in third party languages

dimos-lcm Package

The dimos-lcm package provides base message types that mirror ROS message definitions:
session=lcm_demo ansi=false

Dimos Message Overlays

Dimos subclasses the base LCM types to add Python-friendly features while preserving binary compatibility. For example, dimos.msgs.geometry_msgs.Vector3 extends the LCM base with:
  • Multiple constructor overloads (from tuples, numpy arrays, etc.)
  • Math operations (+, -, *, /, dot product, cross product)
  • Conversions to numpy, quaternions, etc.
session=lcm_demo ansi=false

PointCloud2 with Open3D

A more complex example is PointCloud2, which wraps Open3D point clouds while maintaining LCM binary compatibility:
session=lcm_demo ansi=false

Transport Independence

Since LCM messages encode to bytes, you can use them over any transport:
session=lcm_demo ansi=false

Available Message Types

Dimos provides overlays for common message types: Base LCM types (without Dimos extensions) are available in dimos_lcm.*.

Creating Custom Message Types

To create a new message type:
  1. Define the LCM message in .lcm format (or use existing dimos_lcm base)
  2. Create a Python overlay that subclasses the LCM type
  3. Add lcm_encode() and lcm_decode() methods if custom serialization is needed
See PointCloud2.py and Vector3.py for examples.