rt0-cli
v1.0.0
Published
CLI tool to control iRobot Root robot
Readme
rt0-cli
CLI tool to control iRobot Root robot via Bluetooth Low Energy (BLE).
Installation
npm installUsage
1. Start daemon
Run without any command to connect to Root robot and maintain the connection:
node cli.jsThe daemon will:
- Search for and connect to a nearby Root robot
- Maintain the BLE connection
- Start an IPC server to receive commands
- Press
Ctrl-Cto disconnect and exit
2. Send commands
While the daemon is running, open another terminal and send commands:
node cli.js forward <distance>Available Commands
forward <distance>- Move forward by specified distance in millimeters (negative value to move backward)rotate <angle>- Rotate by specified angle in degrees (negative value to rotate counter-clockwise)penUp- Raise the penpenDown- Lower the penplayNote <frequency> <duration>- Play a note with specified frequency (Hz) and duration (ms)
Examples:
node cli.js forward 100
node cli.js rotate 90
node cli.js penUp
node cli.js penDown
node cli.js playNote 440 1000
# For negative values, use -- before the value
node cli.js forward -- -100
node cli.js rotate -- -90Architecture
- Daemon mode:
node cli.jsconnects to the robot and maintains the BLE connection - Command mode:
node cli.js <command>sends a command to the daemon via Unix socket - IPC socket:
/tmp/rt0-cli/daemon.sock - Commands are executed by the daemon process, which maintains the BLE connection
Requirements
- Node.js
- Bluetooth adapter
- iRobot Root robot
