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¶
Download Ubuntu LTS 20.04
Create a bootable USB Stick
In case you already have an ubuntu based operating system, you can follow the following tutorial
In case you use windows as operating system, you have to google how to do it. Please update this tutorial afterwards.
Ensure that
Above 4G decoding(on another mainboard it might be calledlarge/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.Boot the ACU and choose the USB stick as primary boot device in the BIOS.
Install Ubuntu.
Describe options to choose.
Log into google in firefox with
acu@curemannheim.de. The password is documented in our passbolt instance.
1.8.2. Install NVIDIA Driver¶
Install the nvidia driver
Open the
Additional Driverstab inside theSoftware & Updateapplication.Install the proprietary nvidia-driver-470 graphic driver.
Download CUDA 11.4.2 and install it according to the instructions on the download website.
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¶
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
Download and install Visual Studio Code
Download and install slack and login as
acu@curemannheim.de.sudo snap install slack
Download and install Foxglove Studio.
Install docker:
curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh
Execute docker post install commands for managing docker as non-root user.
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.
If you clone the repository via https
Generate a personal access token from GitLab and copy it
Store the personal access token, so it must not be reentered every time (unsafe, but still recommended :/)
git config credential.helper store
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_TOKENwith your actual token.
- 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.
Add
@reboot /path/to/as_ros/src/can_interface/scripts/init_can.shas cronjob by inserting it after executing:sudo crontab -e
1.8.6. Clone and build docker container¶
Change into the docker directory
cd docker
Build the docker container. Choose AS with perception, cache or no cache and latest as tag.
build_docker.sh
Run the docker container. Choose latest as tag, container with perception packages, autostart, UBUNTU with NVIDIA GPU and
asas name.run_docker.sh
1.8.7. Setup Perception und Control¶
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.
Make sure the IP space
169.254.0.0/16is routed via the ethernet interface only like this:169.254.0.0/16 dev enp5s0 scope link metric 1000If this is not the case, you need to adjust the avahi-config with
sudo nano /etc/avahi/avahi-daemon.confand your interfaces:[...] allow-interfaces=enp5s0 deny-interfaces=docker0 [...]
Restart the avahi-daemon:
sudo systemctl restart avahi-daemon.service
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:
Remove old route
sudo ip route del 169.254.0.0/16
Add new route
sudo ip route add 169.254.0.0/16 dev enp5s0 scope link metric 1000
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
Open the Ubuntu settings
Change to the
Networkand open the settings tab for the wired settingsOpen the
IPv4tab and chooseManualEnter
192.168.201.4as Address,255.255.255.0as Netmask and192.168.201.1as Gateway
1.8.10. Configure a static IP for the LiDAR¶
Connect the LiDAR and ACU to the switch.
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\""
Verify the LiDAR is reachable by pinging it.
ping os-122330002135.localThis should now return
192.168.201.6instead 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.
Install
linuxptpusingapt install linuxptp.Create a Unit file using
sudo nano /etc/systemd/system/ptp4l.servicewith 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.
Reload all Unit files using
sudo systemctl daemon-reloadEnable the service, so it runs on startup using
sudo systemctl enable ptp4lVerify 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.
Install tigervnc according to this tigervnc tutorial until (and excluding) step 6.
To test VNC you can execute the according shell script on the host system:
./utils/vnc.sh
Install a vnc client on your local machine (Linux: Remmina, Windows: RealVNC) and connect to the ACU via VNC.