iRobot is a lightweight, pure-Python “mock ROS” framework that implements a simple peer-to-peer pub/sub system, backed by SQLite for subscription registry and message history. It exposes a Publisher and Subscriber API, a thread-safe DBManager for CRUD operations, and a CLI entry point (iRobot run …) for launching nodes.
- Pub/Sub over TCP
- SQLite registry of subscribers and message history
- CRUD operations for subscriptions and messages
- Thread-safe singleton database manager
- CLI wrapper: iRobot run [--args …]
- Example nodes: talker (publisher) and listener (subscriber)
- Comprehensive pytest test suite
- Easy installation via pip install -e .
-
Python 3.8 or newer
-
(Optional) A virtual environment tool (venv, conda, etc.)
-
(On macOS/Linux) pip
# Clone your repo locally
git clone https://github.com/trieut415/iRobot.git
cd mock_ros
# Create and activate a virtualenv (optional but recommended)
python3 -m venv .venv
source .venv/bin/activate
# Install the package in editable mode
pip install --upgrade pip
pip install -e .Note: Installing in editable mode (-e) lets you iterate on the code without reinstalling.
You can invoke the framework via the console script iRobot:
# Run the talker (publisher) node
iRobot run nodes_py talker --topic chatter --message "Hello, ROS!" --rate 2.0
# In another terminal, run the listener (subscriber) node
iRobot run nodes_py listener --topic chatterIf you prefer not to install the console script, you can run the CLI module directly:
python -m irobot.cli run nodes_py talker --topic chatter --message "Hi there" --rate 1.0
python -m irobot.cli run nodes_py listener --topic chatter-
talker
--topic(default:chatter)--message(default:"Hello, ROS!")--rate(Hz, default:1.0)
-
listener
--topic(default:chatter)
Run the pytest suite:
# from the project root
pip install pytest
pytest -qYou should see all tests pass, verifying DB operations, networking, and CLI error handling.