Documentation: https://ir-sim.readthedocs.io/en
IR-SIM is an open-source, Python-based, lightweight robot simulator designed for navigation, control, and learning. It provides a simple, user-friendly framework with built-in collision detection for modeling robots, sensors, and environments. Ideal for academic and educational use, IR-SIM enables rapid prototyping of robotics and AI algorithms in custom scenarios with minimal coding and hardware requirements.
Features
- Simulate robot platforms with diverse kinematics, sensors, and behaviors (support).
- Quickly configure and customize scenarios using straightforward YAML files. No complex coding required.
- Visualize simulation outcomes using a naive visualizer matplotlib for immediate debugging.
- Support collision detection and behavior control for each object.
Demonstrations
 | In scenarios involving multiple circular differential robots, each robot employs Reciprocal Velocity Obstacle (RVO) behavior to avoid collisions. See Usage - collision avoidance |
 | A car-like robot controlled via keyboard navigates a binary map using a 2D LiDAR sensor to detect obstacles. See Usage - grid map |
 | A car-like robot controlled via keyboard navigates a grid map generated from 3D habitat spaces datasets like HM3D, MatterPort3D, Gibson, etc. See Usage - grid map hm3d |
 | Each robot employing RVO behavior is equipped with a field of view (FOV) to detect other robots within this area. See Usage - fov |
 | A car-like robot navigates through the randomly generated and moving obstacles. See Usage - dynamic random obstacles |
Prerequisite
Installation
- Install this package from PyPi:
pip install ir-sim
This does not include dependencies for all features of the simulator. To install additional optional dependencies, use the following pip commands:
# install dependencies for keyboard control
pip install ir-sim[keyboard]
# install dependencies for testing
pip install ir-sim[test]
# install all optional dependencies
pip install ir-sim[all]
- Or if you want to install the latest main branch version (which is more up-to-date than the PyPI version) from the source code:
git clone https://github.com/hanruihua/ir-sim.git
cd ir-sim
pip install -e .
Usage
Quick Start
import irsim
env = irsim.make('robot_world.yaml')
for i in range(300):
env.step()
env.render()
if env.done(): break
env.end()
YAML Configuration: robot_world.yaml
world:
height: 10
width: 10
step_time: 0.1
sample_time: 0.1
offset: [0, 0]
robot:
kinematics: {name: 'diff'}
shape: {name: 'circle', radius: 0.2}
state: [1, 1, 0]
goal: [9, 9, 0]
behavior: {name: 'dash'}
color: 'g'
Advanced Usage
The advanced usages are listed in the irsim/usage
Support
Currently, the simulator supports the following features. Further features, such as additional sensors, behaviors, and robot models, are under development.
Kinematics | Differential Drive mobile Robot Omni-Directional mobile Robot Ackermann Steering mobile Robot |
Sensors | 2D LiDAR FOV detector |
Geometries | Circle Rectangle Polygon linestring Binary Grid Map |
Behaviors | dash (Move directly toward the goal) rvo (Move toward the goal using Reciprocal Velocity Obstacle behavior) |
Projects Using IR-SIM
Contributing
This project is under development. I appreciate and welcome all contributions. Just open an issue or a pull request. Here are some simple ways to start contributing:
- Read the IR-SIM source code and improve the documentation, api, or address TODO list.
- Enhance the website documentation.
- Polish the usages and add new usage examples or test cases.
- Fix bugs and issues.
Code style: black
Acknowledgement