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. Setup BIOS and Install Ubuntu ----------------------------- #. Download `Ubuntu LTS 20.04`_ #. Create a bootable USB Stick a. In case you already have an ubuntu based operating system, you can follow the following `tutorial`_ b. 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 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. #. Boot the ACU and choose the USB stick as primary boot device in the BIOS. #. Install Ubuntu. a. Describe options to choose. #. Log into google in firefox with ``acu@curemannheim.de``. The password is documented in our passbolt instance. Install NVIDIA Driver --------------------- #. Install the nvidia driver a. Open the ``Additional Drivers`` tab inside the ``Software & Update`` application. b. 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. Install Prerequisites --------------------- #. Install Git, terminator, ssh server and client, python, ffmepg and curl .. code-block:: bash 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``. .. code-block:: bash sudo snap install slack #. Download and install `Foxglove Studio`_. #. Install docker: .. code-block:: bash 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. Clone AS ROS ------------ Before you can clone the repository, you need to install git on your system .. tab:: Ubuntu .. code:: bash sudo apt install git .. tab:: Windows Download the `git installer `_ and install it. 1. If you clone the repository via https a. Generate a personal access token from `GitLab `_ and copy it b. Store the personal access token, so it must not be reentered every time (unsafe, but still recommended :/) .. code:: bash git config credential.helper store 2. Clone the AS ROS git repository .. code:: bash 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. 3. Remember to update the submodules with the same command everytime you switch branches, since they may differ from branch to branch .. code:: bash git submodule update --init --recursive Initialize CAN Interface ------------------------ Add initialization of can interface as cron job. #. Add ``@reboot /path/to/as_ros/src/can_interface/scripts/init_can.sh`` as cronjob by inserting it after executing: .. code-block:: bash sudo crontab -e Clone and build docker container -------------------------------- #. Change into the docker directory .. code-block:: bash cd docker #. Build the docker container. Choose AS with perception, cache or no cache and latest as tag. .. code-block:: bash build_docker.sh #. Run the docker container. Choose latest as tag, container with perception packages, autostart, UBUNTU with NVIDIA GPU and ``as`` as name. .. code-block:: bash run_docker.sh Setup Perception und Control ---------------------------- #. :ref:`perception-setup` #. :ref:`control-setup` 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/16`` is routed via the ethernet interface only like this: ``169.254.0.0/16 dev enp5s0 scope link metric 1000`` #. If this is not the case, you need to adjust the avahi-config with ``sudo nano /etc/avahi/avahi-daemon.conf`` and your interfaces: .. code-block:: none [...] allow-interfaces=enp5s0 deny-interfaces=docker0 [...] #. Restart the avahi-daemon: .. code-block:: bash sudo systemctl restart avahi-daemon.service #. Your ip routes should look something like this (``ip route show``): .. code-block:: none 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 .. code-block:: bash sudo ip route del 169.254.0.0/16 #. Add new route .. code-block:: bash sudo ip route add 169.254.0.0/16 dev enp5s0 scope link metric 1000 #. Restart the avahi-daemon: .. code-block:: bash 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. Configure Ethernet Interface ---------------------------- Assign a static IPv4 Address for the ethernet interface of the ACU #. Open the Ubuntu settings #. Change to the ``Network`` and open the settings tab for the wired settings #. Open the ``IPv4`` tab and choose ``Manual`` #. Enter ``192.168.201.4`` as Address, ``255.255.255.0`` as Netmask and ``192.168.201.1`` as Gateway 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: .. code-block:: bash 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. .. code-block:: bash ping os-122330002135.local This should now return ``192.168.201.6`` instead of its link-local address. .. note:: For more network information see :ref:`network-table`. 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 ``linuxptp`` using ``apt install linuxptp``. #. Create a Unit file using ``sudo nano /etc/systemd/system/ptp4l.service`` with the following content: .. code-block:: none [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-reload`` #. Enable the service, so it runs on startup using ``sudo systemctl enable ptp4l`` #. Verify the service is running using ``sudo systemctl status ptp4l`` 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: .. code-block:: bash ./utils/vnc.sh #. Install a vnc client on your local machine (Linux: Remmina, Windows: RealVNC) and connect to the ACU via VNC. .. _tutorial: https://ubuntu.com/tutorials/create-a-usb-stick-on-ubuntu#1-overview .. _Ubuntu LTS 20.04: https://releases.ubuntu.com/focal/ .. _CUDA 11.4.2: https://developer.nvidia.com/cuda-11-4-2-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local .. _tensorrt 8.2.3: https://developer.nvidia.com/nvidia-tensorrt-download .. _Foxglove Studio: https://foxglove.dev/download .. _docker post install: https://docs.docker.com/engine/install/linux-postinstall/ .. _NVIDIA docker container toolkit: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html .. _personal access token for bitbucket: https://bitbucket.curemannheim.de/plugins/servlet/access-tokens/manage .. _tigervnc tutorial: https://www.how2shout.com/linux/install-vnc-server-on-ubuntu-20-04-18-04-lts-to-access-gnome/