Oculus Prime - OS and Software Install version 1.1 Ubuntu 20.04

Oculus Prime - OS and Software Install version 1.1 Ubuntu 20.04

The following instructions are for updating Oculus Prime software from versions 0.84 and lower, to versions 1.1 and higher.

You’ll need to plugin a monitor, keyboard and mouse for these steps.

OS INSTALL

Do fresh install of Ubuntu OS:
 -Ubuntu desktop version 20.04 LTS 64-bit
 -Choose fresh install when prompted (ie., erase whatever is on the SSD)
 -Set username to “oculus”
 -with auto login enabled
 -Set hostname to “prime”

After installation, open a terminal and enter:

sudo apt update

Then enter:

sudo apt upgrade

(Upgrade will take a while.)

Then, install various required packages. Enter:

sudo apt install vim x11vnc geany htop git openjdk-11-jdk v4l-utils openssh-server coturn python3-pip net-tools curl espeak expect

And:

sudo adduser oculus dialout

Install Gstreamer components – enter the following:

sudo apt install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libgstreamer*1.0-dev libnice-dev gstreamer1.0-nice libjson-glib-dev libsoup2.4-dev

pip3 install websockets

INSTALL ROS

Follow ROS1 Noetic ‘desktop full install’ instructions here

To install required ROS packages, enter:

sudo apt install ros-noetic-move-base ros-noetic-map-server ros-noetic-amcl ros-noetic-dwa-local-planner ros-noetic-gmapping ros-noetic-usb-cam ros-noetic-depthimage-to-laserscan

To setup a ROS workspace and install the noetic oculusprime_ros package from source, enter each line below in order:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws/
catkin_make
cd ~/catkin_ws/src
git clone --branch noetic https://github.com/xaxxontech/oculusprime_ros.git
cd ~/catkin_ws/
catkin_make
echo "source $HOME/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

Add Astra camera ROS package to your catkin workspace, and compile, using instructions here: wiki.ros.org/astra_camera

(When 1st installing Astra dependencies as per instructions, ignore 'ros-noetic-libuvc' package not found error, seems that is isn’t required)


INSTALL OCULUS PRIME JAVA

Download the latest Oculus Prime Java from here
Unpack it into the home folder: /home/oculus/

Enable the headless wifi manager on startup -
as root user create the file /etc/rc.local with the following contents:

#!/bin/sh -e
# rc.local script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
/home/oculus/oculusPrime/access_point_manager/run &
exit 0

Make executable by entering:

sudo chmod +x /etc/rc.local

Enable regular user access to reboot and shutdown commands – enter:

sudo visudo

Add the following line, then save the file:

ALL ALL=NOPASSWD: /sbin/reboot,/sbin/shutdown

To auto-start Oculusprime Java, go to desktop GUI > applications > Startup Applications
add new item with the following command entry:

/bin/bash -i /home/oculus/oculusPrime/oculusprime.sh


ENABLE VNC

On some systems, VNC won’t work without a monitor plugged in, so adding a dummy monitor is required for VNC access during normal robot use. Download the package by entering:

sudo apt install xserver-xorg-video-dummy

Then create+edit the file /etc/X11/xorg.conf with the following contents:

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
EndSection
Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection
Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1024x800"
    EndSubSection
EndSection

After reboot, you should be able to run a VNC session at any time with the command:

x11vnc -xauth /var/lib/gdb/:0.Xauth -display :0 -forever -shared &

NOTE: This will disable functionality for actual plugged-in monitors. To re-enable it, delete or rename the /etc/X11/xorg.conf file.


DISABLE UPDATES AND SLEEP

To help with smooth operation without keyboard and monitor attached, in the desktop GUI make the following changes to disable automatic updates and power saving features:

desktop GUI > software and updates > disable all update checking/never
desktop GUI > settings > notifications > do not disturb
desktop GUI > settings > power > disable all power saving options
desktop GUI > settings > privacy > lock screen all off

DONE

That’s it! Disconnect the monitor and keyboard. After reboot, the robot will (hopefully) come up with full software functionality.