W: Während der Überprüfung der Signatur trat ein Fehler auf. Das Depot wurde nicht aktualisiert und die vorherigen Indexdateien werden verwendet. GPG-Fehler: http://packages.ros.org/ros/ubuntu xenial InRelease: Die folgenden Signaturen konnten nicht überprüft werden, weil ihr öffentlicher Schlüssel nicht verfügbar ist: NO_PUBKEY F42ED6FBAB17C654
W: Fehlschlag beim Holen von http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease Die folgenden Signaturen konnten nicht überprüft werden, weil ihr öffentlicher Schlüssel nicht verfügbar ist: NO_PUBKEY F42ED6FBAB17C654
W: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.
dab@dab-Predator:~$ sudo apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116
[sudo] Passwort für dab:
OK
dab@dab-Predator:~$ sudo -E apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
Executing: /tmp/tmp.jHM4YOyGCc/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv-key
C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
gpg: Schlüssel AB17C654 von hkp-Server keyserver.ubuntu.com anfordern
gpg: Schlüssel AB17C654: Öffentlicher Schlüssel "Open Robotics <info@osrfoundation.org>" importiert
gpg: Anzahl insgesamt bearbeiteter Schlüssel: 1
gpg: importiert: 1 (RSA: 1)
dab@dab-Predator:~$ sudo apt clean && sudo apt update
OK:1 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial InRelease
Ign:2 http://linux.dropbox.com/ubuntu xenial InRelease
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease
Holen:4 http://linux.dropbox.com/ubuntu xenial Release [6.600 B]
OK:5 http://de.archive.ubuntu.com/ubuntu xenial InRelease
OK:6 http://dl.google.com/linux/chrome/deb stable Release
OK:7 http://de.archive.ubuntu.com/ubuntu xenial-updates InRelease
OK:9 http://de.archive.ubuntu.com/ubuntu xenial-backports InRelease
Holen:10 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Holen:12 http://packages.ros.org/ros/ubuntu xenial InRelease [4.678 B]
Holen:13 http://packages.ros.org/ros/ubuntu xenial/main amd64 Packages [823 kB]
Holen:14 http://packages.ros.org/ros/ubuntu xenial/main i386 Packages [595 kB]
Es wurden 1.538 kB in 3 s geholt (422 kB/s).
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Aktualisierung für 521 Pakete verfügbar. Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.
https://github.com/ccny-ros-pkg/imu_tools.git Pakete aus den Quellen nachinstallieren, nachdem bereits mit desktop-full zahlreiche Pakete installiert wurden.
cd ros_catkin_ws/
ls
cd src
ls
git clone https://github.com/ros-drivers/rosserial.git
cd ..
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
https://github.com/ccny-ros-pkg/imu_tools.gitcd imu_tools/
git checkout melodic
cd ..
catkin_make_isolated --install --pkg imu_filter_madgwick
imu-tools auf aktuelle Version melodic setzen, sonst gibt der Compiler einen Fehler aus
rosinstall_generator tf2 tf2-ros gmapping navigation --rosdistro melodic --deps --tar > add-pckages.rosinstall
wstool merge add-pckages.rosinstall -t src
wstool update -t src
rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r
Die zum Bau des Images benötige Datei Dockerfile sieht folgendermaßen aus:
ROM ros:melodic-ros-base
ARG ROSDISTRO
RUN apt-get update && apt-get install -y \
python-pip \
avahi-daemon \
openssh-server \
python-setuptools \
python-dev \
build-essential \
nano \
ros-$ROSDISTRO-roslint \
ros-$ROSDISTRO-rosserial \
ros-$ROSDISTRO-rosserial-arduino \
ros-$ROSDISTRO-imu-filter-madgwick \
ros-$ROSDISTRO-gmapping \
ros-$ROSDISTRO-map-server \
ros-$ROSDISTRO-navigation \
ros-$ROSDISTRO-robot-localization \
ros-$ROSDISTRO-tf2 \
ros-$ROSDISTRO-tf2-ros \
ros-$ROSDISTRO-rplidar-ros
RUN pip install -U platformio
SHELL ["/bin/bash", "-c"]
RUN source /opt/ros/$ROSDISTRO/setup.bash && echo $_CATKIN_SETUP_DIR
RUN mkdir -p root/linorobot_ws/src
RUN cd /root/linorobot_ws/src && source /opt/ros/$ROSDISTRO/setup.bash && catkin_init_workspace
WORKDIR /root/linorobot_ws/src
RUN pwd
RUN git clone https://github.com/linorobot/linorobot.git
RUN git clone https://github.com/linorobot/imu_calib.git
RUN git clone https://github.com/linorobot/lino_pid.git
RUN git clone https://github.com/linorobot/lino_udev.git
RUN git clone https://github.com/linorobot/lino_msgs.git
RUN cd /root/linorobot_ws/src/linorobot
WORKDIR /root/linorobot_ws/src/linorobot/teensy/firmware
RUN export PLATFORMIO_CI_SRC=/root/linorobot_ws/src/linorobot/teensy/firmware/src/firmware.ino
ENV PLATFORMIO_CI_SRC=/root/linorobot_ws/src/linorobot/teensy/firmware/src/firmware.ino
RUN platformio ci --project-conf=./platformio.ini --lib="./lib/ros_lib" --lib="./lib/config" --lib="./lib/motor" --lib="./lib/kinematics" --lib="./lib/pid" --lib=$
RUN echo "source /root/linorobot_ws/devel/setup.bash" >> /root/.bashrc
RUN echo "export LINOLIDAR='rplidar'" >> /root/.bashrc
RUN echo "export LINOBASE='2wd'" >> /root/.bashrc
RUN source /opt/ros/$ROSDISTRO/setup.bash && source /root/.bashrc && cd /root/linorobot_ws && catkin_make --pkg lino_msgs && catkin_make
RUN cd /etc/udev && wget https://raw.githubusercontent.com/linorobot/lino_install/master/files/49-teensy.rules
Mit dem Befehlt
docker build --network host --build-arg ROSDISTRO=melodic -t linorobot .
startet man den Buldvorgang
Sending build context to Docker daemon 2.56kB
Step 1/24 : FROM ros:melodic-ros-base
melodic-ros-base: Pulling from library/ros
b0b312c654a9: Pull complete
f7f8a2b7886d: Pull complete
2d07ab3b900d: Pull complete
fc1f49a58853: Pull complete
ef97618b6d67: Pull complete
f74cc414b82f: Pull complete
df074ca58e1d: Pull complete
517b10ee1dff: Pull complete
4b8b3b5e8702: Pull complete
005c3125f47e: Pull complete
ba09cdd58271: Downloading 169.4MB/232.6MB
43581541e27c: Download complete
9d810dbfbec2: Download complete
...
Step 2/24 : ARG ROSDISTRO
---> Using cache
---> bbd4fd9271ee
Step 3/24 : RUN apt-get update && apt-get install -y python-pip avahi-daemon openssh-server python-setuptools python-dev build-essential ros-$ROSDISTRO-roslint ros-$ROSDISTRO-rosserial ros-$ROSDISTRO-rosserial-arduino ros-$ROSDISTRO-imu-filter-madgwick ros-$ROSDISTRO-gmapping ros-$ROSDISTRO-map-server ros-$ROSDISTRO-navigation ros-$ROSDISTRO-robot-localization ros-$ROSDISTRO-tf2 ros-$ROSDISTRO-tf2-ros ros-$ROSDISTRO-rplidar-ros
---> Using cache
---> 27ac02b6021b
Step 4/24 : RUN pip install -U platformio
---> Using cache
---> c92292662cdb
Step 5/24 : SHELL ["/bin/bash", "-c"]
---> Using cache
---> f4ef6f3c1f4d
Step 6/24 : RUN source /opt/ros/$ROSDISTRO/setup.bash && echo $_CATKIN_SETUP_DIR
---> Using cache
---> 15bb729db6cc
Step 7/24 : RUN mkdir -p root/linorobot_ws/src
---> Using cache
---> 2ae3a1329f40
Step 8/24 : RUN cd /root/linorobot_ws/src && source /opt/ros/$ROSDISTRO/setup.bash && catkin_init_workspace
---> Using cache
---> b72ade41a6b8
Step 9/24 : WORKDIR /root/linorobot_ws/src
---> Using cache
---> 7115cc6674a5
Step 10/24 : RUN pwd
---> Using cache
---> 4dd630251022
Step 11/24 : RUN git clone https://github.com/linorobot/linorobot.git
---> Using cache
---> 5c353f8d2d2f
Step 12/24 : RUN git clone https://github.com/linorobot/imu_calib.git
---> Using cache
---> 65a3015f3442
Step 13/24 : RUN git clone https://github.com/linorobot/lino_pid.git
---> Using cache
---> 76462509f326
Step 14/24 : RUN git clone https://github.com/linorobot/lino_udev.git
---> Using cache
---> 1fb59d82c839
Step 15/24 : RUN git clone https://github.com/linorobot/lino_msgs.git
---> Using cache
---> d49c60c208b0
Step 16/24 : RUN cd /root/linorobot_ws/src/linorobot
---> Using cache
---> 8a32a6894e48
Step 17/24 : WORKDIR /root/linorobot_ws/src/linorobot/teensy/firmware
---> Using cache
---> 1a2b0c9c88a6
Step 18/24 : RUN export PLATFORMIO_CI_SRC=/root/linorobot_ws/src/linorobot/teensy/firmware/src/firmware.ino
---> Using cache
---> 34d7b952fd33
Step 19/24 : ENV PLATFORMIO_CI_SRC=/root/linorobot_ws/src/linorobot/teensy/firmware/src/firmware.ino
---> Using cache
---> 50e43ea4d59d
Step 20/24 : RUN platformio ci --project-conf=./platformio.ini --lib="./lib/ros_lib" --lib="./lib/config" --lib="./lib/motor" --lib="./lib/kinematics" --lib="./lib/pid" --lib="./lib/imu" --lib="./lib/encoder"
---> Using cache
---> 671979a6378e
Step 21/24 : RUN echo "source /root/linorobot_ws/devel/setup.bash" >> /root/.bashrc
---> Using cache
---> bf13fbead09e
Step 22/24 : RUN echo "export LINOLIDAR='rplidar'" >> /root/.bashrc
---> Using cache
---> ff87d3102a1e
Step 23/24 : RUN echo "export LINOBASE='2wd'" >> /root/.bashrc
---> Using cache
---> 20fe0d525c24
Step 24/24 : RUN source /opt/ros/$ROSDISTRO/setup.bash && source /root/.bashrc && cd /root/linorobot_ws && catkin_make --pkg lino_msgs && catkin_make
---> Using cache
---> 297c4d11a900
Successfully built 297c4d11a900
Successfully tagged linorobot:latest
Mit dem Befehl
pi@raspberrypi:~/linorobot $ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
linorobot latest 9dd6b91cae78 7 hours ago 1.5GB
<none> <none> 297c4d11a900 46 hours ago 1.5GB
ros melodic-ros-base d463c5c60280 2 weeks ago 1GB
kann man sich alle Images auf dem System anzeigen lassen. Mit dem Befehl
docker run -v /dev:/dev --privileged --net=host -it linorobot
instanziert man aus dem Image einen Container und startet ihn. Da der Container vollen Zugriff auf die Resourcen des Hosts und das Netz haben soll, gibt man zusätzliche Optionen an: -v /dev:/dev: bilden den kompletten Device-Tree des Hosts imn Container ab, womit der Zugriff auf die seriellen Schnittstellen möglich ist. – privileged: gibt den Zugriff mit den vollen Rechten frei –net=host: der Container benutzt die gleiche IP-Adresse wie der Host. -it: der Container wird mit einer interaktiven Shell gestart, in der man Befehle eingeben kann.
Mit dem Befehl exit kann man die Shell jederzeit verlassen, woraufhin der Container stoppt. Welche Container gerade laufen und welche gestoppt wurden, sieht man mit:
pi@raspberrypi:~ $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ed620ef3aa50 linorobot "/ros_entrypoint.sh …" 7 hours ago Exited (0) 41 seconds ago hardcore_darwin
ab08d00f8f6e 297c4d11a900 "/ros_entrypoint.sh …" 44 hours ago Exited (0) 44 hours ago elastic_mestorf
7bb03a3e5ead 297c4d11a900 "/ros_entrypoint.sh …" 45 hours ago Exited (0) 7 hours ago frosty_bose
Um einen Container wieder zu starten, benutzt man den Befehl
pi@raspberrypi:~ $ docker start -i hardcore_darwin
root@raspberrypi:~/linorobot_ws/src/linorobot/teensy/firmware#
Checken mit
pi@raspberrypi:~/linorobot $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ed620ef3aa50 linorobot "/ros_entrypoint.sh …" 7 hours ago Up 43 seconds hardcore_darwin
ab08d00f8f6e 297c4d11a900 "/ros_entrypoint.sh …" 44 hours ago Exited (0) 44 hours ago elastic_mestorf
7bb03a3e5ead 297c4d11a900 "/ros_entrypoint.sh …" 45 hours ago Exited (0) 7 hours ago frosty_bose
In einem gestarteten Container, kann man über die Shell jederzeit weitere Befehle per apt nachinstallieren. Dem Basis-Image melodic-ros-base liegt zwar Ubuntu 18.04 zugrunde, trotzdem sind im Image nur die nötigsten Befehle mit an Board. Befehle wie less, nano, lsusb oder Tools wie gnupg, gnutls usw fehlen.
ros-melodic-ros-base
udev-Regeln
ignore
sequenceDiagram
PC->ROSMASTER: Which Topics
ROSMASTER->Roboter: Topics
PC->Roboter: subscribe
ignore
manuelle Konfiguration IP 192.168.2.222
manuelle Konfiguration IP 192.168.2.183 dort läuft roscore
source /opt/ros/kinetic/setup.bash
export ROS_HOSTNAME=192.168.2.183
export ROS_MASTER_URI=http://192.168.2.183:11311
source /home/admin/Dropbox/catkin_ws/devel/setup.bash
#PYTHONPATH="/home/admin/.local/lib/python3.6/site-packages":"${PYTHONPATH}"
export PYTHONPATH
source /opt/ros/melodic/setup.bash
source /home/dab/linorobot_ws/devel/setup.bash
export LINOLIDAR=rplidar
export LINOBASE=2wd
export ROS_MASTER_URI=http://192.168.2.183:11311
export ROS_HOSTNAME=192.168.2.222
Ab Werk sind die Teensy mit einer Firmware vorbestückt, mit der sie sich als HID am USB-Port eines Host anmelden. Für den Linorobot müssen sie sich jedoch als serielle Schnittstelle registrieren, um darüber die Odometrie-Daten zu senden und die Speed-Befehle zu erhalten.
Dazu muss man einmalig einen Sketch auf den Teensy laden und bei der Board-Einstellungen “serial” auswählen
Als Port zur Übertragung wählt man den HID-Port aus (über den sich der Teensy bislang noch am Host anmeldet) aus.
Als Sketch wählt man einfach den Blink-Sketch aus den Beispielen aus.
damit der Teensy den richtigen Zugriffsrechten (für seine virtuelle serielle Schnittstelle) unter Linux konfiguriert wird, benötigen man eine udev-Regel (49-teensy.rules). Für den Linorobot gibt es folgende Regel:
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
Sobald der Teensy angeschlossen wird, führt udev die zur Vendor- und Produkt-ID passenden Regeln aus.
Mit folgender udev-Regel (58-lino.rules) legt man die Zugriffsrechte und einen eindeutigen symbolischen Namen fest
KERNEL=="ttyACM?", SUBSYSTEM=="tty", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0483", ATTRS{serial}=="1335050", MODE="0666" SYMLINK+="linobase"
KERNEL=="ttyUSB?", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0666" SYMLINK+="linolidar"
Das Attribut ATTRS{serial} kann entfallen. Das Anlegen von udev-Regeln funktioniert nicht innerhalb eines Docker-Containers. Vielmehr sind die udev-Regeln auf dem Host entscheidend. Mit -v dev:/dev und –privileged kann der Container aber vollständig auf den Device-Tree zugreifen.
sudo apt-get install ros-kinetic-teleop-twist-keyboard
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _speed:=0.2
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _speed:=0.9 _turn:=0.8
Best way to add new package to ROS that was installed from source (rosinstall_generator)
Linorobot Indonesia, R&D of Robot Operating System for Education
https://github.com/turtlebot/turtlebot/issues/272
https://edu.gaitech.hk/turtlebot/free-space-navigation.html
https://atadiat.com/en/e-ros-imu-and-arduino-how-to-send-to-ros/
Vector Beispiele https://gist.github.com/acidzebra
Abratrtrt