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.

You might also like...
Example for Calculating Robot Dynamics Using Pinocchio Library

A Example for Calculating Robot Dynamics Using Pinocchio Library Developed by: Xinyang Tian. Platform: Linux + Pinocchio. In this work, i use Pinocchi

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.

Robot Framework keyword library wrapper for atlassian-python-api

Robot Framework keyword library wrapper for atlassian-python-api

Toy robot that traverses on a finite surface

Toy Robot Challenge - Release Notes November 12, 2021 New features Initialisation - Users can set the home position and heading of the robot. Position

Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation
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

The robot is an autonomous small scale racing car using NVIDIA Jetson Nano.
The robot is an autonomous small scale racing car using NVIDIA Jetson Nano.

The robot is an autonomous small scale racing car using NVIDIA Jetson Nano. This project utilizes deep learning neural network framework Keras/Tensorflow, together with computer vision library OpenCV, to achieve self driving. The robot has camera and he is using computer vision to detect the road and follow it. The robot also can be controled by joystick or cellphone for driving.

Python implementation of ZMP Preview Control approach for biped robot control.
Python implementation of ZMP Preview Control approach for biped robot control.

ZMP Preview Control This is the Python implementation of ZMP Preview Control app

Ros2-voiceroid2 - ROS2 wrapper package of VOICEROID2

ros2_voiceroid2 ROS2 wrapper package of VOICEROID2 Windows Only Installation Ins

πŸ¦• NanoSaur is a little tracked robot ROS2 enabled, made for an NVIDIA Jetson Nano

πŸ¦• nanosaur NanoSaur is a little tracked robot ROS2 enabled, made for an NVIDIA Jetson Nano Website: nanosaur.ai Do you need an help? Discord For tech

This is an example manipulation package of for a robot manipulator based on Drake with ROS2.

This is an example manipulation package of for a robot manipulator based on Drake with ROS2.

An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi.
An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi.

An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi. This is the source codes of my programming assignmen

AlphaBot2 Pi Core software for interfacing with the various components.

AlphaBot2-Pi-Core AlphaBot2 Pi Core software for interfacing with the various components. This project is currently a W.I.P. I will update this readme

Mobile Detect is a lightweight Python package for detecting mobile devices (including tablets).
Mobile Detect is a lightweight Python package for detecting mobile devices (including tablets).

Django Mobile Detector Mobile Detect is a lightweight Python package for detecting mobile devices (including tablets). It uses the User-Agent string c

 Anomaly Detection Based on Hierarchical Clustering of Mobile Robot Data
Anomaly Detection Based on Hierarchical Clustering of Mobile Robot Data

We proposed a new approach to detect anomalies of mobile robot data. We investigate each data seperately with two clustering method hierarchical and k-means. There are two sub-method that we used for produce an anomaly score. Then, we merge these two score and produce merged anomaly score as a result.

Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator
Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator

DRL-robot-navigation Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator. Using Twin Delayed Deep Deterministic Policy Gra

Position detection system of mobile robot in the warehouse enviroment
Position detection system of mobile robot in the warehouse enviroment

Autonomous-Forklift-System About | GUI | Tests | Starting | License | Author | 🎯 About An application that run the autonomous forklift paletization a

A lightweight, pure-Python mobile robot simulator designed for experiments in Artificial Intelligence (AI) and Machine Learning, especially for Jupyter Notebooks
A lightweight, pure-Python mobile robot simulator designed for experiments in Artificial Intelligence (AI) and Machine Learning, especially for Jupyter Notebooks

aitk.robots A lightweight Python robot simulator for JupyterLab, Notebooks, and other Python environments. Goals A lightweight mobile robotics simulat

Guiding evolutionary strategies by (inaccurate) differentiable robot simulators @ NeurIPS, 4th Robot Learning Workshop
Guiding evolutionary strategies by (inaccurate) differentiable robot simulators @ NeurIPS, 4th Robot Learning Workshop

Guiding Evolutionary Strategies by Differentiable Robot Simulators In recent years, Evolutionary Strategies were actively explored in robotic tasks fo

Control-Raspberry-Pi-Robot-using-Hand-Gestures - A 4WD Robot car based on Raspberry Pi that controlled by hand gestures(using openCV and mediapipe)
Owner
Michele Rizzo
Philosophy, Engineering, Art. 🌢 Paparu' crusch enthusiast πŸƒ Aequitas et elegantia
Michele Rizzo
ArucoFollow - A script for Robot Operating System and it is a part of a project Robot

ArucoFollow ArucoFollow is a script for Robot Operating System and it is a part

null 5 Jan 25, 2022
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
This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

null 50 Sep 26, 2022
Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Niklas Ekman 15 Dec 22, 2022
Quasi-static control of the centroid of quadruped robot

Quasi-static control of quadruped robot γ€€γ€€This is a demo of the quasi-static controller for the centroid of the quadruped robot. The Quadratic Program

Junwen Cui 21 Dec 12, 2022
Implemented robot inverse kinematics.

robot_inverse_kinematics Project setup # put the package in the workspace $ cd ~/catkin_ws/ $ catkin_make $ source devel/setup.bash Description In thi

Jianming Han 2 Dec 8, 2022
Playing diabolo with two robot arms in ROS + Gazebo

Playing diabolo with robots This repository holds the ROS packages for playing diabolo with two UR5e robot arms on ROS Melodic (Ubuntu 18.04). Read ou

null 23 Dec 18, 2022
Trajectory optimization package for Mini-Pupper robot

Trajectory optimization package for Mini-Pupper robot Purpose of this repository is to provide low-torque and low-impact trajectory for Mini-Pupper qu

Sotaro Katayama 38 Aug 17, 2022
2021 Real Robot Challenge Phase2 attemp

Real_Robot_Challenge_Phase2_AE_attemp We(team name:thriftysnipe) are the first place winner of Phase1 in 2021 Real Robot Challenge. Please see this pa

Qiang Wang 2 Nov 15, 2021
Mini Pupper - Open-Source,ROS Robot Dog Kit

Mini Pupper - Open-Source,ROS Robot Dog Kit

MangDang 747 Dec 28, 2022