Reinforcement Learning with Sim2Real on the Turtlebot3 platform (experiments)

While creating the concept of a new University module that has the students do a project with the Turtlebot3 robots and RL, a few ideas emerged. While evaluating different robot simulation tools for Reinforcement Learning, one in particular caught my eye: the Godot plugin “godot_rl_agents” by edbeeching. This was the result of a paper creating a bridge from Godot to RL libraries like StableBaselines3.

After trying the plugin it was clear that good result can be achieved quickly, there emerged the idea that students might be more encouraged learning the whole software stack when it involves a popular game engine instead of a “random” simulator with its own proprietary structure and configuration. So now it had to be proven that Sim2Real works with this Situation.

A friend modelled a “digital twin” of a turtlebot3, as the existing open source models usually used were very unoptimized and would hinder performance of actual training. It was purposefully minimal, but with accents to make it recognizable.

At first there was an example with just driving to a target point based on the map. No sensors needed.
Simulation:

This was the first result:

The robot visible moves pretty badly in this clip. The reason which was later found: When the sent velocity commands would result in a jerky movement, the controller kind of rejects it and sometimes only does a part of the movement. Or sometimes no movement at all. To counteract this, the input has to be smoothed out beforehand to resist rejection from the controller.

Here is the next experiment with the lerp in mind:

This was the result:

The video shows that the robots performance can definitely be improved regarding stability and sensor calculations. Another big problem is also very visible here in that the small metal caster on the back of the turtlebot is very incompatible with the labs’ carpet flooring. This will be mitigated in the future with wooden plates that will make up the box’s floor.

Turtlebot3 Rebuild – Integrating a Raspi and Jetson nano in one robot

The university I was a student at has a bunch of Turtlebot3 for student projects. And they got upgraded with a Jetson nano instead of the stock Raspberry Pi it had originally. After one student project on the new platform, it was clear that the Jetson nanos were good for calculating AI stuff, but terrible for reliability. So there was a plan to bring back the Raspberry Pis, but also keep the Jetson Nanos.

This was the initial rebuild:

This setup now has:
– two motors
– the OpenCR Board 1.0 for motor and battery control
– A Raspberry Pi 4 4gb as the Robot brain with Ubuntu 22.04 and ROS Humble
– A Jetson Nano for AI and Image operations
– Various sensors (ultrasonic, button, fisheye camera, 2d lidar, imu)

This prototype later got specific instructions what to screw in where, and short enough cables so they could be managed inside the robot. Another caveat that later popped up was that the power cables for the jetson nano were too thin, so a brown out occurred on power spikes. This was remedied by using the original barrel jack cables cut open and soldered in the place of the cables.

Here an example of the build instructions:

Note analyser

As a university project for the module “Multimedia”, I was in a team to develop hardware which would recognize single notes or cords being played on an instrument (tuned to piano sounds).

The project was run on a Raspberry Pi, and used the Fast Fourier Transformation to get the information needed. For a full writeup you best checkout the GitHub repository and the Printables entry.

Custom 3D Printed NAS

With the want to create a more professional NAS solution than the one in my apprenticeship (just a raspberry pi with two external USB 1TB HDDs lying on the floor), I wanted to create something cheap, but still good and with good capacity.

Since ready made NAS Enclosures would work, but are really expensive, I decided to Design my own in Fusion 360.

After finishing the model and printing it, I filled it with 4 2TB HDDs, which I configured in Raid 10.

In the back I placed the Raspberry Pi 4 and connected a daughterboard to control the Fans, as well as connecting the external ethernet port to enable a fast wired connection to outside the case. I also added a status LED, as well as a simple push button in order to have a “soft shutdown” button, which initiates a software shutdown. You can also just cut power with the power switch, but the soft shutdown is safer.

Here are real-life pictures of the hardware:

Fetch Machine

While being active in the community of Letsrobot I got an offer to try a product of Bare Conductive in trade with a documented project I do for their own blog. I got really interested in the product, so I agreed. It did take me a few months to actually finish it, but I have finally completed the project and got featured on both bare conductive’s site as well as adafruit’s one.

The product in question is the “Pi Cap” which is a hat for the Raspberry pi and adds a bunch of Capacitive touch and distance sensors. I wanted to make a product with my robots I built with LetsRobot in mind. Often enough I had people ask me to toss a ball across the room so they could fetch it, kinda like a pet. That’s what gave me the idea of a automatic fetch machine – like the ones that shoot tennis balls for dogs so they can play with themselves.

I ran into quite a few problems along the way. To list the biggest ones:

  1. Detection of the ball/robot: I thought I could make the capacitive sensors pick up the robot and motors, but that didn’t work at all. Also I needed the ball to be picked up somehow and didn’t needed a way to make that work as well.
  2. Creating the 3D models: While I already got some experience with smaller and less complicated models and thought I could create such models with some work. It took way longer than I thought, but eventually I managed to finish them.

Below a small gallery of the different steps I completed.

A summary of how it works: The script in the background is written in python and runs on the raspberry in the background. The Pi Cap senses the ball with a cable to a little aluminum foil piece which touches the ball when inserted into the loading arm. The arm is designed in such a way that the ball always rolls in the right spot to make contact. Once it senses something the script pauses for a few seconds to give the robot time to get out of the way. After that it sends a new positon for the loading servo to the servo microcontroller. This causes the ball to roll into the shooting head. After spinning up the two DC motors placed to accelerate the ball, the script moves the second servo to push the ball into the two motors. I also integrated a small LED to indicate the script sensing the ball and doing stuff.

Here is my last test:

And here a video of it in action: