ROS2 nodes for Waveshare Alphabot2-Pi mobile robot.

Overview

ROS2 for Waveshare Alphabot2-Pi

This repo contains ROS2 packages for the Waveshare Alphabot2-Pi mobile robot:

  • alphabot2: it contains the nodes used to manage Alphabot2 sensors and actuators.
  • alphabot2_interfaces: it contains all the custom interfaces (ROS messages) designed for AlphaBot2.

The current implementation includes nodes to manage the motors, the IR obstacle sensors and the camera. There is also a node for QR-code detection.

Please, see here for the ROS2 nodes topology and TODO.

The code has been originally developed for the final project of the Robotics course, University of Brescia.

Requirements

  • Robot: Waveshare Alphabot2-Pi mobile robot (see here), equipped a Raspberry Pi4 (8 GB).

  • OS: Ubuntu Server 20.04 (Focal Fossa) x64.

Ubuntu and ROS2 setup

Install Ubuntu Server 20.04 x64 on the RPi4 (see here).

Connect the RPi4 to WiFi and add auto-connection at boot (see here).

Install ROS2 Foxy Fitzroy Base (reference) and the dependencies:

/dev/null sudo apt update && sudo apt install ros-foxy-ros-base">
sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt install ros-foxy-ros-base

Install python dependencies:

sudo apt install python3-pip python3-colcon-common-extensions python3-rosdep2
pip3 install RPi.GPIO argcomplete

Initialize rosdep and source the ROS2 core environment:

rosdep update
source /opt/ros/foxy/setup.bash

Fix GPiO permission problem (reference):

sudo apt install rpi.gpio-common
sudo usermod -aG dialout ubuntu

Suggestions

Source the ROS2 core environment (underlay) and the ROS2 local workspaces (overlays) in the file .bashrc so that they are automatically sourced in every bash shell:

source /opt/ros/foxy/setup.bash
source /path_to_your_ros_ws/install/local_setup.bash

Plug an additional external network adapter and setup it as a WiFi Access Point to easily SSH into the RPi4. Please follow this guide and also these additional tricks:

  • put optional: true for wlan0 in 50-cloud-init.yaml to prevent endless booting time.
  • don't put After=network-online.target and Wants=network-online.target
  • sudo systemctl enable dnsmasq

Camera node (v4l2_camera)

For the Raspberry Camera management we use the ROS2 implementation v4l2_camera (reference).

Install required tools:

sudo apt install v4l-utils
echo bcm2835-v4l2 | sudo tee -a /etc/modules

Add start_x=1 in /boot/config.txt

Clone the camera node and dependencies needed to compress images into the src folder of your ros workspace:

git clone -b foxy https://gitlab.com/boldhearts/ros2_v4l2_camera.git
git clone -b ros2 https://github.com/ros-perception/vision_opencv.git
git clone -b ros2 https://github.com/ros-perception/image_common.git                  
git clone -b ros2 https://github.com/ros-perception/image_transport_plugins.git 

To fix building errors, modify camera_info_manager.cpp:46 (in image_common/camera_info_manager/) to:

#include "rcpputils/get_env.hpp"

Source build:

cd your_ros_ws
rosdep install --from-paths src -r -y
colcon build

Build and usage

After you have all the requirements satisfied, clone this repo in your_ros_ws/src and build it:

git clone https://github.com/Mik3Rizzo/alphabot2-ros2
cd your_ros_ws
colcon build

I recommend to run all the nodes at once using the launch file:

ros2 launch alphabot2 alphabot2_launch.py

To move the robot, publish a Twist ROS2 message on the alphabot2/cmd_vel topic. For example:

ros2 topic pub --rate 1 alphabot2/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 1.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 5.0}}"

This command publishes every second a linear velocity of 1 m/s and an angular rate of 5 rad/s.

Please note that the maximum theoretical linear velocity is 1.65 m/s while the angular rate is 38.8 rad/s. These quantities are estimated with the robot suspended from the floor and supplied with two Sony US14500VR Li-ion 3.7V batteries at full charge. In these conditions the maximum wheel RPM is 750.

About

Michele Rizzo, Master's Degree Computer Engineering student at University of Brescia.

Please, feel free to contact me for informations or problems.

Owner
Michele Rizzo
Philosophy, Engineering, Art. 🌶 Paparu' crusch enthusiast 🍃 Aequitas et elegantia
Michele Rizzo
Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation

🤖 RoboCop 🤖 Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation Made by Clemente Donoso, 📍 Chile 🇨🇱 RoboCop Lateral Fron

Clemente Donoso Krauss 2 Jan 04, 2022
Software framework to enable agile robotic assembly applications.

ConnTact Software framework to enable agile robotic assembly applications. (Connect + Tactile) Overview Installation Development of framework was done

Southwest Research Institute Robotics 29 Dec 01, 2022
A python module for interacting with rolimon's, a roblox value site.

rpi - rolimon's python interaction rpi is an open source python-based rolimon's api wrapper. It provides an end-to-end pipeline in which each componen

Acier 11 Nov 08, 2022
a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico

pico_ws2812b a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico You'll first need to save the ws2812b.py file to your device (for

76 Nov 25, 2022
Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Hirokazu Ishida 12 Nov 19, 2022
Jarvis: a personal assistant which can help you to manage your system

Jarvis Jarvis is personal AI based assistant which can help you to manage stuff in your computer. This is demo but I decided to make it more better so

2 Jun 02, 2022
🌱 - WebhookHard◞ Fines Educativos ◟

v1.0.0 WebhookHardware ¿Que es WebhookHardware? WebhookHardware se trata de un proyecto tratado para sacar informacion sobre el hardware de tus victim

3 Jun 14, 2021
A python script for macOS to enable scrolling with the 3M ergonomic mouse EM500GPS in any application.

A python script for macOS to enable scrolling with the 3M ergonomic mouse EM500GPS in any application.

3 Feb 19, 2022
A DiY holiday project to demonstrate how you can send data from adafruitIO cloud to a balena edge device

holiday-star balena ❤️ adafruitIO Introduction A DiY holiday project to demonstrate how you can send data from adafruitIO cloud to a balena edge devic

Ayan Pahwa 3 Dec 20, 2021
Bucatini: a soft PIPE PHY for FPGA SerDes

Bucatini: a soft PIPE PHY for FPGA SerDes Bucatini is a noodly gateware layer capable of transforming an FPGA SerDes into a PIPE PHY, allowing you to

Great Scott Gadgets 28 Dec 02, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 03, 2023
Custom component for interacting with Octopus Energy

Home Assistant Octopus Energy ** WARNING: This component is currently a work in progress ** Custom component built from the ground up to bring your Oc

David Kendall 116 Jan 02, 2023
Automatic CPU speed & power optimizer for Linux

Automatic CPU speed & power optimizer for Linux based on active monitoring of laptop's battery state, CPU usage, CPU temperature and system load. Ultimately allowing you to improve battery life witho

Adnan Hodzic 3.4k Jan 07, 2023
LUNA: a USB multitool & nMigen library

LUNA is a full toolkit for working with USB using FPGA technology; and provides hardware, gateware, and software to enable USB applications.

Great Scott Gadgets 750 Dec 28, 2022
Inykcal is a software written in python for selected E-Paper displays.

Inykcal is a software written in python for selected E-Paper displays. It converts these displays into useful information dashboards. It's open-source, free for personal use, fully modular and user-f

Ace 727 Jan 02, 2023
Home Assistant component to handle key atom

KeyAtome Home Assistant component to handle key atom, a Linky-compatible device made by Total/Direct-Energie. Installation Either use HACS (default),

18 Dec 21, 2022
A python library written for the raspberry pi.

A python package for using certain components on the raspberry pi.

Builder212 1 Nov 09, 2021
Skykettle ha - Redmond SkyKettle integration for Home Assistant

Redmond SkyKettle integration for Home Assistant This integration allows to cont

Alexey 'Cluster' Avdyukhin 48 Jan 06, 2023
What if home automation was homoiconic? Just transformations of data? No more YAML!

radiale what if home-automation was also homoiconic? The upper or proximal row contains three bones, to which Gegenbaur has applied the terms radiale,

Felix Barbalet 21 Mar 26, 2022
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022