1.8. Setup ACU and install AS ROS and its dependencies

This page explains all steps to install a ready to drive Autonomous System on a fresh ACU. This can also be used to reinstall the system.

1.8.1. Setup BIOS and Install Ubuntu

  1. Download Ubuntu LTS 20.04

  2. Create a bootable USB Stick

    1. In case you already have an ubuntu based operating system, you can follow the following tutorial

    2. In case you use windows as operating system, you have to google how to do it. Please update this tutorial afterwards.

  3. Ensure that Above 4G decoding (on another mainboard it might be called large/64bit BARs) is enabled inside the BIOS of the ACU (advanced / system / IO ports). This settings allows the os to access periphery with more than 4GB.

  4. Boot the ACU and choose the USB stick as primary boot device in the BIOS.

  5. Install Ubuntu.

    1. Describe options to choose.

  6. Log into google in firefox with acu@curemannheim.de. The password is documented in our passbolt instance.

1.8.2. Install NVIDIA Driver

  1. Install the nvidia driver

    1. Open the Additional Drivers tab inside the Software & Update application.

    2. Install the proprietary nvidia-driver-470 graphic driver.

  2. Download CUDA 11.4.2 and install it according to the instructions on the download website.

  3. Download and install tensorrt 8.2.3. You have to create a nvidia developer account first. You can use the ACU google email with the same password as the google password.

1.8.3. Install Prerequisites

  1. Install Git, terminator, ssh server and client, python, ffmepg and curl

    sudo apt install git terminator net-tools openssh-server python3 python3-pip python3-dev libcurl4-openssl-dev libssl-dev ffmpeg curl python3-wheel python3-venv
    
  2. Download and install Visual Studio Code

  3. Download and install slack and login as acu@curemannheim.de.

    sudo snap install slack
    
  4. Download and install Foxglove Studio.

  5. Install docker:

    curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh
    
  6. Execute docker post install commands for managing docker as non-root user.

  7. Install the NVIDIA docker container toolkit according to the respective documentation.

1.8.4. Clone AS ROS

Before you can clone the repository, you need to install git on your system

sudo apt install git

Download the git installer and install it.

  1. If you clone the repository via https

    1. Generate a personal access token from GitLab and copy it

    2. Store the personal access token, so it must not be reentered every time (unsafe, but still recommended :/)

      git config credential.helper store
      
  2. Clone the AS ROS git repository

    git clone https://YOUR_PERSONAL_ACCESS_TOKEN@gitlab.curemannheim.de/driverless/as_ros.git && cd as_ros
    

Make sure to replace YOUR_PERSONAL_ACCESS_TOKEN with your actual token.

  1. Remember to update the submodules with the same command everytime you switch branches, since they may differ from branch to branch
    git submodule update --init --recursive
    

1.8.5. Initialize CAN Interface

Add initialization of can interface as cron job.

  1. Add @reboot /path/to/as_ros/src/can_interface/scripts/init_can.sh as cronjob by inserting it after executing:

    sudo crontab -e
    

1.8.6. Clone and build docker container

  1. Change into the docker directory

    cd docker
    
  2. Build the docker container. Choose AS with perception, cache or no cache and latest as tag.

    build_docker.sh
    
  3. Run the docker container. Choose latest as tag, container with perception packages, autostart, UBUNTU with NVIDIA GPU and as as name.

    run_docker.sh
    

1.8.7. Setup Perception und Control

  1. Setup Camera Perception

  2. Setup Control module

1.8.8. Validate mDNS Setup and LiDAR connectivity

Note

The LiDAR will be configured to use the static IP address 192.168.201.6/24. But to connect to the LiDAR initially and apply the static IP mDNS is required.

  1. Make sure the IP space 169.254.0.0/16 is routed via the ethernet interface only like this: 169.254.0.0/16 dev enp5s0 scope link metric 1000

  2. If this is not the case, you need to adjust the avahi-config with sudo nano /etc/avahi/avahi-daemon.conf and your interfaces:

    [...]
    allow-interfaces=enp5s0
    deny-interfaces=docker0
    [...]
    
  3. Restart the avahi-daemon:

    sudo systemctl restart avahi-daemon.service
    
  4. Your ip routes should look something like this (ip route show):

    default via 141.72.128.1 dev wlx5c4979f85c29 proto dhcp metric 600
    141.72.128.0/19 dev wlx5c4979f85c29 proto kernel scope link src 141.72.149.33 metric 600
    169.254.0.0/16 dev enp5s0 scope link metric 1000
    172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
    192.168.201.0/24 dev enp5s0 proto kernel scope link src 192.168.201.4 metric 100
    

If this did not work, you need to add the route manually:

  1. Remove old route

    sudo ip route del 169.254.0.0/16
    
  2. Add new route

    sudo ip route add 169.254.0.0/16 dev enp5s0 scope link metric 1000
    
  3. Restart the avahi-daemon:

    sudo systemctl restart avahi-daemon.service
    

Note

You can also use the fix_lidar_route.sh under docker/additional_resources to perform this.

Check if the LiDAR is reachable, by pinging it. If it can resolve the IP address, the mDNS setup is correct. If it can send and receive packets, the LiDAR is reachable.

1.8.9. Configure Ethernet Interface

Assign a static IPv4 Address for the ethernet interface of the ACU

  1. Open the Ubuntu settings

  2. Change to the Network and open the settings tab for the wired settings

  3. Open the IPv4 tab and choose Manual

  4. Enter 192.168.201.4 as Address, 255.255.255.0 as Netmask and 192.168.201.1 as Gateway

1.8.10. Configure a static IP for the LiDAR

  1. Connect the LiDAR and ACU to the switch.

  2. Override the LiDAR’s IP address to a static one:

    curl -X PUT http://os-122330002135.local/api/v1/system/network/ipv4/override \
    -H "Content-Type: application/json" \
    -H "Host: os-122330002135.local" \
    -d "\"192.168.201.6/24\""
    
  3. Verify the LiDAR is reachable by pinging it.

    ping os-122330002135.local
    

    This should now return 192.168.201.6 instead of its link-local address.

Note

For more network information see Network devices with IP Adresses in Ethernet Network.

1.8.11. Setup PTP server

A PTP server is necessary for the LiDAR to set its clock to the UNIX epoch time on start up instead of 0.

  1. Install linuxptp using apt install linuxptp.

  2. Create a Unit file using sudo nano /etc/systemd/system/ptp4l.service with the following content:

[Unit]
Description=PTP4L Service
After=network.target

[Service]
Type=simple
ExecStart=ptp4l -i enp5s0 -m -S
Restart=always
RestartSec=3
User=root
Group=root

[Install]
WantedBy=multi-user.target

You might need to adjust the interface used. In the above example enp5s0 is used.

  1. Reload all Unit files using sudo systemctl daemon-reload

  2. Enable the service, so it runs on startup using sudo systemctl enable ptp4l

  3. Verify the service is running using sudo systemctl status ptp4l

1.8.12. Install VNC Server

This is to enable working with GUIs on the ACU without an external display.

  1. Install tigervnc according to this tigervnc tutorial until (and excluding) step 6.

  2. To test VNC you can execute the according shell script on the host system:

    ./utils/vnc.sh
    
  3. Install a vnc client on your local machine (Linux: Remmina, Windows: RealVNC) and connect to the ACU via VNC.