Skip to content

Configure a robot from scratch

Corrie Van Sice edited this page Feb 17, 2022 · 34 revisions

Install Ubuntu

You will need:

  • a usb key
  • to be located on the UT network

Initial Install from USB Key

Install Ubuntu according to the official instructions. The latest version tested with the bwi stack at the time of writing is Ubuntu 20.04.3 with the 5.13.0-30.33~20.04.1-generic 5.13.19 kernel.

Use Ubuntu LTS releases and don't connect to WiFi for the initial installation.

Create the username bwilab with the correct password, and fill in the appropriate host name. If you need to make up a new one, pick an unused Futurama character.

Do not create user bwi, that is defined via LDAP.

After initial installation completes, remove USB key and reboot.

After reboot, log in as bwilab, update the apt repository and upgrade packages with sudo apt update && apt upgrade -y. You may need to restart your system.

Add Some Useful Ubuntu Packages

Add the Google Chrome and ROS repositores:

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >  /etc/apt/sources.list.d/google.list'

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Install some more packages:

sudo apt-get update
sudo apt-get install emacs gnome-tweak-tool openssh-server terminator vim nano git mercurial sshfs subversion libtbb-dev build-essential

(add vs code to this list)

The latest supported version of ROS is Melodic which works best on Ubuntu 18.04. If using a newer version of Ubuntu, use the bwi-docker image to install ROS. Otherwise, you can install Melodic locally according to the ROS install documentation.

Configure the bwilab account

For "bwilab" to be able to run the robot, it must belong to the "dialout" group:

sudo usermod -a -G dialout bwilab

For the robot to have authorized access to the lab server: build, install, and configure the "bwi_lab" repository. You must be logged in as "bwilab" for this step.

The instructions are here.

Configure smallDNS

Follow the client installation instructions to configure SmallDNS.

Manually Configure Network

Wireless

Find the wireless interface mac address for the interface labelled wlp... in the result of the command ip a. Add the device to the LARG group utexas-iot devices. If you do not know the password for LARG utexas-iot devices, ask a Research Engineer or lab faculty to share the credentials over the UT Stache password manager.

Ethernet

Finally, we may need to manually configure some Ethernet ports, depending on the devices attached.

These are done using the graphical network manager, so it will be easy to switch back to wired Internet connection, if needed.

Segway RMP 110 Base

For the Ethernet-attached Segway bases:

In network manager, "Edit connections...", then select the correct "wired connection". Unfortunately, that may require some trial and error. Try connecting the Ethernet wire first, and see if one of the connections shows up highlighted.

Connection Name: Segway RMP 110
IPv4 Settings: Manual
address: 10.66.171.1
netmask: 255.255.255.0
gateway: <blank>

Select "require IPv4 addressing for this connection to complete".

Hokuyo Laser

For an Ethernet-attached Hokuyo laser:

In network manager, "Edit connections...", then select "wired connection 1".

Connection Name: 192.168.0.X
IPv4 Settings: Manual
address: 192.168.0.1
netmask: 255.255.255.0
gateway: <blank>

Select "require IPv4 addressing for this connection to complete".

For machines with a Velodyne LIDAR attached, configure it on a separate port, following these directions:

Special setup for HDPLEX H1.S motherboard for leela

This motherboard supports multiple displays. It sends boot information to the wrong place unless you do these steps.

Remove Ghost Monitor

When utilizing this compact desktop build, a second ghost monitor may be connected and cause issues logging in.

Check in the Display settings to verify that the ghost monitor is present.

If the ghost monitor is present follow the following steps to remove it:

First, you will need to determine the name for the output of the ghost monitor.

xrandr -q

You will see that there are several outputs which are connected. The HDMI is the one for the monitor being used. Normally, there is another output called eDP-1 which is also connected. You have to note the name of this output.

Then, you will need to edit your grub file.

sudo nano /etc/default/grub

Add the following line to the file in the GRUB_CMDLINE_LINUX line:

GRUB_CMDLINE_LINUX="video=eDP-1:d"

If your output is called like eDP-1-1, set video=eDP-1:d (setting video=eDP-1-1:d won't work).

Then update your grub with the command:

sudo update-grub

and reboot the system.

Setup LDAP Client

LDAP stands for Lightweight Directory Access Protocol. We use it to share user and group identifiers within the lab.

Install Packages

sudo apt-get install libnss-ldapd libpam-ldap nscd

You will be asked some configuration questions. Answer them carefully.

For LDAP: Set the server URI to:

ldap://nixons-head.csres.utexas.edu/bwildapadmin

Make sure it's not “ldapi:”.

Set the server LDAP search base to:

dc=nixons-head,dc=csres,dc=utexas,dc=edu

For libnss-ldapd configuration, select: “group”, “passwd”, and “shadow”.

Set the LDAP version to 3.

Again, set the server URI to:

ldap://nixons-head.csres.utexas.edu/bwildapadmin

And again, set the distinguished name of the search base:

dc=nixons-head,dc=csres,dc=utexas,dc=edu

Make local root Database admin: Yes

Does the LDAP database require login? No

LDAP account for root:

cn=admin,dc=nixons-head,dc=csres,dc=utexas,dc=edu

Set the LDAP root account password to the appropriate value.

If you make a mistake and need to change a value, go through the menu again by issuing this command:

sudo dpkg-reconfigure ldap-auth-config

Configure LDAP

Edit the /etc/ldap.conf file:

sudo vim /etc/ldap.conf

# Make sure local logins still work, even when networking
# is disabled for some reason (e.g. while booting).
timelimit 120
bind_timelimit 120
idle_timelimit 3600
# This leads to a delay of 124 seconds (4+8+16+32+64=124)
# per lookup if the server is not available.
nss_reconnect_tries 5         # no. of times to double the sleep time
nss_reconnect_sleeptime 4     # initial sleep value
nss_reconnect_maxsleeptime 64 # max sleep value to cap at
nss_reconnect_maxconntries 2  # how many tries before sleeping

Make sure there is a final newline at the end.

Edit the /etc/pam.d/common-session file:

sudo vim /etc/pam.d/common-session

Before the "session optional pam_ldap.so" line, add this:

session required    pam_mkhomedir.so skel=/etc/skel umask=0022

This will create a home directory on the client machine when an LDAP user logs in who does not have a home directory.

Restart the service for these changes to be implemented:

sudo /etc/init.d/nscd restart

Test LDAP

Login using your own LDAP user account:

ssh joq@localhost

Give the correct password. Verify the home directory, and group memberships:

$ id
uid=10047(joq) gid=10000(bwi) groups=10000(bwi),20(dialout),27(sudo),10002(fri)

$ pwd

   /home/users/joq

$ ls -l

   -rw-r--r-- 1 joq bwi 8980 Jul 15 18:05 examples.desktop

Or, something similar.

Logout using ^D or exit.

Set up SendMail SMTP Client

This step sets up a diagnostic emailer that allows the robot to state its current status. It is preferable that this is setup and working.

Setup Workspace and CodeBase

This is briefly described in Test Robot Installation section and won't be repeated here.

Run the Configuration Script

Inside your workspace, navigate to the segbot_sensors package. Within the root of this directory will be the script file 'sendmail_configure.sh'.

Execute this in a terminal with:

roscd segbot_sensors
sudo sh sendmail_configure.sh

It will query you for an email and password. This step is required for secure storage of the BWI email credentials -

email: utexas.bwi@gmail.com password: Ask around for this password

Note: ONLY the 'official' BWI gmail account should be entered here, NOT your own personal email.

Test the Sendmail Client

The script will run, possibly taking several minutes. Once completed, you can test the sendmail client to ensure that it has been setup correctly with the following command:

echo "Just testing my sendmail gmail relay" | mail -s "Sendmail Client Test" your.personal.email@company.com

If successful, you should receive an email from the official BWI Gmail account at the email address you replaced with 'your.personal.email@company.com'.

If unsuccessful, please open a github issue.

Test Robot Installation

Create a workspace, then install and build our core software as described here:

https://github.com/utexas-bwi/bwi/blob/master/README.md

Source the workspace, and install our custom UDEV rules:

source ~/catkin_ws/devel/setup.bash
rosrun segbot_bringup udev_install

Then reboot.

After that, login again and run the basic tests, as described here: Segbot Regression Testing

Clone this wiki locally