Firmware for the Raspberry Pi 3b.
This project also contains the arduino sketch inside arduino-sketch
.
This code has been written for, and tested only on, the Raspberry Pi 3b with an Arduino Due.
Using a different Nerves target will probably work.
Using a different Arduino board will probably not work because the arduino sketch is uploaded using bossac
which is made for ARM boards, so it won't work with AVR boards such as the Arduino Uno.
The compiled arduino sketch and the bossac
tool are included in the firmware image at compile time (see the Makefile).
When the Raspberry Pi boots, it will automatically flash the compiled sketch onto the Arduino Due using bossac
.
The Arduino Due is connected to the Raspberry Pi via a USB cable and they communicate through UART.
- Each packet is COBS encoded.
- The end of each packet is market by the
0x00
byte.
Name | Size (bytes) | Description |
---|---|---|
packet_id |
1 | Packet id |
packet fields... | Various packet fields depending on the packet |
Sent to signal that the Arduino is ready (Braccio arm has been initialized and is ready to accept commands). This packet does not contain any data. This packet does not expect any response.
name | type | value | description |
---|---|---|---|
packet_id | byte | 0x00 |
Sent to the Arduino to set the Braccio position. This packet does not expect any response.
name | type | value | description |
---|---|---|---|
packet_id | byte | 0x01 |
|
base | byte | 0 - 180 | Desired position of the base joint |
shoulder | byte | 15 - 165 | Desired position of the shoulder joint |
elbow | byte | 0 - 180 | Desired position of the elbow joint |
wrist_ver | byte | 0 - 180 | Desired position of the wrist_ver joint |
wrist_rot | byte | 0 - 180 | Desired position of the wrist_rot joint |
gripper | byte | 10 - 73 | Desired position of the gripper joint |