OS Instalation on Pi3

Version: Ubuntu 22.04 - ROS2 iron.

This version is dedicatd to work with Turtlebot platform, combinated they form a pibot.

Need Raspberry Pi-Imager from www.raspberrypi.com (not from apt...).

Ubuntu via imager:

  1. Select our os other general-purpose OS > Ubuntu 22.04 (SERVER 64-BIT)
  2. Select the SD-Card to overwrite
  3. set parameters (Advanced Options:)
  4. choose a pibot number XX between 20 and 80.
  5. hostname: 'pibotXX'
  6. enable SSH (password auth)
  7. username: bot
  8. password: x2
  9. LAN:
    • IoT IMT Nord Europe :

Try Custom Image: Section: Modify existing image on https://opensource.com/article/21/7/custom-raspberry-pi-image

Install:

You can process a classical install from install-pi3 script or go on Manual Install section. Attention, the script also install ROS in ros-base configuration and mb6 elements.

cd
git clone https://github.com/imt-mobisyst/mb6-space
cd mb6-space
./bin/install-pi3

After installation, pibotXX will be accecible on the IP 10.89.5.XX (reserved DHCP range: \([10.89.5.10 \rightarrow 10.89.5.50]\)).

Manual Install:

Not up-to-date, please refer directly to the install script...

If necessary, update ntp serveurs conf and restart timesyncd service:

date
sudo nano /etc/systemd/timesyncd.comf
sudo service systemd-timesyncd restart

You can set: NTP=0.fr.pool.ntp.org 1.fr.pool.ntp.org 2.fr.pool.ntp.org 3.fr.pool.ntp.org

Or fix manually the date:

date
sudo date -s "2022-05-14 15:42:30"
sudo apt update

Clone mb6-space:

cd
git config --global http.sslverify false
git clone https://github.com/imt-mobisyst/mb6-space.git

Update and get some soft:

First configure apt needrestart from "interactive" (that promt an interactive windows to specify which services to resart after an apt update) to "automatic". Edit the /etc/needrestart/needrestart.conf file, to change the line #$nrconf{restart} = 'i'; to $nrconf{restart} = 'a';.

## OR:
sudo cp deps/install-pi3-needrestart.conf /etc/needrestart/needrestart.conf

You can now use apt in a more silent and autonomous mode...

sudo apt update
sudo apt remove cloud-init
sudo apt install -y build-essential meld
sudo apt upgrade -y

DHCP Server on Eth0:

The idea is to permit a direct connexion between a Suppervision-machine and the tbot-machin. First set up a static configuration on your PI: Set static eth0 configuration, in /etc/netplan/.

sudo nano /etc/netplan/60-static-eth0.yaml
# Static Configuration
network:
    ethernets:
        renderer: networkd
        eth0:
            dhcp4: no
            addresses:
                - 192.168.1.1/24
    version: 2
## OR:
sudo cp deps/install-pi3-60-static-eth0.yaml /etc/netplan/60-static-eth0.yam

sudo netplan apply

sudo cp deps/install-pi3-dhcpd.conf /etc/dhcp/dhcpd.conf``)

sudo netplan apply

Then inatll and configure isc-dhcp-server (To notice this server is deprecied from 2022)

sudo apt install isc-dhcp-server

Edit: /etc/dhcp/dhcpd.conf like:

# This is a very basic subnet declaration.

subnet 10.10.0.0 netmask 255.255.0.0 {
  range 10.10.1.20 10.10.1.80;
  option domain-name-servers 8.8.8.8, 8.8.4.4;
  option routers 10.10.1.1;
}

Set eth0 on /etc/default/isc-dhcp-server Interfaces v4.

## OR:
sudo cp deps/install-pi3-dhcpd.conf /etc/dhcp/dhcpd.conf
sudo cp deps/install-pi3-dhcp-server /etc/default/isc-dhcp-server
sudo service isc-dhcp-server restart

NotaBene: ethernet need to be connected at starttime (or isc-dhcp-server restarted)...

To debug:

systemctl status isc-dhcp-server.service # get the PID
journalctl _PID=2690

The pibot is reachable in direct ethernet connexion (10.10.1.1 or pibotXX.local).

Wifi

To add Wifi

nano /etc/netplan/50-cloud-init.yaml

robotic workspace:

You can return on README.md for more detail on ROS2 install. The script bin/install-ros configure ubuntu for ROS installation and install ros-base.

Then pibot relies on urg-node.

bin/install-ros

export ROS_DISTRO=iron
sudo apt install -y \
  ros-$ROS_DISTRO-urg-node

sudo usermod -a -G dialout `whoami`

Your good to build mb6-space:

source /opt/ros/iron/setup.bash
colcon build

Some specifics elements for Pi3:

  • The specific run-commands to source is ./bin/pibot-run-commands.bash. It permits to set a specific ROS domain to the pibot.

Edit ~/.bashrc, and add:


# mb6 ROS environment:
source ~/mb6-space/bin/pibot-run-commands.bash

Current use of pibot:

Configuration for turtlebot:

Install pkg-tbot to get turtlebot drivers.

system control

Service creation: on linuxhandbook

sudo cp ./resources/pibot.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable pibot.service