RTS master old installation - norlab-ulaval/Norlab_wiki GitHub Wiki

Installation

To enable LoRa communication with the clients install the following packages:

sudo apt install dkms
cd ~/repos/
git clone https://github.com/rogerjames99/spi-ch341-usb.git
cd spi-ch341-usb
ls /dev
stty -echo raw speed 115200 < /dev/ttyACM1 && cat /dev/ttyACM1

Steps to setup raspberry pi:

  1. Wait for cloud-init to finish (around 2 minutes)
  2. Fail for password login so:
sudo reboot
  1. Login with user: robot, password: you know what
  2. Optionnal: Setup keyboard layout -> Canada International: sudo dpkg-reconfigure keyboard-configuration

Fix ethernet connection

More on ethernet connection: netplan connection

  1. Modify netplan network config:
sudo vim /etc/netplan/50-cloud-init.yaml

The file must have the following content:

network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            dhcp4: true

Using the wired connection (eth0), that is the same as eduroam, we can now ssh into the rpi.

  1. Try the new network configuration:
sudo netplan try
  1. Apply the modifications made to the network config file:
sudo netplan apply
  1. Execute the updates:
sudo apt update
sudo apt upgrade
sudo apt install network-manager
sudo apt install micro
sudo apt install nmcli
  1. Reboot:
sudo reboot

Now we can ssh into the rpi using ssh robot@IP_adress

  1. To know the IP_adress use:
ip a

Set static IP_adress:

IP adress guide

Install ros2 humble

Installation guide

There is a couples of different commands for ros2 installation in rpi: ros2 installation on rpi

  1. Only install the ros-base version:
sudo apt install ros-humble-ros-base
  1. Install colcon build and rosdep:
sudo apt update
sudo apt install python3-colcon-common-extensions
sudo apt-get install python3-rosdep
sudo apt install build-essential
  1. Source in the bash:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
  1. Create ros2 workspace:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
  1. Colcon build:
colcon build
  1. Create symlink build file:
sudo micro symlink_build.sh

The file should look like this:

#! /bin/bash
rosdep install --from-paths src --ignore-src -y -r
colcon build --symlink-install
source ~/ros2_ws/install/setup.bash
sudo chmod +x symlink_build.sh

Clone the packages needed:

  1. First we need to create the ssh key for Github:
ssh-keygen -t ed25519 -C [email protected] -q -N ""
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
git config --global user.email [email protected]
git config --global user.name Norlab Team

Then add this ssh key in Git Hub norlab account.

  1. Initialise rosdep:
sudo rosdep init
rosdep update
  1. Clone total station ros2 packages:
cd ~/ros2_ws/src
git clone [email protected]:norlab-ulaval/theodolite_master.git -b rpi_3B
git clone [email protected]:norlab-ulaval/theodolite_node_msgs.git
  1. Install dependencies:
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libwiringpi-dev
  1. Build workspace:
cd ~/ros2_ws
./symlink_build.sh
  1. Install rmwzenoh
  2. Create a service for zenoh:
sudo micro /etc/system/system/launch_theodolite.service
[Unit]
Description=Eclipse Zenoh RMW Router
Documentation=https://github.com/ros2/rmw_zenoh
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
WorkingDirectory=/home/robot/
ExecStart=/home/robot/launch_zenoh.sh
KillMode=mixed
KillSignal=SIGINT
RestartKillSignal=SIGINT
Restart=on-failure
RestartSec=2
User=robot
StandardOutput=journal
StandardError=journal
SyslogIdentifier=rmw_zenohd

[Install]
WantedBy=default.target
  1. Create a service for theodolite_master:
sudo micro /etc/system/system/launch_theodolite.service
[Unit]
Description="Warthog RPi Master theodolite startup service"
Requires=launch_zenoh.service
After=launch_zenoh.service
Wants=launch_zenoh.service

[Service]
User=robot
ExecStart=/home/robot/launch_theodolite.sh
RemainAfterExit=yes
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target