Skip to content

Commit ad3ffef

Browse files
authored
Merge pull request #15 from dimensionalOS/cleanup
Cleanup
2 parents 3aeb724 + 45fe848 commit ad3ffef

File tree

1,271 files changed

+14947
-14874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,271 files changed

+14947
-14874
lines changed

.envrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
2+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
3+
fi
4+
use flake .
5+
for venv in venv .venv env; do
6+
if [[ -f "$venv/bin/activate" ]]; then
7+
source "$venv/bin/activate"
8+
break
9+
fi
10+
done
11+
dotenv_if_exists

README.md

Lines changed: 20 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,33 @@
1-
# LCM Message Definitions and ROS msg to LCM Converter
1+
# LCM Message Definitions
22

3-
This repository contains LCM message definitions and a tool to convert ROS messages to LCM messages.
3+
This repository contains LCM message definitions for the Dimos project and tools to generate those language bindings.
44

5-
## Converting ROS Messages to LCM
5+
It depends on our [LCM fork](https://github.com/dimensionalOS/lcm) for generation since we introduced some convinience changes to python message definitions.
66

7-
- The Python msg to lcm converter is used to convert the ROS messages to LCM messages.
7+
lcmgen from our lcm fork is conviniently pulled and built by our `flake.nix`
88

9-
```py
10-
python3 ros_to_lcm.py ros_msgs lcm_files
11-
```
12-
13-
- The lcm-gen command is used to generate the language bindings for the LCM message definitions.
14-
15-
```sh
16-
./lcm_batch_processor.sh -p lcm_files -o python_lcm_msgs/lcm_msgs
17-
```
18-
19-
- Then to make sure tha Python messages package is installable, run
20-
21-
```sh
22-
cd python_lcm_msgs
23-
python3 fix_imports.py
24-
```
25-
26-
- The Foxglove bridge converts all LCM messages to JSON and sends them via WebSocket to Foxglove for visualization.
27-
28-
```py
29-
python3 lcm_foxglove_bridge.py
30-
```
31-
32-
## Using LCM-Spy with Custom Message Types
33-
34-
To use lcm-spy with your custom message types, you need to build a JAR file containing the Java bindings for your LCM message types.
9+
## Generating Bindings
3510

36-
### Building the JAR File
37-
38-
1. Make sure you have the Java LCM bindings generated in the `java_lcm_msgs` directory.
39-
2. Run the build script to create the JAR file:
40-
41-
```sh
42-
./build_lcm_jar.sh
43-
```
44-
45-
This will compile all Java message definitions and create `lcm_types.jar` in the project directory.
46-
47-
### Running LCM-Spy
48-
49-
Use the provided script to run lcm-spy with your custom JAR file:
11+
Run `generate.sh` to regenerate all bindings:
5012

5113
```sh
52-
./run_lcm_spy.sh
14+
./generate.sh
5315
```
5416

55-
You can also pass additional arguments to lcm-spy:
17+
This will:
18+
1. Convert ROS messages to LCM definitions (from `sources/ros_msgs/` to `lcm_types/`)
19+
2. Generate Python bindings (`generated/python_lcm_msgs/`)
20+
3. Generate C++ bindings (`generated/cpp_lcm_msgs/`)
21+
4. Generate C# bindings (`generated/cs_lcm_msgs/`)
22+
5. Generate Java bindings (`generated/java_lcm_msgs/`)
5623

57-
```sh
58-
# For a specific LCM URL
59-
./run_lcm_spy.sh --lcm-url=udpm://239.255.76.67:7667?ttl=1
60-
61-
# For a specific interface
62-
./run_lcm_spy.sh --lcm-url=udpm://<multicast-address>:<port>
63-
```
64-
65-
When running lcm-spy this way, all your custom message types will be automatically decoded and displayed in the lcm-spy interface.
24+
## Directory Structure
6625

67-
### Manual Execution
26+
- `sources/` - Source ROS message definitions and conversion tools
27+
- `lcm_types/` - Generated LCM message definitions
28+
- `generated/` - Generated language bindings
6829

69-
If you prefer to run lcm-spy manually, use:
70-
71-
```sh
72-
CLASSPATH=/path/to/lcm.jar:lcm_types.jar lcm-spy
73-
```
30+
## Python Package
7431

75-
Replace `/path/to/lcm.jar` with the actual path to the LCM Java library on your system.
32+
This repo is also a Python package and you can install it via `pip install dimos-lcm`
33+
It is not very useful standalone and is meant to be used in conjuction with actual [dimOS](https://github.com/dimensionalOS/dimos)

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _setup_lcm_msgs_path():
2121
# If import fails, add the local python_lcm_msgs to path
2222
# ensures internal imports like "from lcm_msgs import std_msgs" work
2323
current_dir = os.path.dirname(os.path.abspath(__file__))
24-
lcm_module_dir = os.path.join(current_dir, "python_lcm_msgs")
24+
lcm_module_dir = os.path.join(current_dir, "generated/python_lcm_msgs")
2525
if os.path.exists(lcm_module_dir):
2626
if lcm_module_dir not in sys.path:
2727
sys.path.insert(0, lcm_module_dir)

build_lcm_jar.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

cpp_lcm_msgs/README.md

Lines changed: 0 additions & 244 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)