Robotique Open Source
Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC Attribution-Non Commercial-Share Alike 4.0 International Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International https://creativecommons.org/licenses/by-nc-sa/4.0/deed.fr
- 1 - ROS2 - Démarrage
- Installation PC ROS2
- Tutoriels de base
- Découverte d'Ubuntu Linux et son Terminal Bash
- Usage avancé du bash Linux
- 2 - ROS2 - Robotique mobile
- Turtlesim et modèle de Dubins
- TurtleBot3 - Bases en Simulation
- TurtleBot3 - Piloter le Robot
- Calibration de la caméra
- Suivi de ligne ROS2 Humble
- Behavior Trees Demo
- 3 - ROS2 - Manipulation Mobile
- Assemblage du Turtlebot et OpenManipulator-X et configuration initiale
- Installation et démarrage du Turtlebot & OpenManipulator-X
- 4 - ROS2 - Manipulation Cobot
- Universal Robot ROS2 Driver
- Commander un robot UR avec le driver ROS2
- Programmer un robot avec MoveIt2 - Jumeau Numérique
- Roomba ROS2
- Bras Robot Arduino ROS2
1 - ROS2 - Démarrage
Installation PC ROS2
ROS est un Middleware Open Source pour développer des applications robotiques. Originellement développé sous Linux (Ubuntu), il est maintenant disponible sur plusieurs systèmes d'exploitation dont Debian et Windows.
Installation des prérequis et liens importants
Pour des raisons de stabilité et légèreté du système, il y a tout à penser que les déploiements de ROS dans des milieux industriels se font (robotique autonome et mobile) et se feront à l'avenir sur Ubuntu et de plus en plus Debian. L'industrie des serveurs a déjà largement adopté Debian pour sa stabilité et sa modularité. C'est pourquoi plutôt que d'apprendre la ligne de commande Windows, nous recommandons d'apprendre la ligne de commande Bash, utilisée dans Ubuntu/Debian. Pour cela, il faut installer un système (noyau) Linux, plusieurs options s'offrent à nous:
- Machine virtuelle
- Windows subsystem for Linux (WSL2)
- Machine virtuelle Linux, par exemple via VirtualBox
- Machine physique
- dual-boot Windows-Ubuntu
- PC sous Ubuntu 22.04
Notes importantes pour les installations virtuelles (deux premières options d'installation) :
- Ces installations sont suffisantes pour effectuer des simulations et du développement tant qu'il n'y a pas de Hardware à tester.
- L'accélération graphique n'est pas supportée par la carte graphique (GPU) mais par le processeur (CPU) (voir ce bug)
- un PC avec 32Go de RAM est recommandé si des composants imposants de ROS doivent être compilés, par exemple pour utiliser la version de développement MoveIt 2 Rolling. En effet Windows consomme à lui seul près de 4-8Go, Ubuntu >2Go et la compilation >4Go, on peut vite atteindre la saturation. 16Go peuvent suffire mais il faudra compiler sans parallélisation, et fermer des applications lourdes dans Windows comme Firefox.
Ubuntu via Windows SubSystem for Linux (WSL2)
WSL2 installe une machine virtuelle avec le noyau Linux complet, supporté et managé par Microsoft Windows. Il n'y a pas besoin de droits administrateur car le logiciel est disponible dans le store Windows.
Prérequis :
Installation de Ubuntu 22 :
- Ouvrir Windows Store
- Rechercher et installer
Ubuntu
(c'est la version LTS actuelle qui sera installée, en ce moment 22.04.X) - Depuis le menu démarrer Windows, Lancer l'application
Ubuntu
. Une Terminal s'ouvre (ligne de commande Linux Bash) - Définir l'utilisateur principal, par exemple
ros2
et un mot de passe (8 caractères mini, majuscule, minuscule, chiffre, caractère spécial). - Mettre à jour Ubuntu
sudo apt update
sudo apt upgrade
Depuis Windows, pour éteindre les Machines Virtuelles Ubuntu et ainsi libérer la mémoire RAM affectée :
- Lancer l'application
Windows PowerShell
wsl --shutdown
Autres commandes WSL depuisWindows PowerShell
:wsl --status
: devrait retournerDistribution par défaut : Ubuntu
,Version par défaut : 2
(WSL2)wsl --list
(ouwsl -l -v
) : liste les Machines Virtuelles Linux installées via WSL (et la version WSL utilisée)
Ubuntu via VirtualBox
Télécharger et installer VirtualBox pour Windows : https://www.oracle.com/virtualization/technologies/vm/downloads/virtualbox-downloads.html
- Télécharger la VM depuis seafile (\Seafile\IHA-IDF\Smart_Prod\Formation_ROS2\UbuntuROS.ova)
- Lancer VirtualBox
- Importer la VM : Outils -> Importer -> Rechercher le fichier UbuntuROS.ova
- Vérifier et adapter la configuration de la VM en ressources RAM, CPU, GPU et Réseau selon la configuration de votre PC
- Démarrer la VM
- Ignorer l'erreur sur le dossier partagé Linux-Windows
Windows 10/11
Une installation native sous Windows 10 avec Visual Studio 2019 (Version Community gratuite) est possible :
Installation de ROS2 Humble
Les distributions stables publiées (pré-compilées) de ROS2 sont nommées par ordre alphabétique. Début 2023, on va installer ROS 2 Humble :
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl
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 $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt upgrade
sudo apt install ros-humble-desktop-full
source /opt/ros/humble/setup.bash
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
Tester l'installation
https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html#try-some-examples
- Ouvrir un premier Terminal :
ros2 run demo_nodes_cpp talker
- Ouvrir un second Terminal :
ros2 run demo_nodes_cpp listener
Installation d'autres versions de ROS2
Pour avoir accès à toutes les dernières fonctionnalités en cours de développement (partiellement publiées), il faut installer ROS2 Rolling, qui est une distribution en développement continu "rolling release". Par exemple en Avril 2023, l'API Python de MoveIt2 et son tutoriel ne sont disponibles que sous rolling.
On peut installer plusieurs versions de ros en parallèle. Chaque version sera installée dans /opt/ros/version
. Pour faire cohabiter les deux versions, il faut "sourcer" le bon répertoire avant de lancer un programme ros2 launch ...
ou de compiler un workspace colcon build ...
. Deux options s'offrent à nous :
- Si on bascule souvent de version : commenter les lignes
source /opt/ros/humble/setup.bash
en bas du fichier~/.bashrc
- Il faudra alors lancer la commande
source /opt/ros/humble/setup.bash
à chaque nouvelle ouverture de Terminal Bash.
- Il faudra alors lancer la commande
- Si on travaille principalement avec une version : commenter la ligne correspondant à la version principale
source /opt/ros/humble/setup.bash
en bas du fichier~/.bashrc
lorsqu'on veut utiliser la version secondaire.
Outils utiles
Terminal multi-fenêtres Terminator
- Installer Terminator : c'est un logiciel de Ligne de commande pratique pour programmer avec ROS
- Depuis Windows Store : Rechercher et installer
Terminator (Ubuntu)
- Depuis la ligne de commande Linux :
sudo apt install terminator
- Depuis Windows Store : Rechercher et installer
- Depuis le menu démarrer Windows, Lancer
Terminator (Ubuntu)
Visual Studio Codium
Pour éviter d'alourdir la VM avec de la télémétrie Microsoft, on installe la version sans tracker de Visual Studio Code depuis un dépôt debian :
- Lancer la VM VirtualBox ou WSL (
Terminator (Ubuntu)
) - Dans Terminator, lancer les commandes suivantes :
wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg
sudo mv pub.gpg /usr/share/keyrings/vscodium-archive-keyring.asc
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| sudo tee /etc/apt/sources.list.d/vscodium.list
sudo apt update
sudo apt install codium
- Lancer VSCodium dans la VM VirtualBox ou directement depuis Windows, lancer
VSCodium (Ubuntu)
- Ouvrir le dossier contenant le code source
/src
du projet dont vous voulez étudier/modifier le code :File --> Open Folder --> ~/ws_moveit/src
Installer Firefox dans WSL
https://askubuntu.com/questions/1444962/how-do-i-install-firefox-in-wsl-when-it-requires-snap-but-snap-doesnt-work
sudo snap remove firefox
sudo apt remove firefox
sudo add-apt-repository ppa:mozillateam/ppa
# Create a new file, it should be empty as it opens:
sudo gedit /etc/apt/preferences.d/mozillateamppa
# Insert these lines, then save and exit
Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 501
# after saving, do
sudo apt update
sudo apt install firefox-esr
Sources
-----
Auteur: Gauthier Hentz, sur le wiki de l'innovation de l'IUT de Haguenau
Attribution-NonCommercial-PartageMemeConditions 4.0 International (CC BY-NC-SA 4.0)
Tutoriels de base
Pour comprendre les concepts de ROS2 par la pratique, il existe des tutoriels pour débutant. Ils reposent sur la simulation d'un robot mobile à deux roues principales développé par les développeurs de ROS en 2010 : Turtlebot. Le TurtleBot 3 est vendue par Robotis et peut être couplé à un bras manipulateur 5 axes OpenMANIPULATOR-X. Il est possible de simuler des applications de manipulation mobile avec Gazebo.
Pour réaliser les tutoriels de base, il nous faut un environnement de développement, deux options :
- Une machine virtuelle (VM) VirtualBox, ou disponible au téléchargement ici
- Le plus simple et rapide pour démarrer
- Si on n'a pas de Hardware ou qu'on ne souhaite travailler qu'en simulation
- Une installation simple ou dual-boot sur un PC
- Il faut alors installer de zéro
- Indispensable si on veut travailler avec du Hardware
Supposons que vous avez installé et testé votre environnement comme celui de la VM.
Connexion à la VM
- nom : ubuntu22ros2
- utilisateur :
etudiant
- mdp : département de l'IUT
Nous pouvons directement passer aux tutoriels sur les outils ROS 2 en ligne de commande :
Ces premiers tutoriels ne nécessitent qu'une installation basique de ROS 2, on n'y regarde pas le code source.
Ensuite on passe aux tutoriels sur les bibliothèques clientes de ROS 2 en C++ et Python :
- Using
colcon
to build packages - Creating a workspace
- Creating a package
- Writing a simple publisher and subscriber (C++) --> Correction
- Writing a simple publisher and subscriber (Python)
- Writing a simple service and client (C++)
- Writing a simple service and client (Python)
- Creating custom msg and srv files
Ces tutoriels vous engagent à copier et analyser du code source en C++ et Python. Les fichiers créés sont placés dans le dossier de travail (workspace) /home/etudiant/ros2_ws/src
, à ouvrir avec Visual Studio Code :
Vous trouverez des fichiers de correction commentés dans ros2_ws/src/cpp_pubsub/src/
, en particulier :
- publisher_member_function.cpp
- subscriber_member_function.cpp
Pour les tester il faut lancer :
cd ~/ros2_ws
colcon build --packages-select cpp_pubsub
source install/setup.bash
ros2 run cpp_pubsub talker
Le noeud se met à publier/parler :
[INFO] [minimal_publisher]: Publishing: "Hello World: 0" [INFO] [minimal_publisher]: Publishing: "Hello World: 1" [INFO] [minimal_publisher]: Publishing: "Hello World: 2" [INFO] [minimal_publisher]: Publishing: "Hello World: 3" [INFO] [minimal_publisher]: Publishing: "Hello World: 4"
Puis dans un second Terminal :
ros2 run cpp_pubsub listener
Le noeud se met à écouter :
[INFO] [minimal_subscriber]: I heard: "Hello World: 10" [INFO] [minimal_subscriber]: I heard: "Hello World: 11" [INFO] [minimal_subscriber]: I heard: "Hello World: 12" [INFO] [minimal_subscriber]: I heard: "Hello World: 13" [INFO] [minimal_subscriber]: I heard: "Hello World: 14"
Tapez Ctrl+C
dans chaque Terminal pour arrêter les noeuds ("stop spinning").
-----
Auteur: Gauthier Hentz, sur le wiki de l'innovation de l'IUT de Haguenau
Attribution-NonCommercial-PartageMemeConditions 4.0 International (CC BY-NC-SA 4.0)
Découverte d'Ubuntu Linux et son Terminal Bash
Navigating the Ubuntu GUI
In this exercise, we will familiarize ourselves with the graphical user interface (GUI) of the Ubuntu operating system.
Task 1: Familiarize Yourself with the Ubuntu Desktop
At the log-in screen, click in the password input box, enter rosindustrial
for the password, and hit enter. The screen should look like the image below when you log in:
There are several things you will notice on the desktop:
-
The gear icon on the top right of the screen brings up a menu which allows the user to log out, shut down the computer, access system settings, etc…
-
The bar on the left side shows running and “favorite” applications, connected thumb drives, etc.
-
The top icon is used to access all applications and files. We will look at this in more detail later.
-
The next icons are either applications which are currently running or have been “pinned” (again, more on pinning later)
-
Any removable drives, like thumb drives, are found after the application icons.
-
If the launcher bar gets “too full”, clicking and dragging up/down allows you to see the applications that are hidden.
-
To reorganize the icons on the launcher, click and hold the icon until it “pops out”, then move it to the desired location.
Task 2: Open and Inspect an Application
Click on the filing-cabinet icon in the launcher. A window should show up, and your desktop should look like something below:
Things to notice:
-
The close, minimize, and maximize buttons typically found on the right-hand side of the window title bar are found on the left-hand side.
-
The menu for windows are found on the menu bar at the top of the screen, much in the same way Macs do. The menus, however, only show up when you hover the mouse over the menu bar.
-
Notice that there are menu highlights of the folder icon. The dots on the left show how many windows of this application are open. Clicking on these icons when the applications are open does one of two things:
-
If there is only one window open, this window gets focus.
-
If more than one are open, clicking a second time causes all of the windows to show up in the foreground, so that you can choose which window to go to (see below):
Task 3: Start an Application & Pin it to the Launcher Bar
Click on the launcher button (top left) and type gedit in the search box. The “Text Editor” application (this is actually gedit) should show up (see below):
Click on the application. The text editor window should show up on the screen, and the text editor icon should show up on the launcher bar on the left-hand side (see below):
-
Right-click on the text editor launch icon, and select “Lock to Launcher”.
-
Close the gedit window. The launcher icon should remain after the window closes.
-
Click on the gedit launcher icon. You should see a new gedit window appear.
Le Terminal Linux
In this exercise, we will familiarize ourselves with the Linux terminal.
Starting the Terminal
-
Pour ouvrir le Terminal, recherchez le programme "terminator" ou cliquez sur l'icône:
-
Create a second terminal window, either by:
-
Right-clicking on the terminal and selecting the “Open Terminal” or
-
Selecting “Open Terminal” from the “File” menu
-
-
Create a second terminal within the same window by pressing “Ctrl+Shift+T” while the terminal window is selected.
-
Close the 2nd terminal tab, either by:
-
clicking the small ‘x’ in the terminal tab (not the main terminal window)
-
typing
exit
and hitting enter.
-
-
The window will have a single line, which looks like this:
ros-industrial@ros-i-humble-vm:~$
-
This is called the prompt, where you enter commands. The prompt, by default, provides three pieces of information:
-
ros-industrial is the login name of the user you are running as.
-
ros-i-humble-vm is the host name of the computer.
-
~ is the directory in which the terminal is currently in. (More on this later).
-
-
Close the terminal window by typing
exit
or clicking on the red ‘x’ in the window’s titlebar.
Navigating Directories and Listing Files
Prepare your environment
-
Open your home folder in the file browser.
-
Double-click on the
ex0.3
folder we created in the previous step.-
We’ll use this to illustrate various file operations in the terminal.
-
-
Right click in the main file-browser window and select “Open in Terminal” to create a terminal window at that location.
-
In the terminal window, type the following command to create some sample files that we can study later:
-
cp -a ~/industrial_training/exercises/0.3/. .
-
ls Command
-
Enter
ls
into the terminal.-
You should see
test.txt
, andnew
listed. (If you don’t see ‘new’, go back and complete the previous exercise). -
Directories, like
new
, are colored in blue. -
The file
sample_job
is in green; this indicates it has its “execute” bit set, which means it can be executed as a command.
-
-
Type
ls *.txt
. Only the filetest.txt
will be displayed. -
Enter
ls -l
into the terminal.-
Adding the
-l
option shows one entry per line, with additional information about each entry in the directory. -
The first 10 characters indicate the file type and permissions
-
The first character is
d
if the entry is a directory. -
The next 9 characters are the permissions bits for the file
-
The third and fourth fields are the owning user and group, respectively.
-
The second-to-last field is the time the file was last modified.
-
If the file is a symbolic link, the link’s target file is listed after the link’s file name.
-
-
Enter
ls -a
in the terminal.-
You will now see one additional file, which is hidden.
-
-
Enter
ls -a -l
(orls -al
) in the command.-
You’ll now see that the file
hidden_link.txt
points to.hidden_text_file.txt
.
-
pwd
and cd
Commands
-
Enter
pwd
into the terminal.-
This will show you the full path of the directory you are working in.
-
-
Enter
cd new
into the terminal.-
The prompt should change to
ros-industrial@ros-i-humble-vm:~/ex0.3/new$
. -
Typing
pwd
will show you now in the directory/home/ros-industrial/ex0.3/new
.
-
-
Enter
cd ..
into the terminal. * In the previous exercise, we noted that..
is the parent folder. * The prompt should therefore indicate that the current working directory is/home/ros-industrial/ex0.3
. -
Enter
cd /bin
, followed byls
.-
This folder contains a list of the most basic Linux commands.
Note thatpwd
andls
are both in this folder.
-
-
Enter
cd ~/ex0.3
to return to our working directory.-
Linux uses the
~
character as a shorthand representation for your home directory. -
It’s a convenient way to reference files and paths in command-line commands.
-
You’ll be typing it a lot in this class… remember it!
-
If you want a full list of options available for any of the commands given in this section, type man <command>
(where <command>
is the command you want information on) in the command line. This will provide you with built-in documentation for the command. Use the arrow and page up/down keys to scroll, and q
to exit.
Altering Files
mv Command
-
Type
mv test.txt test2.txt
, followed byls
.-
You will notice that the file has been renamed to
test2.txt
.
This step shows howmv
can rename files.
-
-
Type
mv test2.txt new
, thenls
.-
The file will no longer be present in the folder.
-
-
Type
cd new
, thenls
.-
You will see
test2.txt
in the folder.
These steps show howmv
can move files.
-
-
Type
mv test2.txt ../test.txt
, thenls
.-
test2.txt
will no longer be there.
-
-
Type
cd ..
, thenls
.-
You will notice that
test.txt
is present again.
This shows howmv
can move and rename files in one step.
-
cp Command
-
Type
cp test.txt new/test2.txt
, thenls new
.-
You will see
test2.txt
is now in thenew
folder.
-
-
Type
cp test.txt "test copy.txt"
, thenls -l
.-
You will see that
test.txt
has been copied totest copy.txt
.
Note that the quotation marks are necessary when spaces or other special characters are included in the file name.
-
rm Command
-
Type
rm "test copy.txt"
, thenls -l
.-
You will notice that
test copy.txt
is no longer there.
-
mkdir Command
-
Type
mkdir new2
, thenls
.-
You will see there is a new folder
new2
.
-
touch Command
-
Type
touch ~/Templates/"Untitled Document"
.-
This will create a new Document named “Untitled Document”
-
You can use the -i
flag with cp
, mv
, and rm
commands to prompt you when a file will be overwritten or removed.
Editing Text (and Other GUI Commands)
-
Type
gedit test.txt
.-
You will notice that a new text editor window will open, and
test.txt
will be loaded. -
The terminal will not come back with a prompt until the window is closed.
-
-
There are two ways around this limitation. Try both…
-
Starting the program and immediately returning a prompt:
-
Type
gedit test.txt &
.-
The
&
character tells the terminal to run this command in “the background”, meaning the prompt will return immediately.
-
-
Close the window, then type
ls
.-
In addition to showing the files, the terminal will notify you that
gedit
has finished.
-
-
-
Moving an already running program into the background:
-
Type
gedit test.txt
.-
The window should open, and the terminal should not have a prompt waiting.
-
-
In the terminal window, press Ctrl+Z.
-
The terminal will indicate that
gedit
has stopped, and a prompt will appear.
-
-
Try to use the
gedit
window.-
Because it is paused, the window will not run.
-
-
Type
bg
in the terminal.-
The
gedit
window can now run.
-
-
Close the
gedit
window, and typels
in the terminal window.-
As before, the terminal window will indicate that
gedit
is finished.
-
-
Running Commands as Root
-
In a terminal, type
ls -a /root
.-
The terminal will indicate that you cannot read the folder
/root
. -
Many times you will need to run a command that cannot be done as an ordinary user, and must be done as the “super user”
-
-
To run the previous command as root, add
sudo
to the beginning of the command.-
In this instance, type
sudo ls -a /root
instead. -
The terminal will request your password (in this case,
rosindustrial
) in order to proceed. -
Once you enter the password, you should see the contents of the
/root
directory.
-
Warning: sudo
is a powerful tool which doesn’t provide any sanity checks on what you ask it to do, so be VERY careful in using it
https://industrial-training-master.readthedocs.io/en/humble/_source/prerequisites/Navigating-the-Ubuntu-GUI.html
Usage avancé du bash Linux
Job management
Stopping Jobs
-
Type
./sample_job
.-
The program will start running.
-
-
Press Control+C.
-
The program should exit.
-
-
Type
./sample_job sigterm
.-
The program will start running.
-
-
Press Control+C.
-
This time the program will not die.
-
Stopping “Out of Control” Jobs
-
Open a new terminal window.
-
Type
ps ax
. -
Scroll up until you find
python ./sample_job sigterm
.-
This is the job that is running in the first window.
-
The first field in the table is the ID of the process (use
man ps
to learn more about the other fields).
-
-
Type
ps ax | grep sample
.-
You will notice that only a few lines are returned.
-
This is useful if you want to find a particular process
-
Note: this is an advanced technique called “piping”, where the output of one program is passed into the input of the next. This is beyond the scope of this class, but is useful to learn if you intend to use the terminal extensively.
-
-
Type
kill <id>
, where<id>
is the job number you found with theps ax
. -
In the first window, type
./sample_job sigterm sigkill
.-
The program will start running.
-
-
In the second window, type
ps ax | grep sample
to get the id of the process. -
Type
kill <id>
.-
This time, the process will not die.
-
-
Type
kill -SIGKILL <id>
.-
This time the process will exit.
-
Showing Process and Memory usage
-
In a terminal, type
top
.-
A table will be shown, updated once per second, showing all of the processes on the system, as well as the overall CPU and memory usage.
-
-
Press the Shift+P key.
-
This will sort processes by CPU utilization.
This can be used to determine which processes are using too much CPU time.
-
-
Press the Shift+M key.
-
This will sort processes by memory utilization
This can be used to determine which processes are using too much memory.
-
-
Press q or Ctrl+C to exit the program.
2 - ROS2 - Robotique mobile
Turtlesim et modèle de Dubins
https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.html
TurtleBot3 - Bases en Simulation
Astuces
Gazebo
- Réinitialiser la pose du robot
ctrl+Shift+R
- Edit --> Reset Model Poses
Le robot ne spawn pas
On a remarqué que parfois certains processus de gazebo continuent à tourner ou sont redémarrés malgré l'arrêt du noeud ROS principal. Il faut alors tuer le processus avecla commande kill 1234
, voir commandes utiles ci-dessous.
Commandes utiles
- Lister les processus système (programmes) qui tournent actuellement
ps -ef
- Lister les processus système (programmes) qui tournent actuellement sous forme d'arbre hiérarchisé : un processus enfant est rattaché à une branche d'un processus parent dont il dépend
ps -ef --forest
- Parmi ces processus, sélectionner ceux qui contiennent le mot-clé
gazebo
ps -ef --forest | grep ros
- Repérer l'ID du processus
- Envoyer le signal d'arrêt du processus
SIGTERM
"mode gentil" : on demande au programme de s'arrêterkill 1234
- Si le processus continue tout de même à tourner, envoyer le signal de destruction du processus
SIGKILL
"mode méchant" :kill -9 1234
Ressources
- https://www.classes.cs.uchicago.edu/archive/2022/fall/20600-1/warmup_project.html
- https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#gazebo-simulation
TurtleBot3 - Piloter le Robot
https://emanual.robotis.com/docs/en/platform/turtlebot3/navigation/#navigation
Les 2 ordinateurs dans le FabLab sur le mur de gauche sont installés sous Ubuntu 22.04 avec ROS2 Humble et les paquets nécessaires au pilotage des TurtleBot3. Il faut utiliser le compte étudiant (et non le compte fablab qui se login automatiquement au démarrage) avec le même mdp que celui utilisé en TP.
Vous pouvez emprunter un des 2 TurtleBot quand vous voulez en demandant à M. Carron ou M. Hentz dans le bureau en face :
- TurtleBot3 Burger
- TurtleBot3 Waffle + OpenManipulator X
Pensez bien à les recharger pour les suivants.
Un réseau Wifi fab-lab-5g est disponible et les TurtleBot configurés pour s'y connecter. Attention ce réseau est limité à 20Go de données, donc ne pas l'utiliser pour autre-chose que la robotique. Les PC doivent être connectés sur le même réseau que les TurtleBot. Vous devez ensuite vous connecter au Robot via ssh pour démarrer le noeud ROS2 côté robot :
ssh ubuntu@192.168.3.10
(burger) ou ssh ubuntu@192.168.3.11
(waffle) avec le même mdp qu'en TP.
Les autres noeuds sont lancés sur le PC : télémanipulation, cartographie, navigation autonome, planification de trajectoire avec évitement d'obstacle etc.
Calibration de la caméra
- Générer un damier de calibration : 8 x 10 carrés de 20m
- avec https://calib.io/pages/camera-calibration-pattern-generator
- Ce sont les sommets intérieurs des carrés qui sont utilisés, donc 7x9 sommets
Ressources
- Noeud ROS2 pour Raspberry Cam https://github.com/christianrauch/camera_ros
- https://index.ros.org/p/camera_ros/
- https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304
Suivi de ligne ROS2 Humble
Le suivi de ligne repose surtout sur du traitement de l'image avec OpenCV, et l'envoi de commandes de vitesse au robot. Le code sous ROS1 devrait donc être portable assez directement sous ROS2.
Environnement de simulation Gazebo
Modélisation
Créer un paquet
- Créer un paquet ROS2 python « autonomy » qui implémente follower_p.py
- Adapter le CMakeLists.txt et package.xml en vous inspirant de :
- turtlebot3_behavior_demos (/tb3_autonomy/scripts/test_vision.py)
- turtlebot3/turtlebot3_example/turtlebot3_example/turtlebot3_position_control/turtlebot3_position_control.py
- Lancer ros2 launch turtlebot3_gazebo turtlebot3_circuit_competition.launch.py
- Démarrer la simulation en plaçant le robot au début de la piste
- Caméra en vue de la ligne
- Lancer votre nœud python avec ros2 run autonomy follower_p.py
Ressources
Pour le suivi d'une ligne blanche :
- https://github.com/gabrielnhn/ros2-line-follower/blob/main/follower/follower/follower_node.py
sudo apt install python3-cv-bridge python3-opencv
- ajouter au
~/.bashrc
:export GAZEBO_MODEL_PATH=~/turtlebot3_ws/src/ros2-line-follower/follower/models
- Le TP2 de robotique de Loïc Cuvillon donné à Telecom Physique Strasbourg
- ROS1 / OpenCV : https://github.com/osrf/rosbook/blob/master/followbot/follower_line_finder.py
Behavior Trees Demo
Concepts
Démo avec le Turtlebot3
https://github.com/sea-bass/turtlebot3_behavior_demos
Usage sans docker
- Vérifier que Gazebo fonctionne en lançant le noeud de base :
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
- Éteindre le noeud
On lance l'environnement de simulation lié à la démo de Behavior Tree :
ros2 launch tb3_worlds tb3_demo_world.launch.py
Le robot navigue en des positions connues avec pour but de trouver un cube d'une couleur spécifiée (rouge, vert ou bleu). La détection d'objets est faite par un simple seuillage en couleurs HSV avec des valeurs calibrées.
Démos de Behavior Trees en Python
On regarde le fichier turtlebot3_behavior_demos/docker-compose.yaml
pour déterminer les commandes Bash correspondant aux commande docker indiquées dans le dépôt.
Dans un second terminal, on lance une des démos suivantes :
Les fichiers source de la démo sont :
- tb3_demo_behavior_py.launch.py
- autonomy_node.py
- navigation.py
- test_move_base.py
- vision.py
- test_vision.py
- navigation.py
3 - ROS2 - Manipulation Mobile
Assemblage du Turtlebot et OpenManipulator-X et configuration initiale
https://www.classes.cs.uchicago.edu/archive/2022/fall/20600-1/turtlebot_assembly_setup.html
A Word of Caution
This page is NOT intended for student use. This page is designed for course staff to build and maintaing the turtlebots. If you are a student, please ensure you have permission from course staff before making any of the changes detailed on this page to any of the turtlebots.
Setup Checklist
- Turtlebot Assembly Tips
- OpenMANIPULATOR Arm First-Time Configuration
- Connecting the Pi to a Wi-Fi Network
- Attaching/Detaching the OpenMANIPULATOR Arm
Turtlebot Assembly Tips
Turtlebot3
- DO NOT TIGHTEN the screws too much.
- Page 10: When connecting one pair of waffle-plates to another, make that the seams connecting each waffle-plate are parallel to one other.
- Page 17: When attaching the wheels to the dynamixels, do not tighten the screws too much.
- Page 28: Mount the LiDAR further up than the manual specifies so that the arm can fit on (see completed Turtlebots for reference).
OpenMANIPULATOR Arm
- OpenMANIPULATOR Dynamixel 12: when putting the back piece onto the servo, you will need to break off a plastic piece where the cable should be threaded through.
- Make sure the placement of the marking on the servo horns is identical to the diagram PRIOR to screwing anything down onto it.
OpenMANIPULATOR Arm First-Time Configuration
After assembling an OpenMANIPULATOR arm, its servos must first be configured properly before it can be used. By default, all the arm motors are set to the same ID (1) and the wrong baud rate, which causes collisions when trying to detect them.
- Setup OpenCR with Arduino IDE using OpenCR 1.0 manual, “Arduino IDE” section
- Download Dynamixel Wizard 2.0 if not already installed.
- Connect a SINGLE motor (no daisy-chains in the arm) to the OpenCR module and DISCONNECT ALL OTHER MOTORS (the wheel motors!!)
- Open up Dynamixel Wizard 2.0 and update the firmware for that motor by following this tutorial. The arm Dynamixel model is XM430-W350, and the wheel motors are XM430-W210.
- Scan for connected Dynamixels using the “Scan” button on the top menu. If the scan does not turn up any results, you may need to change the scan options in the "Options" menu. By default, an unconfigured arm motor will have ID 1, be on Protocol 2.0, and have a baud rate of 57600 bps.
- Change the ID for the detected motor from 1 to 11/12/13/14/15 (whichever you're doing the procedure for). Click on the “ID” item, and find the ID # you want in the lower right corner. Click it and press “Save”.
- Change the baud rate to 1M (if not already 1M). Click on the “Baud Rate (Bus)” item, and find the 1 Mbps option. Click it and press “Save”.
- Disconnect the motor (both in the wizard by clicking “Disconnect” up top and physically disconnecting from the board) and repeat the steps for the remaining ones.
Attaching/Detaching the OpenMANIPULATOR Arm
Physical Attachment/Detachment
Follow these steps below:
- The arm can be attached and detached by first removing the top layer of the the Turtlebot. There are 10 screws around the perimeter of the top layer that you will need to remove with a Phillips head / cross screwdriver.
- Once the top layer of the Turtlebot is loose, disconnect the cable that is attached to the LiDAR. This cable is multi-colored with several pins.
Note: ONLY remove this LiDAR cable in this step.
- To connect the arm, there are four screws that you will need to insert through the bottom side of the top layer that connect to Dynamixel #11. The exact location of the screws are marked in the picture below. Use an hex/allen key to secure them.
- Once the arm is securely attached, thread the cable connected to DynaMIXEL #11 through the top layer (if not already threaded) and attach the other end to the remaining 3-pin slot on the OpenCR board. It should be the open slot adjacent to the already occupied slots.
- Reconnect the LiDAR cable and re-screw the top layer onto the robot.
To disconnect the arm, follow the same steps as above, but remove the four screws instead and disconnect the DynaMIXEL.
Updating Firmware and Files
Every time the arm is attached or detached, you will need to reconfigure environment variables and update the OpenCR firmware.
If you are attaching the arm, set the environment variable OPENCR_MODEL=om_with_tb3
and ensure that OPENCR_PORT=/dev/ttyACM0
in the ~/.bashrc
file.
$ export OPENCR_PORT=/dev/ttyACM0
$ export OPENCR_MODEL=om_with_tb3
Source the file and update the firmware with:
$ source ~/.bashrc
$ cd ~/opencr_update && ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr
If you are detaching the arm, set the environment variable OPENCR_MODEL=waffle
and ensure that OPENCR_PORT=/dev/ttyACM0
in the ~/.bashrc
file.
Enter the OpenCR board into firmware recovery mode by pressing and holding SW2, and simultaneously pressing RESET (you will need to remove the top layer of the turtlebot in order to access those OpenCR buttons). If you want to read more about the OpenCR bootloader, please refer to this page in the OpenCR 1.0 manual.

Source the file and update the firmware with:
$ source ~/.bashrc
$ cd ~/opencr_update && ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr
Common Errors During Setup
Firmware Recovery Mode and Device Firmware Update for OpenCR Board
We found the firmware recovery mode not clearly detailed in the Turtlebot3 manual. Here are the steps for firmware recovery:
- Push and hold SW2
- Press RESET
- Release SW2
- Arduino code should upload successfully with
jump_with_fw
Firmware recovery is different from device firmware update (DFU), where the steps are:
- Push and hold BOOT
- Press RESET
- Release BOOT
Troubleshooting /dev/ttyACM0
Connection Issues
If the /dev/ttyACM0
port isn't found or running bringup
on the Pi is hanging:
- Make sure
$OPENCR_MODEL
is correct (waffle
for no arm,om_with_tb3
for arm) - Disconnect and reconnect the USB cable connecting the Pi and OpenCR board
- Enter firmware recovery (SW2 + RESET)
- Reinstall the firmware with ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr (see more detailed steps above in the prior section on attaching/detaching the arm)
- [If the above doesn’t work] Restart
roscore
- [If the above doesn’t work] Reupload the sketch using the Arduino IDE (install instructions) in
Examples > OpenCR > Etc > usb_to_dxl
to the OpenCR board (which you'll need to directly connect to your computer)
If the hydro rosserial / groovy Arduino error appears:
- Configure the arm motors as described in the previous section on attaching/detaching the arm
- Enter firmware recovery (SW2 + RESET)
- Reinstall the firmware with ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr
- Set up the wheel motors by uploading the sketch using the Arduino IDE (install instructions) in
Examples > TurtleBot3 > turtlebot3_setup > turtlebot3_setup_motor
to the OpenCR board (which you'll need to directly connect to your computer)
Installation et démarrage du Turtlebot & OpenManipulator-X
Installation Ubuntu Server
Version rapide
- Télécharger l'image compressée de la carte SD préinstallée
https://seafile.unistra.fr/smart-link/dcc9e405-88a0-41d2-ab5c-3e796a6cebf3/ - Insérer la carte SD et démonter les partitions existantes
sudo umount /media/user/writable /media/user/system-boot
Attention, bien vérifier le disque associé à la carte SD avant de lancer la commande dd. Sinon on risque d'écraser le disque dur. En général disque dur = /dev/sda et carte SD = /dev/sdb
- Flasher la carte SD avec l'utilitaire
dd
sudo gunzip -c ~/turtlebot3-manipulator-humble.img.gz | sudo dd of=/dev/sdb status=progress
-
Configurer la connexion automatique au réseau wifi et donner une IP fixe au robot (dans la plage DHCP autorisée par le routeur) :
- Éjecter et réinsérer la carte SD pour qu'elle se monte
- Modifier la
CONFIGURATION_RESEAU
(les éléments en majuscule) dans le fichier suivant :sudo nano /media/user/writable/etc/netplan/99-hotspot-fablab.yaml
addresses: [IP_TURTLEBOT/24]
gateway4: IP_BOX
nameservers:
addresses: [DNS_BOX_OPERATEUR, 9.9.9.9, 89.234.141.66]
access-points:
"SSID_WIFI":
password: PASSWORD_WIFI
Remarque : l'image a été créée après avoir suivi les instructions longues ci-dessous (et quelques workspace et package ros installés en plus) en lançant la commande suivante :
sudo dd if=/dev/sda status=progress | gzip -9 > ~/turtlebot3-manipulator-humble.img.gz
Reinitialiser le mot-de-passe
Voir la section 4 ici
- Connecter la carte SD sur un PC
- naviguer au point de montage, par exemple :
cd /media/user/writable
- ouvrir le fichier
sudo nano /etc/passwd
- modifier la ligne qui concerne votre user du système Ubuntu du turtlebot, par exemple ici
ubuntu
Avant :ubuntu:x:1000:1000:Ubuntu:/home/ubuntu:/bin/bash
Après (on supprime lex
) :ubuntu::1000:1000:Ubuntu:/home/ubuntu:/bin/bash
- Redémarrer le système dans le TurtleBot
- Se connecter avec le login
ubuntu
- Aucun MDP n'est demandé
- Lancer le programme de changement de MDP
sudo passwd
- Rentrer le nouveau MDP 2 fois
Version longue
https://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/#sbc-setup
Depuis un ordinateur sous Ubuntu 22.04
- Insérer la carte SD dans le navigateur
- Installer rpi-manager
sudo apt install rpi-imager
- Sélectionner
CHOOSE OS
- autre système Linux (Other general-purpose OS)
- Ubuntu Server 22.04 LTS (64bits)
- Sélectionner
CHOOSE STORAGE
la carte micro SD - Cliquer sur
WRITE
Depuis une VM WSL Ubuntu 22
Configurer la connexion automatique au réseau wifi et donner une IP fixe au robot (dans la plage DHCP autorisée par le routeur) :
- Éjecter et réinsérer la carte SD pour qu'elle se monte
- Créer le fichier suivant :
sudo nano /media/user/writable/etc/netplan/99-hotspot-fablab.yaml
network:
renderer: networkd
ethernets:
eth0:
dhcp4: true
dhcp6: true
optional: true
wifis:
wlan0:
dhcp4: false
dhcp6: false
addresses: [192.168.100.40/24]
gateway4: 192.168.100.1
nameservers:
addresses: [192.168.100.1, 9.9.9.9, 89.234.141.66]
access-points:
fablab:
password: ...
version: 2
- Désactiver la configuration du réseau par cloud-init en créant le fichier suivant :
sudo nano /media/user/writable/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
network: {config: disabled}
Insérer la carte dans le robot, le démarrer assez proche du hotspot wifi configuré, se connecter en ssh depuis l'ordinateur :
- Utiliser l'adresse IP précédemment configurée
ssh ubuntu@192.168.100.40
- mdp :
ubuntu
- changer le mdp par un suffisamment sécurisé
- se connecter en ssh avec le nouveau mdp
- pour lancer des commandes en root utiliser
sudo
avec le même mdp - Ne pas attendre la connexion réseau pour démarrer :
systemctl mask systemd-networkd-wait-online.service
- Désactiver la veille et l'hibernation :
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Installer ROS 2 Humble sans interfaces graphiques (ros-humble-desktop) qui seront lancées sur l'ordinateur externe :
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl
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 $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt upgrade
sudo apt install ros-humble-ros-base ros-dev-tools
source /opt/ros/humble/setup.bash
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
Installer le workspace du turtlebot et les dépendances :
sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential
sudo apt install ros-humble-hls-lfcd-lds-driver
sudo apt install ros-humble-turtlebot3-msgs
sudo apt install ros-humble-dynamixel-sdk
sudo apt install libudev-dev
mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src
git clone -b humble-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone -b ros2-devel https://github.com/ROBOTIS-GIT/ld08_driver.git
cd ~/turtlebot3_ws/src/turtlebot3
rm -r turtlebot3_cartographer turtlebot3_navigation2
cd ~/turtlebot3_ws/
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
source ~/.bashrc
colcon build --symlink-install --parallel-workers 1
echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc
source ~/.bashrc
Configurer le Port USB pour OpenCR :
sudo cp `ros2 pkg prefix turtlebot3_bringup`/share/turtlebot3_bringup/script/99-turtlebot3-cdc.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
ID de domain ROS pour la communication DDS :
echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
source ~/.bashrc
Configurer le modèle du LIDAR :
echo 'export LDS_MODEL=LDS-02' >> ~/.bashrc
source ~/.bashrc
Raspberry Pi 5 - Ubuntu Noble 24.04 - ROS2 Jazzy
ROS2 Jazzy est la nouvelle version LTS. Elle est installable sur Raspberry Pi 5.
Pour installer ROS2 Humble sur Ubuntu 24.04 il faut compiler depuis les sources :
sudo apt install -y git colcon python3-rosdep2 vcstool wget python3-flake8-docstrings python3-pip python3-pytest-cov python3-flake8-blind-except python3-flake8-builtins python3-flake8-class-newline python3-flake8-comprehensions python3-flake8-deprecated python3-flake8-import-order python3-flake8-quotes python3-pytest-repeat python3-pytest-rerunfailures python3-vcstools libx11-dev libxrandr-dev libasio-dev libtinyxml2-dev
mkdir -p ~/ros2_iron/src
cd ~/ros2_iron
vcs import --input https://raw.githubusercontent.com/ros2/ros2/iron/ros2.repos src
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
sudo apt upgrade
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro iron -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers python3-vcstool"
colcon build --symlink-install
cf. https://forums.raspberrypi.com/viewtopic.php?t=361746
Montage et Configuration des Dynamixels
https://www.classes.cs.uchicago.edu/archive/2022/fall/20600-1/turtlebot_assembly_setup.html
- Installer Arduino IDE :
sudo apt install arduino
- https://emanual.robotis.com/docs/en/parts/controller/opencr10/#install-on-linux
- Connecter OpenCR https://emanual.robotis.com/docs/en/platform/turtlebot3/manipulation/#arduino-ide
- Installer Dynamixel Wizard https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/
- Lancer Dynamixel Wizard
cd ~/ROBOTIS/DynamixelWizard2 bash DynamixelWizard2.sh
- Si une erreur de dépendance apparait, désinstaller/réinstaller/upgrader dynamixelWizard via l'executable
~/ROBOTIS/DynamixelWizard2/maintenancetool
https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/#uninstall-linux
Pour l'Open-Manipulator
Configurer les dynamixel (baud et ID 11 à 15) https://www.classes.cs.uchicago.edu/archive/2022/fall/20600-1/turtlebot_assembly_setup.html#arm-first-time :
- Connect a SINGLE motor (no daisy-chains in the arm) to the OpenCR module and DISCONNECT ALL OTHER MOTORS (the wheel motors!!)
- Open up Dynamixel Wizard 2.0 and update the firmware for that motor by following this tutorial. The arm Dynamixel model is XM430-W350, and the wheel motors are XM430-W210.
- Scan for connected Dynamixels using the “Scan” button on the top menu. If the scan does not turn up any results, you may need to change the scan options in the "Options" menu. By default, an unconfigured arm motor will have ID 1, be on Protocol 2.0, and have a baud rate of 57600 bps.
- Change the ID for the detected motor from 1 to 11/12/13/14/15 (whichever you're doing the procedure for). Click on the “ID” item, and find the ID # you want in the lower right corner. Click it and press “Save”.
- Change the baud rate to 1M (if not already 1M). Click on the “Baud Rate (Bus)” item, and find the 1 Mbps option. Click it and press “Save”.
- Disconnect the motor (both in the wizard by clicking “Disconnect” up top and physically disconnecting from the board) and repeat the steps for the remaining ones
Pour le Turtlebot
Via Arduino IDE ou DynamixelWizard en s'inspirant de : https://emanual.robotis.com/docs/en/platform/turtlebot3/faq/#setup-dynamixels-for-turtlebot3
- Moteur gauche : ID=1
- Moteur droit : ID=2
- Baud rate : 1M
Test depuis un PC sans la raspberry
Téléopération du OpenManipulator-X seul
Suivre le tutoriel Foxy en remplaçant foxy
par humble
et foxy-devel
par ros2
en utilisant l'interface de communication OpenCR : https://emanual.robotis.com/docs/en/platform/openmanipulator_x/quick_start_guide/
Pour tester le bon fonctionnement du bras et de sa pince, on connecte la carte OpenCR directement à un PC ayant ROS Humble préinstallé :
- Installer et compiler le workspace
sudo apt install ros-humble-rqt* ros-humble-joint-state-publisher
mkdir -p ~/openmanipulator_ws/src/
cd ~/openmanipulator_ws/src/
git clone -b ros2 https://github.com/ROBOTIS-GIT/DynamixelSDK.git
git clone -b ros2 https://github.com/ROBOTIS-GIT/dynamixel-workbench.git
git clone -b ros2 https://github.com/ROBOTIS-GIT/open_manipulator.git
git clone -b ros2 https://github.com/ROBOTIS-GIT/open_manipulator_msgs.git
git clone -b ros2 https://github.com/ROBOTIS-GIT/open_manipulator_dependencies.git
git clone -b ros2 https://github.com/ROBOTIS-GIT/robotis_manipulator.git
cd ~/openmanipulator_ws && colcon build --symlink-install
- Corriger le bug de compilation et re-compiler. Dans
src/open_manipulator/open_manipulator_x_controller/src/open_manipulator_x_controller.cpp
, lignes 67-68, remplacer :
par :this->declare_parameter("sim");
this->declare_parameter("control_period");
this->declare_parameter("sim", false);
this->declare_parameter("control_period", 0.010);
- Lancer
arduino
- Uploader l'exemple
File > Examples > OpenCR > 10.Etc > usb_to_dxl
vers OpenCR
- Si cela réussit, jump_to_fw apparaît, sinon essayer d'uploader une seconde fois
- Lancer le contrôleur du robot. Attention les moteurs vont bouger et se bloquer dans la position initiale
ros2 launch open_manipulator_x_controller open_manipulator_x_controller.launch.py usb_port:=/dev/ttyACM0
- Dans un second terminal, lancer le noeud de téléopération :
ros2 run open_manipulator_x_teleop teleop_keyboard
- Piloter le robot dans l'espace Cartésien ou articulaire avec les touches indiquées
Programmation hors-ligne du OpenManipulator-X et TurtleBot3 depuis MoveIt
On suit le tutoriel https://emanual.robotis.com/docs/en/platform/turtlebot3/manipulation/#operate-the-actual-openmanipulator en installant tout ce qui est censé être installé sur le raspberry [SBC]/[TurtleBot3] sur le PC [Remote PC].
- Installer le workspace et compiler :
sudo apt install ros-humble-dynamixel-sdk ros-humble-ros2-control ros-humble-ros2-controllers ros-humble-gripper-controllers ros-humble-moveit
cd ~/turtlebot3_ws/src/
git clone -b humble-devel https://github.com/ROBOTIS-GIT/turtlebot3_manipulation.git
cd ~/turtlebot3_ws && colcon build --symlink-install
- Ajouter au
~/.bashrc
:
export ROS_DOMAIN_ID=30 #TURTLEBOT3
export LDS_MODEL=LDS-02
export TURTLEBOT3_MODEL=waffle_pi
export OPENCR_PORT=/dev/ttyACM0
export OPENCR_MODEL=turtlebot3_manipulation
- AVANT TOUT FLASHAGE DE OPENCR, se mettre en mode debug en
- Rester appuyé sur le bouton SW2
- Appuyer quelques secondes sur RESET
- Relacher RESET
- Relacher SW2
- ATTENTION SI LE MODE DEBUG n'est pas activé, il se peut
jump_fw
soit affiché mais que le flashage ait échoué. - Configurer OpenCR pour turtlebot3_manipulation depuis Arduino
File > Examples > Turtlebot3 ROS2 > turtlebot3_manipulation
ou avec le prebuild :
rm -rf ./opencr_update.tar.bz2
wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS2/latest/opencr_update.tar.bz2
tar -xvf opencr_update.tar.bz2
cd ./opencr_update
./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr
- Démarrer ROS Control :
ros2 launch turtlebot3_manipulation_bringup hardware.launch.py
- Le setup a fonctionné si le robot apparaît dans la bonne configuration dans RViz !
- Dans un second terminal démarrer au choix :
- MoveIt pour la programmation hors-ligne et planification de trajectoire :
ros2 launch turtlebot3_manipulation_moveit_config moveit_core.launch.py
- Piloter le robot en bougeant les flèches dans RViz et en cliquant sur "Plan and Execute"
- MoveIt servo
ros2 launch turtlebot3_manipulation_moveit_config servo.launch.py
- et la téléopération avec le clavier (dans un 3ème terminal)
ros2 run turtlebot3_manipulation_teleop turtlebot3_manipulation_teleop
- Piloter le robot dans l'espace Cartésien ou articulaire avec les touches indiquées
- et la téléopération avec le clavier (dans un 3ème terminal)
- MoveIt pour la programmation hors-ligne et planification de trajectoire :
Configuration OpenCR
Pour le Turtlebot : https://emanual.robotis.com/docs/en/platform/turtlebot3/opencr_setup/#opencr-setup
Pour l'OpenManipulator-X : https://emanual.robotis.com/docs/en/platform/turtlebot3/manipulation/#opencr-setup
Dépendances manquantes :
sudo apt install ros-humble-hardware-interface
ros-humble-ros2-control ?
ros-humble-joint-state-publisher ?
Dépendances manquantes côté Raspberry :
sudo apt install rros-humble-gripper-controllers ros-humble-xacro
Dépendances manquantes côté PC :
sudo apt install ros-humble-moveit-servo
Issues :
https://forum.robotis.com/t/ros-2-foxy-openxmanuipaltor-bringup-issues/2142/9
https://github.com/ROBOTIS-GIT/open_manipulator/issues/212
https://github.com/ROBOTIS-GIT/open_manipulator/issues/209
-----
Auteur: Gauthier Hentz, sur le wiki de l'innovation de l'IUT de Haguenau
Attribution-NonCommercial-PartageMemeConditions 4.0 International (CC BY-NC-SA 4.0)
4 - ROS2 - Manipulation Cobot
Universal Robot ROS2 Driver
Le Driver ROS2 pour les cobots Universal Robot a été développé en collaboration entre Universal Robots, le Forschungszentrum für Informatik (INRIA allemand) et PickNik Robotics. Plus précisément par nos voisins de Karlsruhe, en particulier Felix Exner (https://github.com/fmauch)). Le FZI est également à l'origine d'une proposition d'interface ROS standard pour les trajectoires Cartésiennes, qui est désormais implémentée dans les contrôleurs ROS Cartésiens d'Universal Robots. La proposition repose sur un état de l'art très intéressant des interfaces de programmation des marques de robot majeures.
Installation des paquets UR pour ROS2
- Réaliser l'installation de ROS2.
- Installer les paquets ros2 de Universal Robots
sudo apt install ros-humble-ur
- Installer rosdep pour installer automatiquement les paquets Debian dont dépendent les paquets ROS
sudo apt install python3-rosdep
- Si vous avez plusieurs versions de ROS2 installées, vérifiez que vous avez "sourcé" la bonne version de ROS2
- Mettre à jour les paquets dont ROS2 et les paquets UR dépendent
sudo rosdep init
rosdep update
sudo apt update
sudo apt dist-upgrade
Installation du simulateur hors-ligne URSim
https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver#getting-started
https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver#install-from-binary-packages
Le moyen le plus simple de découvrir et commencer à utiliser un robot UR avec ROS2 est d'utiliser la simulation de la console de programmation (teach panel) de son contrôleur. URSim est le simulateur hors-ligne de Universal Robots. Il permet de reproduire le comportement réel d'un robot quasiment à l'identique en se connectant à son adresse IP. Il est possible d'installer URSim 5 sur un Ubuntu <18 (non inclus!) ou dans une machine virtuelle (VirtualBox). Il faut se créer un compte pour télécharger le fichier URSim 5.13. Ubuntu 18 n'est plus supporté, et MoveIt2 tourne sur Ubuntu 22.
Sur Ubuntu 22
En attendant la sortie de URSim/Polyscope 6, la manière la plus simple d'installer URSim 5 sur Ubuntu 22 est via conteneur Docker créé par UR Lab (pas maintenu officiellement).
Installer Docker
Depuis les dépôts officiels Ubuntu :
sudo apt update
sudo apt install docker-compose
Ajouter votre utilisateur au groupe docker afin de manipuler les containers sans avoir à utiliser sudo systématiquement :
sudo usermod -aG docker $USER
Fermer et rouvrir la session. Tester la bonne installation :
sudo service docker start
docker run hello-world
Installer le conteneur URSim
On suit le tutoriel fourni dans la documentation du driver UR ROS. Il existe une image docker fournie sur hub.docker.com, c'est très simple :
- Télécharger l'image docker
docker pull universalrobots/ursim_e-series
- Lancer l'image sur 192.168.56.101 avec l'URCap external_control préinstallé. Les programmes installés et les changements d'installation seront stockés de manière persistante dans
${HOME}/.ursim/programs
. Par exemple-m ur5e
ros2 run ur_robot_driver start_ursim.sh -m <ur_type>
- Ouvrir l'interface URSim en suivant les instructions qui s'affichent dans la fenêtre de terminal
- Voir URSim en utilisant une application VNC, en se connectant à
192.168.56.101:5900
- Voir URSim en utilisant une application serveur web VNC http://192.168.56.101:6080/vnc.html
- Voir URSim en utilisant une application VNC, en se connectant à
Sur Windows 10/11
Pour les systèmes non-Linux, UR fournit une VM LUbuntu 14.04 qui peut tourner sous VirtualBox (gratuit) ou sur VMware (gratuit pour usage non commercial).
Installer VirtualBox
Télécharger et configurer la Machine Virtuelle
- Télécharger l'archive de la VM sur seafile ou en créant un compte chez UR
- Extraire l'archive dans
C:\Users\user\VirtualBox VMs\URSim_VIRTUAL-5.13.1.1131001
- Dans l'interface VirtualBox cliquer sur
Ajouter
- Sélectionner le Fichier machine virtuelle (
.vbox
)C:\Users\user\VirtualBox VMs\URSim_VIRTUAL-5.13.1.1131001\URSim_VIRTUAL-5.13.1.1131001.vbox
- La VM est entièrement préconfigurée, il suffit de la lancer
- La session Lubuntu est
- user :
ur
- mdp :
easybot
- user :
- Lancer URSim pour l'UR5e
- Démarrer le robot en cliquant sur le bouton d'allumage "Power"
- Pour éteindre le robot
- Ou simplement éteindre la VM
Ajouter l'URCap External Control
- Installer Terminator qui permet de faire des copier-coller
sudo apt install terminator
- Se placer dans le dossier d'échange qui fonctionne comme une clé USB
cd /home/ur/ursim-current/programs.UR5
- Lancer Terminator et télécharger le fichier
.urcap
wget https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCap/releases/download/v1.0.5/externalcontrol-1.0.5.urcap
- Démarrer URSim, ajouter l'URCap et redémarrer URSim
Configurer le réseau pour que les VMs communiquent
- Créer un réseau NAT dans les outils réseau
- Laisser la config par défaut
- Configurer chaque VM qui doit communiquer en
Réseau NAT
, par défaut elles seront en DHCP sur le réseau10.0.2.0/24
- Récupérer l'adresse IP de la VM URSim avec
ip a
, ici10.0.2.15
- Tester la communication de la VM ROS vers la VM URSim avec
ping 10.0.2.15
- Tester la communication de la VM URSim vers la VM ROS avec
ping 10.0.2.4
- Tester la communication entre ROS et URSim, voir la section dédiée
Démarrage et configuration URSim
- démarrer le robot
Programmation hors-ligne avec URSim et MoveIt2/RViz
- Réaliser l'installation de ROS2.
- Installer rosdep pour installer automatiquement les paquets Debian dont dépendent les paquets ROS
sudo apt install python3-rosdep
- Si vous avez plusieurs versions de ROS2 installées, vérifiez que vous avez "sourcé" la bonne version de ROS2
- Mettre à jour les paquets dont ROS2 dépend
sudo rosdep init
rosdep update
sudo apt update
sudo apt dist-upgrade
sudo apt install python3-colcon-common-extensions sudo apt install python3-colcon-mixin colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon mixin update default
NOTES IMPORTANTES
- si vous utilisez Linux Mint 21.1 VERA (Mate ou Cinammon, basée sur Ubuntu 22 Jammy), il faudra toujours préciser la version d'Ubuntu `--os=ubuntu:jammy` dont on veut récupérer les paquets avec la commande `rosdep` :
sudo apt update && rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y --os=ubuntu:jammy
- Si vous travaillez dans une VM d'un ordinateur ayant moins de 20GO de RAM (WSL par exemple). Ou sur un ordinateur Ubuntu ayant moins de 10GO de RAM, il faudra lancer la compilation `colcon` sans parallélisation des tâches (1 paquet compilé à la fois) `--parallel-workers 1` :
colcon build --mixin release --parallel-workers 1
Déploiement du code source des Tutoriels de MoveIt
- Créer un répertoire de travail "workspace" pour la compilation du projet avec colcon
mkdir -p ~/ws_moveit2/src
- Se déplacer dans le workspace colcon et récupérer le code source des tutoriels MoveIt :
cd ~/ws_moveit2/src git clone https://github.com/ros-planning/moveit2_tutorials -b humble --depth 1
Optionnel : Installation d'un environnement de développement MoveIt2 avec les dernières améliorations et résolutions de bug
Installation de MoveIt2 Humble sur Ubuntu 22.04 :
- Installer vcstool qui est un outil Python pour gérer les dépôts git composant un paquet ROS.
sudo apt install python3-vcstool
cd ~/ws_moveit2/src
vcs import < moveit2_tutorials/moveit2_tutorials.repos
Note : si `vcs import` vous demande vos identifiants GitHub, tapez Entrer jusqu'à ce que ça continue. Pas besoin d'identifiant pour récupérer un dépôt GitHub public.
Installation des dépendances et compilation
- Installer les dépendances ROS2 Humble (paquets debian stables).
sudo apt update && rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y
- Compiler MoveIt Tutorials (20+ minutes si vous avez choisi de déployer l'environnement de développement)
cd ~/ws_moveit2
colcon build --mixin release
- Sourcer les paquets compilés :
cd ~/ws_moveit2
source ~/ws_moveit2/install/setup.bash
- Optionnel, si vous utilisez principalement ce workspace : Sourcer automatiquement le workspace colcon au lancement d'un Terminal
echo 'source ~/ws_moveit2/install/setup.bash' >> ~/.bashrc
Tester la communication entre ROS et URSim
- Lancer URSim, par exemple avec un UR5e
ros2 run ur_robot_driver start_ursim.sh -m ur5e
- Ouvrir l'interface URSim dans le navigateur : http://192.168.56.101:6080/vnc.html --> cliquer sur Connect
- Faire tourner le driver UR ROS2
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.56.101
- Si vous bougez le robot dans URSim vous le verrez bouger dans RViz.
Envoyer des commandes au contrôleur
Avant d'envoyer des commandes, vérifier l'état des contrôleurs en utilisant ros2 control list_controllers
-
Envoyer un objectif (goal) au contrôleur de trajectoire articulaire (Joint Trajectory Controller) en utilisant le noeud de démonstration du paquet ros2_control_demos. Dans nouveau Terminal (sans oublier de sourcer) :
ros2 launch ur_robot_driver test_scaled_joint_trajectory_controller.launch.py
Après quelques secondes le robot devrait bouger.
-
Pour tester un autre contrôleur, il suffit de l'ajouter en argument de la commande
initial_joint_controller
, par exemple en utilisant joint_trajectory_controller :ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.56.101 initial_joint_controller:=joint_trajectory_controller launch_rviz:=true
-
Et envoyer la commande avec le noeud de démo :
ros2 launch ur_robot_driver test_joint_trajectory_controller.launch.py
Après quelques secondes le robot devrait bouger (ou sauter si la simulation est utilisée).
-----
Auteur: Gauthier Hentz, sur le wiki de l'innovation de l'IUT de Haguenau
Attribution-NonCommercial-PartageMemeConditions 4.0 International (CC BY-NC-SA 4.0)
Commander un robot UR avec le driver ROS2
Installation d'Ubuntu avec des capacités temps-réel
Pour un usage basique, un Ubuntu (ou Linux Mint) classique permet de piloter le robot :
Pour éviter des instabilités il est conseillé d'installer un noyau Linux avec des capacités temps-réel (PREEMPT_RT kernel). En particulier avec un robot de la Série-E, la fréquence de contrôle plus élevée peut entraîner des trajectoires non fluides sans noyau temps-réel.
- Vérifier qu'il reste au moins 25Go d'espace disque
- On se place dans un dossier pour la compilation
mkdir -p ~/rt_kernel_build
cd ~/rt_kernel_build
tar xf linux-4.14.139.tar
cd linux-4.14.139
xzcat ../patch-4.14.139-rt66.patch.xz | patch -p1
make oldconfig
Récupérer les sources du noyau temps-réel
-
- Regarder les versions LTS du noyau Linux : https://www.kernel.org/category/releases.html
- Regarder la version actuelle et les versions proposées par Ubuntu : Update Manager -> view -> Linux Kernel
- Regarder les versions maintenues activement du noyau PREEMPT_RT -> https://wiki.linuxfoundation.org/realtime/preempt_rt_versions
- Choisir la version du noyau Linux PREEMPT_RT maintenue activement correspondant à une version LTS et proposée par Ubuntu
- Exemple pour un Lenovo Thinkpad T480
- Actuellement installé : 5.19 (non-LTS)
- Proposé : 5.19 et 5.15 (LTS)
- On choisit 5.15 car LTS et activement maintenu en PREEMPT_RT
- Récupérer les sources pour
5.15.107-rt62
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/patch-5.15.107-rt62.patch.xz
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/patch-5.15.107-rt62.patch.sign
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.15.107.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.15.107.tar.sign
-
- Décompresser les fichiers téléchargés
xz -dk patch-5.15.107-rt62.patch.xz
xz -d linux-5.15.107.tar.xz
gpg2 --locate-keys torvalds@kernel.org gregkh@kernel.org
gpg2 --keyserver hkp://keys.gnupg.net --search-keys salisbury
-
- Vérifier l'intégrité des fichiers source
gpg2 --verify linux-5.15.107.tar.sign
gpg: Good signature from "Greg Kroah-Hartman <gregkh@kernel.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
gpg2 --verify patch-5.15.107-rt62.patch.sign
gpg: Good signature from "Tom Zanussi <tom.zanussi@linux.intel.com>" [unknown]
gpg: aka "Tom Zanussi <zanussi@kernel.org>" [unknown]
gpg: aka "Tom Zanussi <tzanussi@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Compiler le noyau temps réel
- Extraire l'archive tar, appliquer la patch et configurer le noyau temps-réel
tar xf linux-5.15.107.tar
cd linux-5.15.107
xzcat ../patch-5.15.107-rt62.patch.xz | patch -p1
make oldconfig
- Choisir l'option
4. Fully Preemptible Kernel (RT) (PREEMPT_RT_FULL) (NEW)
pour l'optionPreemption Model
Preemption Model
1. No Forced Preemption (Server) (PREEMPT_NONE)
> 2. Voluntary Kernel Preemption (Desktop) (PREEMPT_VOLUNTARY)
3. Preemptible Kernel (Low-Latency Desktop) (PREEMPT)
4. Fully Preemptible Kernel (RT) (PREEMPT_RT_FULL) (NEW)
choice[1-4]: 4
- Compiler le noyau
make -j `getconf _NPROCESSORS_ONLN` deb-pkg
- Après la compilation, installer les paquets
linux-headers
etlinux-image
dans le dossier parent (pas les paquets-dbg
)
sudo apt install ../linux-headers-5.15.107-rt62_*.deb ../linux-image-5.15.107-rt62_*.deb
Définir les permissions utilisateur pour exécuter des tâches temps-réel
- Le Driver ROS2 va planifier des threads avec les permissions de votre utilisateur. Il faut donc autoriser votre utilisateur à utiliser lancer des threads avec une priorité temps-réel. On créé le groupe des utilisateurs temps-réel et on y ajoute l'utilisateur :
sudo groupadd realtime
sudo usermod -aG realtime $(whoami)
- S'assurer que
/etc/security/limits.conf
contient :
@realtime soft rtprio 99 @realtime soft priority 99 @realtime soft memlock 102400 @realtime hard rtprio 99 @realtime hard priority 99 @realtime hard memlock 102400
Note: Pour que ces changements soient pris en compte il faut se déconnecter et se reconncter. On redémarrera plus tard.
https://github.com/HowardWhile/Ubunutu22.04-RT-Kernel
Configurer GRUB pour toujours booter le noyau temps-réel
- Lister les noyaux disponibles
awk -F\' '/menuentry |submenu / {print $1 $2}' /boot/grub/grub.cfg
menuentry Ubuntu
submenu Advanced options for Ubuntu
menuentry Ubuntu, with Linux 5.15.107-rt62
menuentry Ubuntu, with Linux 5.15.107-rt62 (recovery mode)
- Définir le noyau
5.15.107-rt62
par défaut avec un pattern"submenu_name>entry_name"
sudo sed -i 's/^GRUB_DEFAULT=.*/GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.15.107-rt62"/' /etc/default/grub
$ sudo update-grub
Vérification de la capacité de préemption temps-réel
uname -v | cut -d" " -f1-4
#1 SMP PREEMPT RT
Optionnel : Désactiver le CPU speed scaling
Les threads planifiés en temps-réel s'exécutent sans problème. Cependant, des composants externes tels que les systèmes de visual servoing, non planifiés pour le temps réel peuvent être interrompus par les fonctionnalités d'économie d'énergie des processeurs récents qui changent leur fréquence d'horloge de manière dynamique.
- Pour vérifier et modifier les modes d'économie d'énergie :
sudo apt install cpufrequtils
cpufreq-info
current CPU frequency is XXX MhZ
- Désactiver le changement de fréquence automatique :
sudo systemctl disable ondemand
sudo systemctl enable cpufrequtils
sudo sh -c 'echo "GOVERNOR=performance" > /etc/default/cpufrequtils'
sudo systemctl daemon-reload && sudo systemctl restart cpufrequtils
Configuration du robot UR
https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/robot_setup.html
Récupération de la calibration usine
Les robots sont calibrés en usine. Pour que les calculs cinématiques effectués dans ROS soient exacts, il faut récupérer les données de calibration. Sinon la précision des trajectoires envoyées depuis ROS et exécutées sur le robot risquent d'être de l'ordre du centimètre (au lieu du dixième de millimètre en temps normal).
-----
Auteur: Gauthier Hentz, sur le wiki de l'innovation de l'IUT de Haguenau
Attribution-NonCommercial-PartageMemeConditions 4.0 International (CC BY-NC-SA 4.0)
Programmer un robot avec MoveIt2 - Jumeau Numérique
Prérequis : être arrivé au bout du tutoriel sur le Driver UR ROS2
Comment fonctionne la manipulation avec MoveIt ?
MoveIt2 est la plateforme de manipulation robotique pour ROS2. Il implémente un nombre important des dernières innovations en termes de :
- Planification de trajectoire
- Manipulation
- Perception 3D
- Cinématique
- Contrôle
- Navigation
https://moveit.picknik.ai/humble/doc/concepts/concepts.html
Premiers pas avec MoveIt dans RViz
Pour débuter avec MoveIt, on peut utiliser ses fonctionnalités de planification de trajectoire via le plugin MoveIt Display du logiciel de visualisation 3D de ROS RViz. C'est un outils très puissant pour débuguer des applications robotiques ROS. On verra que RViz est alors un jumeau numérique du vrai robot.
Les tutoriels pour débuter et approfondir ses compétences avec MoveIt sont en Anglais et fonctionnent avec le robot Panda de Franka Emika.
Nous reprenons ici le tutoriel pour débuter avec MoveIt, et l'appliquons à un UR5e.
Avec un hardware simulé par ROS
- Faire tourner le driver UR ROS2
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy fake_hardware:=true launch_rviz:=false
Avec la simulation URSim
Sous Ubuntu 22 - docker
- Démarrer la simulation URSim pour un UR5e
ros2 run ur_robot_driver start_ursim.sh -m ur5e
- Ouvrir l'interface URSim dans le navigateur : http://192.168.56.101:6080/vnc.html --> cliquer sur Connect
- Faire tourner le driver UR ROS2
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.56.101 launch_rviz:=false
Sous Windows - VirtualBox
- Télécharger la VM URSim avec External Control préinstallé
- Configurer le réseau NAT VirtualBox, récupérer les adresses IP avec
ip a
et tester la communication avecping 10.0.2.X
, cf. : - Démarrer URSim
- Démarrer le robot virtuel
- Tester la communication entre ros_control et l'URCap external control, cf. https://innovation.iha.unistra.fr/books/robotique-open-source/page/universal-robot-ros2-driver#bkmrk-https%3A%2F%2Fgithub.com%2Fr
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=10.0.2.5 initial_joint_controller:=joint_trajectory_controller launch_rviz:=true
Avec le vrai robot
- Faire tourner le driver UR ROS2
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.0.10 launch_rviz:=false
Lancer MoveIt et RViz
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e launch_rviz:=true
https://ur-documentation.readthedocs.io/en/latest/index.html ?
Déplacer le Robot avec le Plugin MoveIt dans RViz
- On veut lancer une requête de planification de trajectoire
- On utilise le plugin MotionPlanning qui permet de configurer la requête via une interface graphique
Résultat
ros2_moveit2_ros2control_commande_externet_UR5e.mp4
Planification de trajectoire avec OMPL
Ajouter un obstacle
- Choisir une configuration cible faisable, sans collision
ros2_moveit2_OMPL_RRTconnect_evitement_collision_automatique
Tester différents algorithmes d'OMPL
- Algorithmes RRT d'exploration rapide stochastique d'arbre
ros2_moveit2_OMPL_RRTstar_evitement_collision_longueur_optimisee
Résultat
En optimisant la trajectoire avec RRTstar, on obtient un mouvement fluide, qui évite les collision avec l'environnement et de longueur minimisée. Voir la vidéo réalisée en salle robotique de l'IUT.
-----
Auteur: Gauthier Hentz, sur le wiki de l'innovation de l'IUT de Haguenau
Attribution-NonCommercial-PartageMemeConditions 4.0 International (CC BY-NC-SA 4.0)
Roomba ROS2
Connexion physique
http://www.robotappstore.com/Knowledge-Base/3-Serial-Port-Baud-Rate-Configuration/17.html
https://fr.aliexpress.com/item/1005004346786275.html
https://www.yoctopuce.com/FR/article/piloter-un-roomba-avec-un-module-yoctopuce
https://www.adafruit.com/product/2438
https://www.crc.id.au/hacking-the-roomba-600/
ROS2
Roomba ROS2
https://hackaday.io/project/178565-roomba-rpi
https://github.com/process1183/roomba-rpi
https://github.com/process1183/roomba-ros2
https://hackaday.io/project/183524-controll-yer-roomba-600-series-with-esp8266
CRASHbot, Ubuntu 18 for NVidia Jetson nano, ROS Melodic, AutonomyLab create-robot
https://www.hackster.io/andrewrgross/crashbot-part-1-planning-a-ros-roomba-helper-robot-d1c8cc
Roomblock Ubuntu 16 ROS Kinetic
https://www.instructables.com/Roomblock-a-Platform-for-Learning-ROS-Navigation-W/
https://github.com/tork-a/roomblock
Ressources
https://github.com/AutonomyLab/create_robot/tree/humble
https://github.com/process1183/roomba-ros2
https://github.com/process1183/roomba-rpi
Application
https://www.hackster.io/search?i=projects&q=roomba
https://www.hackster.io/andrewrgross/crashbot-part-1-planning-a-ros-roomba-helper-robot-d1c8cc
https://www.hackster.io/ssbaker/making-roomba-smarter-800-series-40c5e2
https://www.hackster.io/FANUEL_CONRAD/automatic-soap-dispenser-75abd6
Bras Robot Arduino ROS2
Projet d'origine
https://github.com/AntoBrandi/Robotics-and-ROS-2-Learn-by-Doing-Manipulators