17/01/2021 ROS, Jarvis, Arduino, firmware, booklet

Jarvis Arduino firmware

This post is the follow up post of the previous JETTY: Jarvis Serial to ROS-2 Transport Layer post.

The arduino firmware on the one hand implements the JETTY protocol for communicating with ROS and on the other hand takes care of all low-level hardware communication including:

  • Reading of battery voltage from the ADS1115 16-Bit ADC sensor
  • Reading of 9DOF IMU sensor data from MPU 9250 IMU sensor
  • Reading of raw odometry data from two motor magnetic encoders
  • Control two motor via Adafruit Motor Shield V2

The Jarvis booklet section Arduino Firmware presents the insight detail on the firmware implementation. It covers the following topics:

  1. The JETTY protocol implementation on Arduino
  2. Different routines implemented on the firmware
  3. Odometry data reading from hall effect sensor
  4. A strategy for battery voltage reading and monitoring
  5. Motors controlling

Follow up reading at: https://doc.iohub.dev/jarvis/Ym9vazovLy9jXzIvc18yL0lOVFJPLm1k/Arduino_Firmware.md

JETTY: Jarvis Serial to ROS-2 Transport Layer

My ROS based DIY robot( presented in the previous post) uses the NVIDIA Jetson Nano for high level robotic algorithms with the ROS 2 middle-ware. The Jetson is connected to an Arduino via a serial link for low-level hardware interaction and control.

As the Arduino is used for low-level communication with actuators/sensors. We need a software transport layer on top of the physical serial link (Jetson - Arduino) to stream (sensor) data/command from Arduino to ROS 2 and vice versa. On Dolly (my previous robot version), which used ROS 1, this was handled by Rosserial, a protocol for wrapping standard ROS serialized messages and multiplexing multiple topics and services over a serial link. On ROS 2, however, Rosserial is not available. Other alternative solutions exist but are not mature enough, some implementations require more computational resource which exceeds the capability of the Arduino Mega 2560.

So i decided to implement a dedicated transport layer for Jarvis called JETTY (Jarvis SErial to ROS-2 TransporT LaYer). I do not aim at a generic protocol for ROS to serial communication like ROS serial. Instead, the implementation of the transport layer should be specific only to the robot. However, the protocol must be easy to extend to adapt to any future upgrade of the robot such as adding more sensor/actuators.

Requirements on the transport layer:

  1. The transport layer must allow to stream data in form of frames (fixed size or not)
  2. Simple but reliable, unambiguous packet framing protocol, frame should be easy to identify
  3. Fast frame synchronization: When an endpoint (Arduino or ROS) connects to the Serial link in the middle of the data streaming, frame synchronization should be fast while minimizing the frames lost in the synchronization phase
  4. Frame should be verified using checksum before being consumed by an endpoint
  5. Packet framing overhead is allowed but need to be minimized
  6. The algorithms should be easy to implement and computationally inexpensive on both Jetson and Arduino

Brief, we need an efficient and reliable delimiting/synchronization scheme to detect the frame with short recovery time.

The detail on the choice of protocol and algorithm as well as insight implementation is presented on a section of my Jarvis booklet accessible via the following link:

https://doc.iohub.dev/jarvis/Ym9vazovLy9jXzIvc18xL0lOVFJPLm1k/JETTY:_Jarvis_Serial_to_ROS-2_transport_layer.md

Jarvis: The DIY robot

It has been a while since i started to build an upgraded version of Dolly, my first DIY ROS based robot. This upgraded version is named Jarvis.

Changes from the previous version:

  • Hardware:
    • The robot is now use tracks instead of wheels
    • Jarvis footprint is bigger and has more room to mount addition components
    • Jarvis uses NVIDIA Jetson Nano as high-level control board instead of Raspberry 3B (used in Dolly). The Jetson board has more GPU and processing power, and is suitable for machine learning stuffs (with the camera).
    • Jarvis uses step-down voltage regulator instead of step-up regulator (Dolly), the regulator provide more juice (up to 3A for each output)
    • 128 GB USB based SSD for operating system and storage instead of SD card
  • Software:
    • Linux Ubuntu 20.04
    • ROS 2 is used instead of ROS (on Dolly)

As a work in progress, I'm now writing a booklet that detail the building process of the robot both on hardware and soft software (Arduino, ROS 2), as well as some application use cases. The initial plan is:

  1. Introduction
  2. Robot modeling and simulating with ROS 2 and Gazebo
  3. Building the robot hardware step by step
  4. Basic robot controlling software with ROS 2
  5. Use case projects: such as localisation and mapping, autonomous navigation, obstacle avoidance with machine learning, etc.

All further updates on the booklet can be found here: https://doc.iohub.dev/jarvis/.

Stay tunned!!!

Powered by antd server, (c) 2017 - 2024 Dany LE.This site does not use cookie, but some third-party contents (e.g. Youtube, Twitter) may do.