Appearance
Backend
The backend component implements CoderBot control and programming runtime.
It is based on a single Python process executing the Flask web server.
The services are all implemented, and served, as REST API exposed by the connexion framework.
CoderBot API
See the full specification of the CoderBot REST API.
Features
The backend services are used by the Web App front end in order to execute commands on the CoderBot hardware (direct control of motors), as well as providing the real time video stream.
The backend implements API to manage CoderBot configurations and programs, offering read/write/delete to all entities, which are persisted on the local Raspberry Pi nass storage (the data partition of the micro-sd).
One core feature of the backend component is the ability to execute user defined programs, which are programs written by the CoderBot users using the blockly editor available in the Web App.
The backend component implements the runtime environment for user programs. User programs are sent from the Web App to the backend via REST API as a Python source code generated by blockly. The Python code is "instrumented" with "on-demand loop exit" statetements and then executed as part of the main Python backend program (in the context of the same process of the main backend runtime).
The backend implements all binding required to control the CoderBot, either by reading input and controlling outputs.
The main features implemented are:
- video stream - provides a continuos video stream (MJPEG format) of the Raspberry Pi Camera to the Web App
- ultrasonic sensors - provides distance readings from the sensors
- motor control / encoder reading - provides control over the motors, as well as reading the input from the step encoders plugged on the moters
- computer vision - provides several decoding algorithm based on OpenCV framework, in order to detect objects and features from images taken from the video stream, including image classification and obkect recognition via deep neural networks models and the Tensorflow Lite runtime framework.
- audio output - emits sounds and text to speach via audio output device
- audio input - detects sounds and noise through the audio input device
- music - provides a musical instruments API on top of audio output device