Fenrir Project - Universal Robotic Platform

Authors

  • Ing. Adam Ligocki, Ph.D.
  • ...

Chapter 1

Lorem Ipsum

Robot Assembly

Step 1 - Battery holder mount

  • Bottom part
  • Battery holders (2x)
  • Screw M3x6 (4x)

Step 2 - Front Leg mount

  • Front leg
  • Screw M3x6 (2x)

Step 3 - H-Bridge mount

  • H-bridge
  • screw M3x6 (4x)

Step 4 - Standoffs

  • Standoff (4x)
  • Screw M3x6 (4x)

Step 5 - Rear Leg mount

  • Rear leg
  • Screw M3x6 (2x)

Step 6 - Roller Casters mount

  • Roller caster (3x)
  • Screw M2x4 (6x)

Step 7 - Motors mount

  • Motor with 6-wire cable (2x)
  • Screw M3x25

Step 8 - Line Sensors mount

  • Line sensor with 3 wires (2x)
    • vcc (red)
    • gnd (black)
    • signal (blue)

Step 9 - Middle, Switch

  • Middle part
  • Switch
  • USB power delivery module
  • Wires (red & black)

Step 10 - Arduino Board

  • Arduino board
  • Screw M3x6 (4x)

Step 11 - LiDAR Mount

  • LiDAR with UART to USB converter and 4 screws

Step 12 - Ultrasound Module assembly

  • Ultrasound sensor
  • 3 wires
    • vcc (red)
    • gnd (black)
    • signal (blue)

Step 13 - US Modules mount

  • Ultrasound module (3x)
  • Screw M3x6 (6x)

Step 14 - DC/DC Stepup mount

  • DC/DC stepup
  • Screw M3x6 (2x)

Step 15 - Top, LCD

  • Top Part
  • LCD mount
  • LCD
  • Wires
    • vcc (red)
    • gnd (black)
    • sda (green)
    • scl (yellow)

Step 16 - RPi, Camera

  • Raspberry Pi 4
  • RPi camera v2
  • Camera mount
  • 4x screw M2x3

Step 17 - RPi Module mount

  • RPi module

Step 18 - Sensor Board mount

  • Sensor board
    • IMU
    • ADC
    • RTC
    • Magnetometer
    • Barometer

Step 19 - RPi Hat mount

  • RPi Hat

Step 20 - Bottom Module wires alignment

Step 21 - Mid Module wires alignment

Step 22 - Bot & Mid merge

  • Bottom module
  • Mid module
  • Standoff (4x)

Step 23 - Connecting Encoders to Arduino Board

  • Left motor -> encoder 1
  • Right motor -> encoder 2

Step 24 - Connecting US modules

  • Left US -> us_1
  • Center US -> us_2
  • Right US -> us_3

Step 25 - Top Module mount

  • Top module
  • Screw M3x4 (4s)
  • Wires (RPi power -> Arduino Board)
    • 5V (red)
    • gnd (black)

Step 26 - Connecting I2C RPi <-> Aruino Board

  • Wires
    • sda (green)
    • scl (yellow)

Step 27 - Wiring Arduino Board -> H-Bridge

  • Left motor
    • M1A -> N1 (yellow)
    • M1B -> N2 (green)
  • Right motor
    • M2A -> N3 (yellow)
    • M2B -> N4 (green)

Step 28 - Connecting RPi Power to Sensor Board

  • vcc 5V (red)
  • gnd (black)
  • sda (gree)
  • scl (yellow)

Step 29 - Power Up

Step 30 - Wheels

  • Wheel (2x)

Final

Chapter 2

Lorem Ipsum

RPi Installation

Required HW

  • Raspberry Pi 4B (8GB RAM recommended)
  • Micro SD Card (minimal 16GB, 64GB recommended)
  • SD Card to USB Adapter

Installation

Install RPi-Imager on your Linux PC

sudo apt install rpi-imager

Run RPi-Imager

rpi-imager

Select Device (Raspberry Pi 4)

Select OS - Others General Purpose OS -> Ubuntu -> Ubuntu Server 22.04.5 LTS (64b)

Select target device (SD Card)

Click Next -> Edit Settings

Setup user, password, WiFi and SSH

Confirm and wait until writing is finished.

Now put the SD card into the RPi and power on.

In case of problems, please visit Official Documentation

OS Configuration

Connect to the Raspberry Pi

ssh <user>@<ip_address>

Run first installation script and reboot afterwards. The script may require user input for confirmation on restarting services Optionaly run script to disable services for faster boot.

sudo bash first_start.sh
sudo bash slow_startup.sh #optional
sudo reboot now

The script will:

  • run system update and upgrade some system packages
  • modify the boot firmware config
  • create a swapfile (can be removed on systems with more RAM)
  • add the user to following groups - video, tty, dialout

The slow_startup.sh will disable this services:

  • network wait
  • snap and related services
  • cloud init and related services

After rebooting the system, run the second script.

sudo bash installation.sh

The script will:

  • update system and install necessary packages
  • install Python packages
  • install ROS 2 and Colcon
  • clone fenrir-project repository
  • build ROS 2 packages
  • add services to the system and enable them at startup

If user name is different then "robot", paths in scripts and service files need to be changed, along with the user for one of services.

#in repository
fenrir-project/software/raspberry_pi/prp_root.service 
fenrir-project/software/raspberry_pi/prp_user.service 
#or after install
/etc/systemd/system/prp_root.service
/etc/systemd/system/prp_user.service

The ROS_DOMAIN_ID can be changed in the *.service files and optionally (but preferably) in ~/.bashrc.

Starting services

Start the necessary services for ROS 2 nodes:

sudo systemctl start prp_root.service
sudo systemctl start prp_user.service

Cloning SD card

Prequisitions:

  • Linux OS
  • SD card reader
  • A SD card with configured system
  • An empty SD card of the same size

Example of how to clone a SD card and rename hostname

# Insert the SD card with the existing system
lsblk # Identify the SD card and its partitions (e.g., /dev/sdc1 and /dev/sdc2)

# Unmout the SD card
sudo umount /dev/sdc*

# Create an image of the SD card with the system
sudo dd if=/dev/sdc of=~/Documents/prp/robot.img bs=4M status=progress  
sudo eject /dev/sdc

# Swap the SD card with an empty one
lsblk # Identify SD card and its partitions (e.g., /dev/sdc1 and /dev/sdc2)
sudo dd if=~/Documents/prp/robot.img of=/dev/sdc bs=4M status=progress # apply image to the SD card
sudo sync

# Mount the SD card's partitions
sudo mkdir /media/jakub/card1
sudo mount /dev/sdc1 /media/jakub/card1
sudo mkdir /media/jakub/card2
sudo mount /dev/sdc2 /media/jakub/card2

# Replace the old hostname for new one
sudo sed -i 's/prp-red/prp-green/g' /media/jakub/card1/user-data /media/jakub/card2/etc/hostname /media/jakub/card2/etc/hosts

# Unmount SD card and remove created folders
sudo umount /media/jakub/card1
sudo umount /media/jakub/card2
sudo rmdir /media/jakub/card1/
sudo rmdir /media/jakub/card2/

ROS_DOMAIN_ID can be rewritten in files:

~/.bashrc
/etc/systemd/system/prp_user.service
/etc/systemd/system/prp_root.service

Arduino Programming

HW Required

  • Host PC with Arduino Studio IDE installed see here.
  • Arduino Nano "Every" (Original or clone, Every need for more external interrupts)
  • USB cable to connect Arduino with PC
  • Arduino PCB for Fenrir Project

Programming

Open the software/arduino_nano/main/main.ino file in the Arduino IDE.

Connect the Arduino Every to the

Try to build the firmware using the "Verify" button in left top.

If build goes ok, try to upload the firmware using the "Upload" button in left top.

Using the ctrl+shift+M open terminal and check if microcontroller communicates.

Program Description

... TODO ...