Installing Ubuntu
Orangepi5_1.1.0_ubuntu_focal_desktop_xfce_linux5.10.110.img
file it gives us.Flashing to a micro SD card
Open up balenaEtcher and flash the image to a microSD card (you’ll need to connect the card to your computer)
Plug in your microSD card, hook it up to a keyboard, mouse, and monitor, plug in an ethernet cable too (that goes to your router) and you should be running.
To ssh in you’re going to have to angry ip scan and just keep trying the following ssh <IP_address>
. Username root
password orangepi
mkdir northstar
. This should create a new folder called northstar
and from here we wanna type and enter in cd northstar
which puts us in the folder (any commands we run will take effect in this specific folder).touch [setup.s](<http://setup.sh>)h
. nano setup.sh
copy paste in the script below, then press ctrl x + enter to exit nano, and then type in chmod +x setup.sh
to give the script executable permissions. To run the setup script run ./setup.sh
and let it run.#!/bin/bash
# This script should go through and install all the necessary dependencies to run northstar
# - Only tested for Ubuntu 20.04 Jammy on orangepi (<https://drive.google.com/file/d/1DChrpQCxbkUSQQ5oENnioH6RkrypqWry/view?usp=share_link>)
# Update
sudo apt update
sudo apt upgrade
# OpenCV/build dependencies
sudo apt install cmake build-essential pkg-config libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev gfortran openexr libatlas-base-dev python3-dev python3-numpy python3-pip
# Remove local libpng
# If you don't do this, the build of OpenCV will fail for some reason
sudo rm /usr/lib/libpng*
# GStreamer install
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
# Python deps
pip3 install Pillow
# Need to use this specific version otherwise GStreamer pipeline fails
pip3 install --find-links <https://tortall.net/~robotpy/wheels/2023/raspbian/> pyntcore==2023.2.1.2
pip3 install --find-links <https://tortall.net/~robotpy/wheels/2023/raspbian/> robotpy-wpimath==2023.4.2.1
# Build OpenCV
git clone '<https://github.com/opencv/opencv>'
git clone '<https://github.com/opencv/opencv_contrib>'
cd opencv_contrib
git checkout 4.6.0
cd ../opencv
git checkout 4.6.0
mkdir build
cd build
# Install CMake
sudo apt install cmake
# Run CMake build
cmake -D PYTHON_EXECUTABLE=/usr/bin/python3 -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_opencv_python3=ON -D HAVE_opencv_python3=ON -D OPENCV_EXTRA_MODULES_PATH=/root/northstar/opencv_contrib/modules -DBUILD_LIST=aruco,python3,videoio -D ENABLE_LTO=ON ..
make -j8
sudo make install
# Use BIG cores
echo 'for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo performance > $f; done' >> /etc/rc.local
After you’ve run the following script, you want to clone the following repo in /root/northstar
.
git clone [<https://github.com/Mechanical-Advantage/AdvantageKit.git>](<https://github.com/Mechanical-Advantage/AdvantageKit.git>)
git checkout ns-dev-multitag
config.json
to match your team’s roboRIO IP (10.40.99.2) and change the name so it doesn’t match all the other instances of northstar.Now you want to add northstar as a service. Enter in nano /etc/systemd/service/northstar.service
and copy paste in the following service file.
[Unit]
Description=Northstar AprilTag Detection System
[Service]
User=root
WorkingDirectory=/root/northstar/AdvantageKit/akit/py/northstar/
ExecStart=python3 __init__.py
Restart=always
[Install]
WantedBy=multi-user.target
Then type in systemctl enable northstar
to get northstar up and running.
Finally, once you’ve confirmed northstar is working, you want to assign a static ip to the orange pi.
nano /etc/netplan/99_config.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 10.40.99.<X>/24
routes:
- to: default
via: 10.40.99.1
nameservers:
search: [mydomain, otherdomain]
addresses: [10.10.10.1, 1.1.1.1]
sudo netplan apply
and then you’re set 👍