How rukmanishahi/smart-warehouse-autonomous-robot works
Purpose and entry points
Tempest AMR is a reference control stack for warehouse box sorting: camera-derived attributes are classified, mapped to a destination, issued to an ESP32 robot controller, and confirmed after drop. Primary host entry point is sorting_controller.py; embedded entry point is esp32_firmware.ino. motor_control.ino is a related Arduino motor-control unit.
Host orchestration state machine
sorting_controller.py owns the sorting cycle and state transitions: IDLE → SCAN → CLASSIFY → MOVE → DROP → IDLE. It coordinates camera classification, routing decisions, serial commands, and returned robot status. This is the primary control-plane boundary between high-level sorting policy and physical actuation.
• sorting_controller.py
• serial_bridge.py
Vision and item attribute extraction
vision_classifier.py uses OpenCV-oriented logic to derive sortable box attributes, including color, size, and potentially barcode information. Its calibration-sensitive thresholds isolate camera/lighting concerns from downstream routing logic.
• vision_classifier.py
• requirements.txt
Routing and sorting policy
decision_engine.py converts classified item attributes into a destination bin or movement target. The current design is rule/lookup based, while the README identifies a future boundary to map-aware navigation such as ROS 2 Nav2/A*; that planner is not present in this repository.
• decision_engine.py
• sorting_controller.py
Serial protocol boundary
serial_bridge.py is the host-side UART adapter to the ESP32. Commands flow Python → serial → firmware; status/confirmation flows firmware → serial → Python. This boundary decouples Python runtime logic from Arduino/C++ hardware implementation and requires a configured serial port at launch.
• serial_bridge.py
• sorting_controller.py
• esp32_firmware.ino
Embedded robot control and sensing
The ESP32 firmware implements low-level motor/encoder movement, arm/servo actuation, sensor handling, bin movement table behavior, drop confirmation, and serial command processing. Hardware-dependent values—including pin mapping, encoder distance/turn calibration, load-cell scale, attachment-ID voltage bands, and bin coordinates—belong on this side.
• esp32_firmware.ino
• motor_control.ino
Local device UI and infrastructure
In addition to serial control, the ESP32 creates its own Wi-Fi access point and hosts a simple browser control page through Arduino WiFi/WebServer facilities. It uses ESP32 Arduino libraries plus HX711 and ESP32Servo for hardware integration. The host runtime is Python with dependencies declared in requirements.txt; no cloud service or server infrastructure is indicated.
• esp32_firmware.ino
• requirements.txt
Components 15
Host control
Python sorting control plane.
- Sorting controller · Runs IDLE → SCAN → CLASSIFY → MOVE → DROP.
sorting_controller.py - Vision classifier · Extracts color, size, and possible barcode attributes.
vision_classifier.py - Decision engine · Maps item attributes to destination bins or targets.
decision_engine.py - Serial bridge · Translates host commands and returned robot status.
serial_bridge.py - Host dependencies
requirements.txt
ESP32 robot
Firmware, hardware control, and local device UI.
- ESP32 firmware · Processes serial commands and coordinates robot operation.
esp32_firmware.ino - Command processing · Receives movement and drop commands; returns status.
esp32_firmware.ino - Motion control · Executes calibrated bin movement and turns.
esp32_firmware.ino - Drop mechanism · Actuates drops and confirms completion.
esp32_firmware.ino - Robot sensors · Supplies hardware confirmation and identification signals.
esp32_firmware.ino - Motor control unit · Related standalone motor-control implementation.
motor_control.ino - Local web control · Serves a browser control page from the ESP32.
esp32_firmware.ino
Other components
- Camera input
- Robot hardware
- Browser
Connections 19
- Camera input → Vision classifier: frames
- Sorting controller → Vision classifier: scan / classify
- Vision classifier → Decision engine: item attributes
- Decision engine → Sorting controller: destination target
- Sorting controller → Serial bridge: robot command
- Serial bridge → ESP32 firmware: UART commands
- ESP32 firmware → Serial bridge: status / confirmation
- Serial bridge → Sorting controller: robot status
- ESP32 firmware → Command processing: dispatches
- Command processing → Motion control: move commands
- Command processing → Drop mechanism: drop commands
- Robot sensors → ESP32 firmware: sensor readings
- Motion control → Robot hardware: motor control
- Drop mechanism → Robot hardware: servo actuation
- Robot hardware → Robot sensors: encoder and sensor signals
- ESP32 firmware → Local web control: hosts
- Browser → Local web control: local Wi-Fi access
- Motor control unit → Robot hardware: motor control
- Host dependencies → Vision classifier: runtime packages