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
Fener ROS2 package version 2

Fener's ROS2 codes that runs on the vehicle. This node contains basic sensing and actuation nodes for vehicle control. Also example applications will be added.

Muhammed Sezer 1 Jan 18, 2022
Testing additional addon devices, and their working scripts

ESP32-addon-devices-potpurri Testing additional addon devices, and their micropython working scripts 📑 List of device addons tested so far Ethernet P

f-caro 0 Nov 26, 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
Code reimplementation of some papers published in SAIL-Lab

SAIL SAIL-Lab统一代码库 Motivation 创建这个项目的动机最早来源于实验室组内成员相互Debug代码的时候遇到的麻烦。

Jianwen Chen 8 Nov 15, 2022
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
The PicoEMP is a low-cost Electromagnetic Fault Injection (EMFI) tool,

ChipSHOUTER-PicoEMP The PicoEMP is a low-cost Electromagnetic Fault Injection (EMFI) tool, designed specifically for self-study and hobbiest research.

NewAE Technology Inc. 312 Jan 07, 2023
Aqara Camera G3 integration for Home Assistant

Aqara Camera G3 integration for Home Assistant ATTENTION: The component only works after enabled telnet. Only supportd stream. Not support still image

14 Dec 18, 2022
LT-OCF: Learnable-Time ODE-based Collaborative Filtering, CIKM'21

LT-OCF: Learnable-Time ODE-based Collaborative Filtering Our proposed LT-OCF Our proposed dual co-evolving ODE Setup Python environment for LT-OCF Ins

Jeongwhan Choi 15 Dec 28, 2022
🎃 Some spooky code samples to hack yourself a pumpkin 👻

🎃 Tech Or Treat 👻 It's spooky season for those who celebrate Halloween, and to get in the spirit (spirit - get it? 👻 ) we thought it would be fun t

Jim Bennett 5 Feb 07, 2022
Sleep As Android integration for Home Assistant

Sleep As Android custom integration This integration will allow you to get events from your SleepAsAndroid application in a form of the sensor states

Igor 84 Dec 30, 2022
iot-dashboard: Fully integrated architecture platform with a dashboard for Logistics Monitoring, Internet of Things.

Fully integrated architecture platform with a dashboard for Logistics Monitoring, Internet of Things. Written in Python. Flask applicati

2 Jul 29, 2022
Programming of Robotics Systems course at the University of Aveiro, Portugal, 2021-2022.

Programação de Sistemas Robóticos Miguel Riem Oliveira Universidade de Aveiro 2021-2022 Projeto AtlasCar Projecto RACE IROS 2014 AtlasCar2 ATOM IROS 2

Miguel Riem de Oliveira 22 Jul 13, 2022
Turn your Raspberry Pi Pico into a USB Rubber Ducky

pico-ducky Turn your Raspberry Pi Pico into a USB Rubber Ducky Install Requirements CircuitPython for the Raspberry Pi Pico adafruit-circuitpython-bun

Konstantinos 5 Nov 08, 2022
Terkin is a flexible data logger application for MicroPython and CPython environments.

Terkin Data logging for humans, written in MicroPython. Documentation: https://terkin.org/ Source Code: https://github.com/hiveeyes/terkin-datalogger

hiveeyes 45 Dec 15, 2022
Hourglass on the pi pico using circuitpython

hourglass-on-pico "Hourglass" on the raspberry pi pico using circuitpython circuitpython version 7.0.0 Components used: Raspberry Pi Pico ADXL345 acce

4 Jul 18, 2022
Red Light Green Light Robot

Red Light Green Light Robot The primary problem addressed by our project is robotic follower behavior i.e. maintaining distance from a moving target.

Will Romano 2 Nov 20, 2021
Watson-Assistant with integration capabilities

Watson-Assistant-Integration Watson-Assistant with integration capabilities "main.py" should be deployed as Cloud Function (Action) on IBM Cloud. For

Sergey Usachev 1 Dec 20, 2021
Raspberry Pi Power Button - Wake/Power Off/Restart(Double Press)

Control Raspberry pi with physically attached button. Wake, Power Off, and Restart (Double Press) . Python3 script runs as a service with easy installation.

Stas Yakobov 16 Oct 22, 2022
Automatically draw a KiCad schematic for a circuit prototyped on a breadboard.

Schematic-o-matic Schematic-o-matic automatically draws a KiCad schematic for a circuit prototyped on a breadboard. How It Works The first step in the

Nick Bild 22 Oct 11, 2022
Yet another automation project because a smart light is more than just on or off.

Automate home Yet another home automation project because a smart light is more than just on or off. Overview When talking about home automation there

Maja Massarini 62 Oct 10, 2022