HMRSsim
Simulator for research in Heterogeneous Multi-Robots Environment. The intention is to provide extensible, lightweight, portable, low fidelity, visualizable simulations for testing task allocation approaches in a heterogeneous, multi-robot environment. The priority is to provide the researcher with the capability to easily implement new maps by importing 2D draws from draw.io.
Install / Use
/learn @lesunb/HMRSsimREADME
Heterogeneous Multi-Robots Systems Simulator
Install for Dev
Dependencies: python 3.8+, pip, poetry
Install dependencies
The poject runs inside a virtual environment managed by Poetry. To install it do:
$ pip install poetry
Install ROS dependencies (opitional)
To install ROS dependecies run the commands below:
$ apt-get update
$ apt-get install -y curl build-essential ros-foxy-rosbridge-server ros-foxy-navigation2 ros-foxy-nav2-bringup ros-foxy-moveit-msgs '~ros-foxy-turtlebot3-.*'
The project was tested only with ROS Foxy, but it doesn't mean you cannot try with other versions. Just be aware that you'll have to change some commands.
Install the package
Currently the easiest way to install the package is to do it locally.
After installing Poetry, in the root folder run the command below to install the HMRsim_lesunb inside the environment.
$ poetry install
Check if the package was installed.
$ poetry run pip list
# ...
# HMRsim-lesunb 0.0.1
# ...
Watch the simulation with Seer via ROS
Seer is a component of this project that visually shows the simulation in a web browser. It comunicates with HMR Sim throught Rosbridge. To install Rosbridge for ROS Foxy use
sudo apt-get install ros-foxy-rosbridge-server
To run it, open a separated terminal, source ROS and do
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
ROS examples uses Seer throught another Git project, here it is. Clone the project and run it after ROS Bridge and before HMR Sim (running instructions are in the ROSeer project).
💡 HMR Sim doesn't have a handshake process with ROSeer yet, that's why you have to run it before running HMR Sim for now.
Run
Some examples do not use ROS to run, you can run them with no need to install ROS related dependencies.
Below we describe how to run the examples.
💡 The package exports a utility function to help you parse the config.
$ hmrsimcli configtest -f simulation.json
First, get inside the environment
$ poetry shell
💡 Check the
examples/folder for different example simulations
Simulations are defined by config objects. You can pass the config to the Simulator class either by a dict object, or by passing the path to a json file. Here's an example with a dict object in python:
simulator = Simulator(config)
The file that build a simulation and runs it is called run.py.
To execute the simulation, go inside the example you want to run the command below (assuming an example that uses a json config file).
$ python run.py [path/to/config.json]
Run using Docker
If you just want to run a simulation in the project (e.g. you are not developing HMRSim itself) you may opt to run it using a Docker container.
First you build the image, which does what was described above in a Docker image:
$ docker build --rm -t hmrsim --build-arg example_folder=[path/to/example/folder] .
Explaining somethings in the command:
- With the
--build-argargument you specify the path to the example folder you want to execute inside the container (notice that there is a pattern with the structure and name of files in these examples folders). - If you don't want to set this variable everytime you build, you can set the
example_folderparameter in theDockerfile.
Then you can run simulations inside the container by using the command below:
$ docker run hmrsim:latest
Dependency
Add New Dependency
To add new dependencies use the following command.
$ poetry add [name]
$ poetry install
This command will add the dependency to the project.
Troubleshooting
- Your operational system may not have the ROS version used here to run (foxy) the simulation, if that happens try another version.
- If you're having trouble with the version of the
poetry.lockwhen building the container, maybe yourpoetry.lockis modified, checkout the changes and try again. - If you get an error in ROS Seer try stopping HMR Sim (not ROSeer), reloading the page and starting HMR Sim again. This should be solved after an implementation of a handshake process between HMR Sim and ROSeer.
How to use HMR Sim with ROS
In the file ROS Controller you find some instructions of how to control HMR Sim robots via ROS.
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
