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:
- Wait for cloud-init to finish (around 2 minutes)
- Fail for password login so:
sudo reboot
- Login with
user:robot,password:you know what - Optionnal: Setup keyboard layout -> Canada International: sudo dpkg-reconfigure keyboard-configuration
Fix ethernet connection
More on ethernet connection: netplan connection
- 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.
- Try the new network configuration:
sudo netplan try
- Apply the modifications made to the network config file:
sudo netplan apply
- Execute the updates:
sudo apt update
sudo apt upgrade
sudo apt install network-manager
sudo apt install micro
sudo apt install nmcli
- Reboot:
sudo reboot
Now we can ssh into the rpi using ssh robot@IP_adress
- To know the IP_adress use:
ip a
Set static IP_adress:
Install ros2 humble
There is a couples of different commands for ros2 installation in rpi: ros2 installation on rpi
- Only install the
ros-baseversion:
sudo apt install ros-humble-ros-base
- 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
- Source in the bash:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
- Create ros2 workspace:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
- Colcon build:
colcon build
- 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:
- 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.
- Initialise rosdep:
sudo rosdep init
rosdep update
- 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
- Install dependencies:
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libwiringpi-dev
- Build workspace:
cd ~/ros2_ws
./symlink_build.sh
- Install rmwzenoh
- 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
- 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