ROS2 integration and package scaffolding for MechanicsDSL — compile physical systems to complete ROS2 packages
Project description
mechanicsdsl-ros2
Compile MechanicsDSL physical systems directly to complete ROS2 packages.
Overview
mechanicsdsl-ros2 provides a dedicated ROS2 integration layer for MechanicsDSL. Physical systems defined in DSL notation compile to complete, buildable ROS2 packages — no manual C++ required for the physics layer.
Package: mechanicsdsl_pendulum
The first generated package, currently including:
Nodes
| Node | System | Rate | Topics |
|---|---|---|---|
pendulum_node |
Simple pendulum | 250 Hz | /mechanicsdsl/pendulum/state, /mechanicsdsl/pendulum/energy |
double_pendulum_node |
Double pendulum | 200 Hz | /double_pendulum/state |
Messages
| Message | Fields |
|---|---|
PendulumState |
header, theta, omega, energy, energy_drift, sim_time |
SystemState |
header, q[], q_dot[], q_ddot[], lambda[], energy, energy_drift, conserved_quantities[], sim_time |
Launch Files
ros2 launch mechanicsdsl_pendulum pendulum.launch.py
ros2 launch mechanicsdsl_pendulum pendulum.launch.py l_m:=0.5 theta0_rad:=0.8
ros2 launch mechanicsdsl_pendulum double_pendulum.launch.py theta1_0:=0.3 theta2_0:=0.2
Repository Structure
mechanicsdsl-ros2/
├── mechanicsdsl_pendulum/
│ ├── package.xml, CMakeLists.txt
│ ├── msg/ PendulumState.msg, SystemState.msg
│ ├── src/ pendulum_node.cpp, double_pendulum_node.cpp
│ ├── include/mechanicsdsl_pendulum/ pendulum_dynamics.hpp
│ ├── launch/ pendulum.launch.py, double_pendulum.launch.py
│ ├── config/ pendulum_params.yaml
│ └── test/ test_pendulum_eom.cpp, test_pendulum_integration.py
├── docker/ Dockerfile (ROS2 Jazzy + MechanicsDSL)
├── scripts/ build.sh, monitor.sh
└── docs/ getting_started.md, architecture.md, adding_systems.md
Quick Start
# Clone into ROS2 workspace
mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/MechanicsDSL/mechanicsdsl-ros2.git
# Build
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-select mechanicsdsl_pendulum
source install/setup.bash
# Run
ros2 launch mechanicsdsl_pendulum pendulum.launch.py
Docker:
docker build -t mechanicsdsl-ros2:jazzy docker/
docker run --rm -it mechanicsdsl-ros2:jazzy
Monitoring
ros2 topic echo /mechanicsdsl/pendulum/state
ros2 topic hz /mechanicsdsl/pendulum/state # should be ~250 Hz
# Reset
ros2 topic pub --once /pendulum/reset std_msgs/msg/Bool "data: true"
Testing
colcon test --packages-select mechanicsdsl_pendulum
colcon test-result --verbose
GTests cover EOM correctness, energy conservation, equilibrium stability, and small-angle period accuracy.
Architecture
See docs/architecture.md for the full node/message/layer diagram.
Adding New Systems
Contributing
See CONTRIBUTING.md.
License
MIT License — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mechanicsdsl_ros2-0.1.0.tar.gz.
File metadata
- Download URL: mechanicsdsl_ros2-0.1.0.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97815dd84323334f28b3f53dc3165897a4b70a8e590811f205a7e10da7b12db9
|
|
| MD5 |
419017d787e219842a7e943f18beed36
|
|
| BLAKE2b-256 |
3d73f07e886e4512fb67300fb15818451f3e6213d5df3267debdf9b632a43313
|
Provenance
The following attestation bundles were made for mechanicsdsl_ros2-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on MechanicsDSL/mechanicsdsl-ros2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mechanicsdsl_ros2-0.1.0.tar.gz -
Subject digest:
97815dd84323334f28b3f53dc3165897a4b70a8e590811f205a7e10da7b12db9 - Sigstore transparency entry: 1118511601
- Sigstore integration time:
-
Permalink:
MechanicsDSL/mechanicsdsl-ros2@936323a45004b2c557b1e738aad29cd60b32d3ff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MechanicsDSL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@936323a45004b2c557b1e738aad29cd60b32d3ff -
Trigger Event:
push
-
Statement type:
File details
Details for the file mechanicsdsl_ros2-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mechanicsdsl_ros2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ed543dbd7cb8d971072c0d92605f9778ffab62a564b341619f506853d0d162
|
|
| MD5 |
b64268bb83b466a0b0aa919450e58fb0
|
|
| BLAKE2b-256 |
75e83c19ab1b0e41967ae9eee2daa8bdf3c24ae35d365cdc0b2a6aff6236049c
|
Provenance
The following attestation bundles were made for mechanicsdsl_ros2-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on MechanicsDSL/mechanicsdsl-ros2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mechanicsdsl_ros2-0.1.0-py3-none-any.whl -
Subject digest:
29ed543dbd7cb8d971072c0d92605f9778ffab62a564b341619f506853d0d162 - Sigstore transparency entry: 1118511912
- Sigstore integration time:
-
Permalink:
MechanicsDSL/mechanicsdsl-ros2@936323a45004b2c557b1e738aad29cd60b32d3ff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MechanicsDSL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@936323a45004b2c557b1e738aad29cd60b32d3ff -
Trigger Event:
push
-
Statement type: