Python application for controlling the Zero Bot Pro (Original software here)
- Custom Configuration: Load configuration from a JSON file, including video and server settings.
- Service pulishing: For DNS-SD publishing of the service
- Video Streaming: Streams video from a specified device using GStreamer.
- WebSocket server:
For controlling:
- Video stream start/stop
- Motors TBD
- LEDs TBD
- Python 3.6 or later, with:
- PyGObject
- websockets
- asyncio
- msgpack (for serializing/deserializing messages)
- GStreamer With base, good, bad and ugly plugins packages
pip install --no-cache-dir -r requirements.txt
pip install .
See meta-mrobot Yocto layer for integrating with Yocto.
To run the application, use the following command:
python -m mrobot_controller.app config/default.json
Running with docker:
docker-compose -f docker/docker-compose.yml up
Communication with the controller is done over websockets. The messages are serialized using messagepack, which has an extensive support for various programming languages. The server receives commands and sends response on each command. These messages have these structures:
Command structure:
{
"command": string
"parameters": dict
}
** Response structure**:
{
"success": bool
"response": string
}
Command structure:
{
"command": "video_start"
"parameters": {
"host": string,
"port": int
}
}
Command structure:
{
"command": "video_stop"
"parameters": {}
}