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!!!

Meet Dolly the robot

Ladies and gentlemen, please meet "Dolly the robot", the first version of my DIY mobile robot. My goal in this DIY project is to make a low-cost yet feature-rich ROS (Robot Operating System) based mobile robot that allow me to experiment my work on autonomous robot at home. To that end, Dolly is designed with all the basic features needed. To keep the bill of material as low as possible, i tried to recycle all of my spare hardware parts.

Specification

  • Robot's chassis is 3D printed, the chassis's plate design is borrowed from the design of Turtlebot 3 which is a smart design, IMO. The other hardware parts, however, are completely different from the Turtlebot 3.
  • IMU sensor with 9 DOF (accelerometer, magnetometer and gyroscope) for robot orientation measurement
  • Two DC motors with magnetic encoders using as wheels and odometer
  • Arduino Mega 2560 for low level control of the robot
  • Raspberry PI 3B+ with embedded Linux for high level algorithm and network communication. The ROS middle-ware on top of the Linux system offers a powerful robotic software environment
  • A 360 degree Neato LiDAR (laser scanner) up to 6 m range
  • A 8 Mega pixel camera (Raspberry PI camera)
  • Adafruit Motor shield V2 for motor controlling
  • 10000 Mah battery
  • ADS1115 analog sensor to measure and monitor battery usage
  • 0.95" (128x64) mini OLED display
  • The robot can be tele-operated using a bluetooth controller such as a PS4 controller

Applications

  • Localization and mapping (SLAM)
  • Obstacle avoidance
  • Autonomous navigation
  • Robot perception algorithms with LIDAR sensor and camera
  • Much more...
18/06/2019 PhaROS, ROS, Pharo, tutorial

A first step guide to PhaROS

PhaROS is a collection of Pharo libraries that implements the ROS (Robot Operating System ) based client protocol. It allows developing robotic applications right in the Pharo environment by providing an abstract software layer between Pharo and ROS. This guide makes an assumption that readers already have some basic knowledge about ROS, if this is not the case, please check the following links before going any further on this page:

Controlling a Turtlebot using PhaROS: Goals planning and Automatic docking

This is a demonstration of my current work on controlling robot using ROS and PhaROS. For that task, I've developed a dedicated PhaROS package that defines:

  1. A base framework for ROS based visualization such as map, robot model, robot trajectory, etc.
  2. An Event-driven API for robot controlling
28/08/2018 ROS, SLAM, Metrics, evaluation, SSIM, MSE, NE

Evaluation of grid maps produced by a SLAM algorithm

When evaluating the performance of a SLAM algorithm, quantifying the produced map quality is one of the most important criteria. Often, the produced map is compared with (1) a ground-truth map (which can be easily obtained in simulation) or (2) with another existing map that is considered accurate (in case of real world experiment where the ground-truth is not always available ).

Basically, grid maps are images, so image similarity measurement metrics can be used in this case. In this post, we consider three different metrics: Mean Square Error (MSE), K-nearest based normalized error (NE) and Structure Similarity Index (SSIM)

Adding noise to odometry data published by the Gazebo simulator

I've had funny time playing around with the Gazebo simulator for autonomous robot exploration. One thing I've encountered is that the odometry data provided by Gazebo is so perfect that, sometime, makes the simulation less realistic. I used a Turtlebot model as robot model in my simulations. Googling around, i didn't find any solution of adding noise to the odometry data of this robot (using the URDF file). I then decided to develop a dedicated ROS node allowing me to add some random noise to the Gazebo's odometry data.

The robot motion model

First thing fist, we need to understand the robot motion model. There are many motion models, but in the scope of this article, we focus only on the odometry motion model. Often, odometry is obtained by integrating sensor reading from wheel encoders, it measures the relative motion of the robot between time \(t\) and \(t-1\) or \((t-1,t]\). In 2D environment, a robot pose is represented by a point \((x,y)\) and an orientation (rotation angle) \(\theta\), so the robot pose at the time \(t-1\) and \(t\) are denoted by:
$$p_{t-1}=(x_{t-1},y_{t-1},\theta_{t-1})$$
$$p_{t}=(x_t,y_t,\theta_t)$$

Setting up a software stack for autonomous mono robot exploration and mapping using ROS

Prerequisites

This setup is performed and documented on an Ubuntu system with the following software stack:

  • Ubuntu 16.04 LTS (may work on other distribution though)
  • ROS kinetic: if you don't have ROS pre-installed, please refer to this tutorial http://wiki.ros.org/kinetic/Installation/Ubuntu. I suggest to use the full desktop installation configuration, this will take a while (> 2 GB)
  • Gazebo for simulation (it is installed by default if you choose the full desktop installation when installing ROS)
  • GIT (sudo apt-get install git)
  • Catkin for package building (installed by default when installing ROS)

To follow this post, some basic knowledge on ROS is needed:

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.