AI Rover Studio
v1.1.2Let an AI agent drive a 2D robot rover simulator in the browser: sensors, camera, wiring and code.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
open_simulator Open simulator
Open the AI Rover Studio page in the default browser and wait (up to 15 s) for it to connect to this MCP server.
connection_status Connection status
Report whether the simulator page is connected to this MCP server.
get_observation Get observation
Current robot pose (x, y, heading_deg), velocity, every enabled sensor reading, face display state, plus simulation status (running, autopilot, power, lamp position).
read_sensors Read sensors
Fresh readings from all enabled sensors, with their mounting position, angle, range and unit.
drive Drive
Move the rover for a fixed time: forward / backward, or turn left / right in place. Turns autopilot off and starts the simulation. Rotation speed is about 2 rad/s (≈115°/s), so turning 90° takes ≈0.8 s. Forward speed is 65 % of max speed (≈61 px/s at the default 55 % power; backward ≈51 px/s). With wait=true (default) it returns the observation after the move finishes. The rover stops on collisions.
| Parameter | Type | Description |
|---|---|---|
direction * | string | |
seconds | number | Duration, 0.2–10 s (default 2 for forward/backward, 1 for turns) |
wait | boolean | Wait for the move to finish before returning (default true) |
turn Turn by degrees
Turn the rover in place by an exact angle (+ = right / clockwise, − = left) at ≈115°/s, then return the observation. Unlike drive left/right there is no 0.2 s minimum, so small corrections (e.g. 7°) are exact.
| Parameter | Type | Description |
|---|---|---|
degrees * | number |
run_program Run a rover program
Run JavaScript on the robot with the `rover` library (same as the Code page; it replaces any running program and starts the simulation). Top-level await works. Motion (await): rover.forward(s), backward(s), turn(deg), left(s), right(s); rover.drive(speed −1…1, turn °/s) keeps going; rover.stop(); rover.power(%). Readings (sync, 50 ms snapshots): rover.read(id), sensors(), distance() (nearest sonar/IR cm), light() (%), bumped(), pose(), time(). Head/face: await rover.head(deg), trackLight(on), headAngle(); rover.face(emotion, text), say(text, s). Buttons: pressed(id), onButton([id], fn(eve…
| Parameter | Type | Description |
|---|---|---|
code * | string |
stop_program Stop the program
Stop the running rover program (its worker is terminated, the wheels stop).
get_program Program status
The current/last rover program: code, status (idle, running, listening, done, stopped, error), error { message, line } and the last 50 console lines.
stop Stop
Emergency stop: cancel any movement, turn autopilot off and pause the simulation.
set_simulation Start / pause simulation
Start (running=true) or pause (running=false) the physics simulation.
| Parameter | Type | Description |
|---|---|---|
running * | boolean |
set_autopilot Autopilot
Enable the built-in rule-based autopilot (seeks the light, backs away from obstacles; also starts the simulation) or disable it.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean |
set_power Motor power
Set motor power in percent (10–100). Max speed is 170 px/s at 100 % (drive uses 65 % of it forward, 55 % backward).
| Parameter | Type | Description |
|---|---|---|
percent * | number |
set_emotion Face expression
Show an expression on the robot's face display (emulated SSD1306 128×64 OLED); the message appears in the top text line and scrolls if long. Held ~5 s before sensor-driven emotions resume.
| Parameter | Type | Description |
|---|---|---|
emotion * | string | |
message | string | Speech text shown under the face |
display_text Show text on the display
Make the rover "say" a text on the Face Display module (128×64 OLED): a small rover face with a talking mouth and the text typed out in a speech bubble (Thai supported, ~11 characters per line, 2 lines per bubble, extra bubbles follow). Returns to the big face after `seconds`, or once every bubble has been shown if that takes longer.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
seconds | number | How long to show it (default 6) |
set_display Choose the display module
Fit a different Face Display module: "ssd1306" (0.96" 128×64 monochrome OLED, I²C; default), "ssd1331" (0.95" 96×64 colour RGB OLED, SPI) or "st7789" (1.3" 240×240 colour IPS TFT, SPI). Faces and text adapt to the resolution; colour modules show a colour per emotion. `panel` changes the SSD1306 glass colour. Returns read_display.
| Parameter | Type | Description |
|---|---|---|
model | string | |
panel | string | SSD1306 panel colour: yellow-blue (top 16 rows yellow, rest blue; the default), white, blue or yellow |
draw_display Draw a picture on the display
Show a picture on the Face Display module for `seconds`, then return to the face. Pass one string per pixel row, at most the module's resolution (SSD1306 128×64, SSD1331 96×64, ST7789 240×240; see read_display). Characters space . 0 - _ are dark. On colour modules (SSD1331, ST7789) these letters pick a colour: R red, O orange, Y yellow, G green, C cyan, B blue, P purple, M pink, W white, A grey, N brown, K black; any other character is white, and `palette` adds or overrides letters. On the monochrome SSD1306 every non-blank, non-black character is a lit pixel and colour comes from its panel…
| Parameter | Type | Description |
|---|---|---|
rows * | array | Pixel rows, top to bottom |
palette | object | Extra colour letters, e.g. {"s": "#87ceeb"} (colour modules) |
panel | string | SSD1306 panel colour: yellow-blue (top 16 rows yellow, rest blue; the default), white, blue or yellow |
scale | integer | Pixel size (default 1) |
seconds | number | How long to show it (default 10) |
read_display Read the display
Read back what the Face Display module is showing: mode (face/text), text lines, module stats (frames, fps, bytes) and the actual 128×64 pixels from the module's GDDRAM as ASCII art (█▀▄, 2 pixel rows per line).
move_light Move light source
Move the light source to world coordinates (clamped to 42–758 × 42–478).
| Parameter | Type | Description |
|---|---|---|
x * | number | |
y * | number |
reset_world Reset world
Put the rover back at its start pose (120, 265, heading 0°) and the light at (690, 70). Turns autopilot off.
send_chat Send chat command
Send a message to the in-page Agent Chat (offline Thai/English command parser, e.g. "ไปหาแสง", "อ่านเซนเซอร์", "เดินหน้า 2 วินาที") and return the rover's reply. It shows up in the chat panel.
| Parameter | Type | Description |
|---|---|---|
text * | string |
get_manifest Get robot manifest
The Robot Capability Manifest (ai-cartridge/body-v1): motors, installed sensor modules and display.
list_sensors List sensors
All configured sensors (enabled or not) with id, type, mounting position, angle and range.
add_sensor Add sensor
Install a new sensor on the rover body. Unspecified fields use the type defaults (centre of the body, facing forward).
| Parameter | Type | Description |
|---|---|---|
type * | string | |
angle | number | Facing angle in degrees, 0 = forward, 90 = right side (wrapped to −180…180) |
enabled | boolean | |
name | string | Display name |
range | number | Detection range in cm |
x | number | Local x in px (forward +, rear −) |
y | number | Local y in px (right side +, left side −) |
update_sensor Update sensor
Change a sensor's name, type, mounting position, angle, range or enabled flag. Use list_sensors to find ids.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
angle | number | Facing angle in degrees, 0 = forward, 90 = right side (wrapped to −180…180) |
enabled | boolean | |
name | string | Display name |
range | number | Detection range in cm |
type | string | |
x | number | Local x in px (forward +, rear −) |
y | number | Local y in px (right side +, left side −) |
remove_sensor Remove sensor
Uninstall a sensor by id.
| Parameter | Type | Description |
|---|---|---|
id * | string |
set_module Install / remove a module
Install or remove a body module: "wheels" (drive motors + wheels; without them the rover cannot move), "head" (pan servo that turns the face and the light sensors), "display" (AI Face Display OLED) or "camera" (forward-facing camera).
| Parameter | Type | Description |
|---|---|---|
installed * | boolean | |
module * | string |
set_head Turn the head
Control the Head module (pan servo, needs set_module head first). angle_deg turns the face to −90…90° relative to the body (+ = right, servo ≈180°/s) and switches to manual. track_light=true makes the head find and follow the light with its own light sensors: it sweeps the full range, settles on the brightest angle and keeps hill-climbing (rescans if the light is lost). Light sensors are directional (brightest when facing the lamp) and ride on the head. Starts the simulation.
| Parameter | Type | Description |
|---|---|---|
angle_deg | number | |
track_light | boolean |
press_button Press a button
Press a push-button module (a sensor of type "button") for `seconds` and release it, like a person would. Held ≥ 0.8 s is a long press. The built-in program reacts: short press toggles the head's light tracking (happy face), long press stops everything (driving, autopilot, tracking; pauses the simulation). Returns the press event.
| Parameter | Type | Description |
|---|---|---|
id * | string | Button sensor id (list_sensors) |
seconds | number | How long to hold it (default 0.2 s) |
get_button_events Button events
Button presses since the last call (oldest first, then cleared): { id, name, press: "short" | "long", seconds, at (ms epoch) }, plus every button and whether it is held right now. People press buttons in the simulator page; poll this to react to them.
get_head Head status
Head module status: angle_deg, target_deg, mode (manual / track_light), tracking phase and the head light brightness.
capture_camera Capture camera image
Take a picture with the rover's forward-facing camera (needs the camera module). Returns a 320×240 first-person PNG (walls, colored obstacles, colored floor tape, the light source) and a JSON list of what is in view: type (obstacle / tape / light), id, color, bearing_deg (0 = straight ahead, + = right) and distance_cm.
| Parameter | Type | Description |
|---|---|---|
fov_deg | number | Change the horizontal field of view first (default 60°) |
get_sensor_map Get sensor map
The map the rover has built from its own sensors only (not the true layout): an occupancy grid of 10 px cells as ASCII rows ("#" occupied by a sonar/IR echo or bumper hit, "." free, " " unknown, "@" rover, a capital letter = floor color read by a color sensor), camera landmarks with estimated world x/y, bumper hit points, the pose and exploration stats. clear=true wipes the map first.
| Parameter | Type | Description |
|---|---|---|
clear | boolean | Clear the map before returning it (default false) |
get_wiring Get wiring
How the fitted rover body wires to a real microcontroller (the Wiring page): for each part (TB6612FNG motor driver, each enabled sensor, the display module, the camera) every pin and where it goes (MCU pin or 5V / 3V3 / GND / VBAT rail), the power budget per rail, issues found (pin conflicts, missing pins, 5 V signals into 3.3 V pins, duplicate I²C addresses, ESP32 strapping / ADC2 pins) and a ready-to-use pin file (Arduino pins.h, or pins.py with BCM numbers on the Pi). `board` switches the board first: "esp32" (ESP32 DevKit V1), "uno" (Arduino Uno R3) or "raspberrypi" (Raspberry Pi 4/5 40-p…
| Parameter | Type | Description |
|---|---|---|
board | string |
get_bom Get parts list
Bill of materials for building the fitted rover body for real (the parts tab on the Wiring page): the board, motor driver, every enabled sensor, display, camera and head servo, plus the parts the circuit needs around them (chassis, battery, buck converter, voltage-divider resistors, level shifter …), each with quantity, approximate price in THB and shop links when known, and a plain-text list to copy. `board` switches the board first: "esp32", "uno" or "raspberrypi".
| Parameter | Type | Description |
|---|---|---|
board | string |
get_firmware Get firmware
A complete program for the real robot, generated from the fitted body and the wiring pin map: an Arduino sketch (rover_firmware.ino) for "esp32" / "uno", or a Python script (rover.py) for "raspberrypi". It drives the TB6612FNG wheels, reads every enabled sensor, turns the head servo (with light tracking), draws faces on the display and runs the same auto emotions / rule-based autopilot as the simulator. Text commands over Serial 115200 / stdin: READ, F|B|L|R <s>, AUTO 0|1, POWER <%>, HEAD <deg>, TRACK 0|1, EMO <emotion> [text], SAY <text>, STOP. Returns { name, text }. `board` switches the boa…
| Parameter | Type | Description |
|---|---|---|
board | string |
list_world List world layout
World size, light position, all obstacles (id, kind, shape, position, size, color) and colored floor tapes.
add_obstacle Add obstacle
Place an object in the world to test sensors, collisions or the camera. Kinds: cylinder / ball (circle, radius r), box / wall (rectangle w × h, rotated by angle°). Unspecified size and color use the kind's defaults. Refused if it would overlap the rover.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
x * | number | World x (px) |
y * | number | World y (px) |
angle | number | Rotation in degrees for box / wall |
color | string | |
h | number | Height (depth) for box / wall |
r | number | Radius for cylinder / ball |
w | number | Width for box / wall |
remove_obstacle Remove obstacle
Remove an obstacle by id (see list_world).
| Parameter | Type | Description |
|---|---|---|
id * | string |
add_color_tape Add colored floor tape
Stick a strip of colored tape on the floor (for the color sensor, line following and the camera). A color sensor over the tape reads its color name.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
x * | number | Centre x (px) |
y * | number | Centre y (px) |
angle | number | Rotation in degrees (0 = along x) |
length | number | Length in px (default 100) |
width | number | Width in px (default 18) |
remove_color_tape Remove colored floor tape
Remove a floor tape by id (see list_world).
| Parameter | Type | Description |
|---|---|---|
id * | string |