This repository provides a bridge between BeamNG and ROS 2 using Zenoh, enabling real-time data transfer from BeamNG to ROS 2 topics. This integration allows users to simulate driving scenarios in BeamNG and utilize the data within the ROS 2 ecosystem for further processing, visualization, or autonomous driving applications.
download and run rustup-init.exe
To ensure that Rust is installed correctly, you can use the following commands:
1. Check the Rust version:
rustc --version
2. Check the Cargo version:
cargo --version
If both commands return the version information, Rust is successfully installed on your system
1. Install Rust Nightyly
To use PyO3, you need to install the nightly version of Rust.Run the following command:
rustup install nightly
rustup default nightly
2. Install Python Packages
Next, install setuptools and setuptools-rust using pip:
pip install setuptools
pip install setuptools-rust
To utilize the BeamNG API, run the following command:
pip install beamngpy==1.30
To enable data communication with Zenoh, install the eclipse-zenoh
library
pip install eclipse-zenoh==1.0.0a6
Next, install the required Python packages
pip install pycdr2
pip install keyboard
To use this project, first clone the repository and build it. This will prepare the Rust functions for use in Python. Follow these steps:
# clone the repository
cd ~/
git clone https://github.com/hayato-hayashi/zenoh_beamng_bridge.git
# move into the cloned directory
cd ~/zenoh_beamng_bridge/beamng_publisher
# build
python setup.py install
To run the application, you will need to use two terminal windows
# Move to the directory where BeamNG.tech is located
cd <path-to-beamng.tech-directory>
# Run the BeamNG.tech application
Bin64\BeamNG.tech.x64.exe -console -nosteam -tcom-listen-ip "127.0.0.1" -lua "extensions.load('tech/techCore');tech_techCore.openServer(64256)"
cd ~/zenoh_beamng_bridge/beamng
python main.py