WORK IN PROGRESS
SHORT: A Compact RPC (Remote Procedure Call) Protocol
LONG: A master driven software Bus protocol inspired by PCI/USB bus, based on Google protobuf. By standardizing the interface of commonly used peripheral devices, the controlling logic is modulized and re-usable.
A bus is a logical group of peripheral devices. A master connects to the bus and runs controlling logic. A bus itself is also a device, so it can be attached to another bus, thus building a complex hierarchical bus tree is possible. The communication between master and bus, bus and device can be remote. The transportation is abstract, and the protocol is specially designed to make communication over serial port possible.
When building a robot, a lot of peripherals are common, e.g. sensors, servos, step motors, DC motors etc. The interface of these devices can be standardized, and the robot itself becomes a collection of these devices. On the controlling side, many logics are re-usable, e.g. controlling left/right motors for different motion behaviors. With standardized device interfaces, the controlling logics can be easily wrapped in highly re-usable modules.
- Small footprint: the protocol should be able to run on micro controllers
- Error proof: the protocol must have recovery mechanism if transmission error encountered
Protobuf is a very efficient and compact
binary message encoding format, and fits our goals best.
The only thing left is to build an RPC protocol on top of it.
See Protocol for a draft of the RPC wire format.
And also in the folder proto
, standardized commonly used device interfaces are defined.
- Notification streams from device, for sensors
- Bus/Board matching
- Error recovery on serial transportation
- Support C/C++, especially for Arduino
- Support Java, for Android
- Support Python, preferred for AI