• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple and robust serial communication protocol. It was designed for Arduino but can be used for other purposes (e.g. bluetooth, sockets). Implementation in C Arduino, C++, Python and Rust.

Robust Arduino Serial Protocol

Robust Arduino Serial is a simple and robust serial communication protocol. It was designed to make two Arduinos communicate, but can also be useful when you want a computer (e.g. a Raspberry Pi) to communicate with an Arduino.

Please read the Medium Article to have an overview of this protocol.

Implementations are available in various programming languages:

Examples are provided in each repository.

To clone all the repositories at once, tou need to use the --recursive command:

git clone https://github.com/araffin/arduino-robust-serial.git --recursive

Table of Contents

Provided Functions

Please check examples in the different repos to have the parameters details for each programming language.

  • read_order(): Read one byte from a file/serial port and convert it to an order (equivalent to read_i8)
  • read_i8(): Read one byte from a file/serial port and convert it to a 8 bits int
  • read_i16(): Read one byte from a file/serial port and convert it to a 16 bits int
  • read_i32(): Read one byte from a file/serial port and convert it to a 32 bits int
  • write_order(): Write an order to a file/serial port. (equivalent to write_i8)
  • write_i8(): Write one byte int to a file/serial port.
  • write_i16(): Write two bytes (16-bits) int to a file/serial port.
  • write_i32(): Write four bytes (32-bits) int to a file/serial port.

Arduino Implementation

1. Using Arduino IDE

Open arduino-board/slave/slave.ino in your Arduino IDE.

2. Using Arduino Makefile (Recommended)

This method only works with Linux/Mac Os systems: https://github.com/sudar/Arduino-Makefile

Install Arduino Makefile.

sudo apt-get install arduino-mk

Compile and upload the code to the Arduino (please check the board name in the Makefile):

cd arduino-board/
make
make upload

Python Implementation

Build Status

Python repository: https://github.com/araffin/python-arduino-serial

C++ Implementation

Build Status

C++ repository: https://github.com/araffin/cpp-arduino-serial

Rust Implementation

Build Status Build status

Rust repository: https://github.com/araffin/rust-arduino-serial

Real Life Example

This protocol was used on the Racing Robot: https://github.com/sergionr2/RacingRobot

The racing robot

Acknowledgments

I would like to thanks Dara Ly for the original idea of communicating with the Arduino via a command parser, and Xuan Zhang for fixing Arduino limited buffer issue.

More Repositories

1

rl-baselines-zoo

A collection of 100+ pre-trained RL agents using Stable Baselines, training and hyperparameter optimization included.
Python
1,124
star
2

robotics-rl-srl

S-RL Toolbox: Reinforcement Learning (RL) and State Representation Learning (SRL) for Robotics
Python
609
star
3

rl-tutorial-jnrr19

Stable-Baselines tutorial for JournΓ©es Nationales de la Recherche en Robotique 2019
Jupyter Notebook
583
star
4

sbx

SBX: Stable Baselines Jax (SB3 + Jax)
Python
303
star
5

srl-zoo

State Representation Learning (SRL) zoo with PyTorch - Part of S-RL Toolbox
Python
162
star
6

tools-for-robotic-rl-icra2022

Tutorial: Tools for Robotic Reinforcement Learning, Hands-on RL for Robotics with EAGER and Stable-Baselines3
HTML
91
star
7

rl-handson-rlvs21

Stable-Baselines3 (SB3) reinforcement learning tutorial for the Reinforcement Learning Virtual School 2021.
Jupyter Notebook
48
star
8

rlss23-dqn-tutorial

Deep Q-Network (DQN) and Fitted Q-Iteration (FQI) tutorial for RL Summer School 2023
Jupyter Notebook
47
star
9

aae-train-donkeycar

Code used to train an augmented auto-encoder (aka denoising auto-encoder with more augmentations) for the DonkeyCar simulator.
Python
43
star
10

rust-arduino-serial

A simple and robust serial communication protocol. It was designed for Arduino but can be used for other purposes (e.g. bluetooth, sockets). This is the Rust implementation.
Rust
35
star
11

python-arduino-serial

A simple and robust serial communication protocol. It was designed for Arduino but can be used for other purposes (e.g. bluetooth, sockets). This is the Python implementation.
Python
31
star
12

datasaurust

Blazingly fast implementation of the Datasaurus paper. Same Stats, Different Graphs.
Rust
19
star
13

cpp-arduino-serial

A simple and robust serial communication protocol. It was designed for Arduino but can be used for other purposes (e.g. bluetooth, sockets). This is the C++ implementation.
C++
18
star
14

pybullet_envs_gymnasium

Port of pybullet envs to gymnasium
Python
13
star
15

graph-annotation-tool

A graph annotation tool using a flask server and javascript
HTML
12
star
16

advent-of-code-2022

advent-of-code-2022 with Rust, easy to read solutions
Rust
4
star
17

es-with-search-path

Implementation of the (ΞΌ/ΞΌ,Ξ»)-Evolution Strategy (ES) with Search Path algorithm in C++
C
2
star
18

araffin.github.io

Personal Homepage
JavaScript
2
star
19

eagerx_quadruped

Python
1
star
20

custom-hugo-academic

HTML
1
star
21

her-experiments

Python
1
star