Skip to content

550 Baldwin Dual boot OCC Computer Lab Instructions

Catharine McGhan edited this page Nov 23, 2019 · 18 revisions

Table of Contents

Logging into Linux (a.k.a. Getting into the Ubuntu Linux O/S)

Step 1: Get the computer into a power-off state

  • Move the mouse to get the monitor to turn on / come out of sleep mode.
  • If the screen comes up showing the normal Windows 10 splash screen (and it probably will):
    • If no-one is logged in, just press the power button. (e.g., press the power button on the front of the machine in for a half-second or so and let go). The screen should turn blue and say "Shutting down". Let it do that.
    • If someone is logged in, press and hold the power button until the computer turns off (i.e., the screen goes black and the computer turns off / powers down -- the LED light of the power button should be completely off, not blinking with white light every second or so or anything else).
    • If the screen stays black even after moving the mouse around, the computer should already be off (i.e., the LED light of the power button is completely off, not blinking with white light every second or so or anything else).

Step 2: Get from a powered-down machine into Ubuntu 18.04 Linux

  • Press the power button on the front of the machine to turn the computer on.
  • The Dell logo should come up. Wait for a red screen to appear. (This should come up in a little over 15 seconds after you hit the power button.)
  • On this red screen, there should be a list. Quickly press the up arrow on the keyboard at least once. (This turns off the timeout that would automatically boot the computer into Windows 10 using the "Windows Boot Manager (on /dev/sda2)".)
  • Use the arrow keys to Select the "Ubuntu" option at the top of the list on the red (grub) screen and hit enter.
  • Wait for the Ubuntu 18.04 operating system (O/S) to load. (This should happen in a little over 10 seconds or so.)

Step 3: Log into Ubuntu 18.04 Linux

  • You should see a dark purple splash screen that says "ubuntu" at the bottom of it. There should be a box with "Username:" listed above it.
  • If you have just gotten done booting the computer into Ubuntu, wait about 2 minutes before trying to log in for the first time.
    • This is because it takes awhile for the networking to finish connecting out to the university servers properly to allow for login.
  • Once two minutes has passed, log in to the machine using your 6+2 login as you normally would in any computer lab. (The desktop should appear in a little over 10 seconds after login.)

"Miscellaneous login stuff"

  • If you want to be able to print from this machine, then in the popup that comes up when you first log in, type in your 6+2 and password. (The print program has a distinctive green boxy 'p'-looking icon.) Once logged in, this should show your print balance in the upper-right-hand corner of the screen.
  • If you want to view these instructions on the desktop machine, double-click on the big question mark icon in the upper-left corner of the desktop that has the text "Configuration Instructions". (This will automatically open a Firefox tab with this webpage on it.)

Doing cool things using ROS!

Just trying out ROS and Gazebo and moving a rover around!

  • Open three tabs in the terminal (i.e., type Ctrl-Alt-T and then type Ctrl-Shift-T two times).
  • In the first tab, type the following:
 source /opt/ros/melodic/setup.bash
 roscore
  • In the second tab, type the following:
 source /opt/ros/melodic/setup.bash
 export TURTLEBOT3_MODEL=burger
 roslaunch turtlebot3_gazebo turtlebot3_world.launch
    • This will open up the Gazebo simulation environment and give you a top-down view. Click back to the terminal if you need to (i.e., left-click on the black icon on the left toolbar with a '>_' in grey inside it).
  • In the third tab, type the following:
 source /opt/ros/melodic/setup.bash
 export TURTLEBOT3_MODEL=burger
 roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch


  • Play around with maneuvering the turtlebot around using the wasdx keys!
    • Note that you need to do this with this third tab of the terminal window as the active window at the forefront of the screen, or the commands won't register to the turtlebot_teleop control program.
    • Note that it may be easier to move the turtlebot around by doing a 'move forwards' (w) or 'move backwards' (x) command, stopping it in place (by hitting the s key), and then doing a 'turn left' or 'turn right' command to turn in place for awhile, then stop it in place again (by hitting the s key), and then performing another 'move forwards' (w) or 'move backwards' (x) command again.
      • In other words, just hit the w, a, d, or x keys multiple times to get the robot up to the speed that you want, let it move forward/back or turn in place clockwise/counterclockwise for awhile until you hit the distance/angle that you want, and then hit the s key to stop it and then enter in the new speed command! :)

  • Press Ctrl-C in the third tab window when you are done with the teleoperation command.
    • If you want to try other methods of moving the Turtlebot3 burger around, see: http://emanual.robotis.com/docs/en/platform/turtlebot3/basic_examples/#basic-examples
    • If you want to try out the Turtlebot3 Wafflebot instead, type Ctrl-C into the second tab (you may have to type it twice and wait a few seconds for Gazebo to close/stop on its own), and then re-run the commands in the second and third tabs of the terminal window, but substitute burger for waffle in the export TURTLEBOT3_MODEL= lines.

  • When you are completely done with playing around with the rover / ROS, type Ctrl-C into every tab in that terminal that is open, then close the terminal window. (This will cleanly shut down Gazebo and also the ROS communications server / roscore.)

Logging out of Linux and/or Restarting the machine into Windows 10 when you're done!

  • To log out of the desktop, but the leave the computer in the Linux O/S:
    • Click on the white power icon in the top right corner of the screen.
    • Move the mouse down to your name and click on it.
    • Click "Log Out".
  • If you want to be nice to the next person who doesn't need to use Linux, and restart the computer into Windows 10 for them instead:
    • Click on the white power icon in the top right corner of the screen.
    • Move the mouse down to the power icon inside the menu at the lower right and click on it.
    • Click "Restart" in the dialog box that pops up next. (Yes, that's all you have to do. The computer will automatically restart itself and load up Windows 10 even if you don't do anything else! :)









Code development on the lab machines using ROS with catkin/catkin_make!

First-time instructions for setting up your home space for ROS source code development

  • Type Ctrl-Alt-T to open a terminal window.
    • (You can type ls to see the files and folders of your home directory at this point.)
  • For now, we will work in your homespace. Note that files stored here will be saved to that specific local computer and will be deleted after the next refresh. (We are currently working to get the CEAS_FILESPACE directory set up to allow catkin_make compilation to work properly inside it.)
  • Now, we will set up your catkin workspace for ROS use for the first time. Type the following into the console:
 source /opt/ros/melodic/setup.bash
 mkdir -p catkin_ws/src
 cd catkin_ws
 catkin_make
  • This sets up your workspace for ROS development!

"First-time logging into this particular computer" instructions (and/or "I need to change the catkin workspace that I'm using" instructions) for ROS source code development

  • If you need to, set up a catkin workspace following the instructions above.
  • Next, we need to tell the computer where it should always look for ROS and your particular workspace automatically, every time you open a terminal window. Note that you will need to perform this step every time you log in to a new machine!
  • Type this command at the console:
 gedit ~/.bashrc &
  • This should open a text editor window (gedit).
  • Scroll down to the bottom of this file (around line 117).
  • If you don't see the following lines in the file, add them to the very bottom of the file:
 source /opt/ros/melodic/setup.bash
 source /home/$USER/catkin_ws/devel/setup.bash
    • Note that if you need to use a different workspace, that you will need to change the second line given here to the appropriate catkin workspace directory. (If you don't know what we're talking about here, just type the above and don't worry about it :)
  • Save the file (i.e., type Ctrl-S or click the 'Save' button in the upper-right of the text editor screen, just below the title bar that reads ".bashrc").
  • Close the file (click on the red 'x' in the upper-right corner of the window).
  • In the terminal, open a new tab (type Ctrl-Shift-T). (This gives you a terminal with the proper ROS source'ing already done for you, so that you don't need to type in those commands yourself every time that you open a new terminal window!)
  • cd into your catkin workspace, and go from there! :)

ROS Gazebo Navigation with Turtlebot 3 platform

Here, I am using / recommending the following tutorial pages:

There is also Autorace with Gazebo:

Required ROS Package note on slam-gmapping:

Note that most of the 550 Baldwin computers currently do not have ros-melodic-slam-gmapping installed (oops!). If you want to still get this working, you'll have to git clone the repositories to your local catkin_ws folder and compile them locally to get this to work.

source /opt/ros/melodic/setup.bash
cd $HOME
mkdir -p catkin_ws_gmapping/src
cd catkin_ws_gmapping
catkin_make
cd src
git clone https://github.com/ros-perception/slam_gmapping
git clone https://github.com/ros-perception/openslam_gmapping
cd ..
catkin_make
catkin_make

Then, when you run the SLAM stuff in terminal 2 later, you will need to type: In terminal 2:

source /opt/ros/melodic/setup.bash
source $HOME/catkin_ws_gmapping/devel/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
where you add in the additional source line to include the new packages! :)

If you are working on your own machine, however, you can install this via:

sudo apt install ros-melodic-slam-gmapping

Some keystrokes / commands that you may find helpful:

  • Ctrl-C for copying highlighted text in browser window(s) and gedit
  • Ctrl-V for pasting text in browser window(s) and gedit
  • Ctrl-S for saving a file in gedit
  • Ctrl-Shift-C for copying highlighted text from a terminal window
  • Ctrl-Shift-V for pasting text into a terminal window
  • Ctrl-C in a terminal window to stop a ROS node or Gazebo or some other program in the middle of when it is running
If you want to see your current environment variables for any terminal, type:
env
at the command line. Things like $HOME reference/use/insert the environment variable into the string for you in bash (at the bash command line) automatically.

The source /opt/ros/melodic/setup.bash line tells the operating system where the ROS libraries are. Alternately, you can write this at the bottom of your .bashrc file (gedit $HOME.bashrc) so that every time you open a terminal window, this line runs for you automatically. (Currently, if you do this on the lab machines, you will need to add it again when you sit down at a machine that you haven't logged into and done this on before.)

Now, on to the main event! Making a SLAM map and Navigation!

For Navigation (with SLAM used by the robot), in one terminal window, you first need a map of the space, so run the SLAM tutorial first to help generate the map that the navigation run can use:

In terminal 1:

source /opt/ros/melodic/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_gazebo turtlebot3_world.launch

In terminal 2:

source /opt/ros/melodic/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping

In terminal 3:

source /opt/ros/melodic/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

Keep terminal 3 at the forefront and use the keyboard to control the turtlebot rover, moving it around the simulated area/room.

Then, once you think the turtlebot's got a good map of the room...

In terminal 4:

source /opt/ros/melodic/setup.bash
rosrun map_server map_saver -f ~/map

This saves the map generated during your run as two files (map.yaml and map.pgm) that you can use later with the navigation tutorial/nodes below.

Then, to try out the turtlebot navigation nodes, shut down everything above first, then run the following:

In terminal 1:

source /opt/ros/melodic/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_gazebo turtlebot3_world.launch

In terminal 2:

source /opt/ros/melodic/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

Note that you'll need to set the initial position of the rover and then the destination point in the Rviz window. Step-by-step instructions on how to do this are here:

(But basically, you are clicking on the "2D Pose Estimate" button at the top of the RViz window, handle that, then click on the "2D Nav Goal" button at the top of the RViz window and do the same.)

More later!

Stay tuned for more instructions! :)

Installation stuff beyond basic Ubuntu package install

If you want to install the same packages that are on the 550 Baldwin computers on your own dual-boot machine, copy the below script into a file and run it locally under your Ubuntu 18.04 install. Open gedit (via the gedit __ & line below), copy the lines over, save the file, then run the chmod and ./ (script run) lines and follow the instructions as-given.

gedit install550Baldwinpackages.sh &
chmod +x install550Baldwinpackages.sh
./install550Baldwinpackages.sh

Here is the script to Ctrl-C Ctrl-V (copy and paste) over, save (Ctrl-S), and then run at the commandline:

#!/bin/bash -e

#
# for Ubuntu 18.04.2 LTS + ROS melodic + Gazebo 9
# (this is the basics, I'll send more later)
# 

sudo apt-get -y update
sudo apt install wget curl
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get -y update
sudo apt install ros-melodic-desktop-full
# if rosdep sources file list has -not- already been initialized:
if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then # rosdep init this
    sudo rosdep init
    rosdep update
fi
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

sudo apt install gnome-terminal
sudo apt install ros-melodic-rosbridge-server

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get -y update
sudo apt install gazebo9 libgazebo9-dev

mkdir -p ~/initdeps/rosbridgeclient
cd ~/initdeps/rosbridgeclient
git clone "https://github.com/Lawouach/WebSocket-for-Python.git"
cd "WebSocket-for-Python"
sudo python setup.py install

# for local p3dx code compile under catkin workspace, will need:
sudo apt install ros-melodic-controller-manager-tests ros-melodic-ros-controllers
sudo apt install ros-melodic-gazebo-ros-control

# for local turtlebot2 / turtlebot3 code compile under catkin workspace, will need:
sudo apt install ros-melodic-joy libboost-python-dev
sudo apt install ros-melodic-openni2-launch ros-melodic-ecl-core
sudo apt install ros-melodic-kobuki-msgs ros-melodic-yujin-ocs ros-melodic-yocs-msgs
sudo apt install ros-melodic-ar-track-alvar ros-melodic-base-local-planner ros-melodic-move-base-msgs ros-melodic-kobuki-dock-drive
sudo apt install ros-melodic-ecl-mobile-robot
sudo apt install ros-melodic-moveit
sudo apt install ros-melodic-ros-control ros-melodic-ros-controllers
sudo apt install ros-melodic-gazebo-ros ros-melodic-gazebo-ros-control

# for local turtlebot3 code compile under catkin workspace, will need:
sudo apt install ros-melodic-turtlebot3 ros-melodic-turtlebot3-msgs ros-melodic-turtlebot3-simulations ros-melodic-turtlebot3-applications ros-melodic-turtlebot3-autorace ros-melodic-turtlebot3-description ros-melodic-turtlebot3-gazebo ros-melodic-hls-lfcd-lds-driver ros-melodic-open-manipulator ros-melodic-dynamixel-sdk

# for local hector_quadrotor code compile under catkin workspace, will need: (...plus potentially more later...)
sudo apt install  ros-melodic-hector-gazebo ros-melodic-hector-models
#sudo apt install ros-melodic-hector-localization ros-melodic-hector-slam # don't seem to exist anymore
sudo apt install ros-melodic-joystick-drivers ros-melodic-teleop-twist-keyboard
sudo apt install ros-melodic-geographic-msgs ros-melodic-hardware-interface ros-melodic-ros-control
#sudo apt install ros-melodic-gazebo-ros-control # installed prior

#
# This should hopefully work to install most of the baseline stuff people will need.
#

# open general things
sudo apt install geany spyder gedit gnome-terminal
sudo apt install python3-venv python3-pip python3-tk
sudo pip install numpy scipy matplotlib opencv-python
sudo apt install jupyter
sudo apt install python-sklearn python3-sklearn
sudo apt install octave
sudo apt install libompl-dev ompl-demos ros-melodic-ompl
# installing opencv
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python3-dev
sudo apt install python-opencv python3-opencv

# installing glpk and cvxopt
sudo apt install python-numpy python-pyparsing python-scipy python-cvxopt python-networkx python-numpy-doc python-matplotlib python-matplotlib-data python-matplotlib-doc python-pydot graphviz graphviz-doc python-pygraphviz
sudo apt install python-networkx
sudo apt install python-dev build-essential python-pip python-pandas python-sympy python-nose libblas-dev liblapack-dev gfortran glpk-utils libglpk-dev swig libgmp3-dev
# note, ipython ipython-notebook are old and currently conflict with jupyter notebook, so don't add this for 18.04 and beyond
sudo apt install python3-numpy python3-pyparsing python3-scipy python3-cvxopt python3-networkx python3-matplotlib python3-pydot python3-pygraphviz
sudo apt install python3-networkx
sudo apt install python-dev build-essential python-pip python-pandas python-sympy python-nose libblas-dev liblapack-dev gfortran glpk-utils libglpk-dev swig libgmp3-dev
sudo apt install python3-dev python3-pip python3-pandas python3-sympy python3-nose
sudo apt install python-ply python3-ply
sudo apt install libglpk-dev
sudo apt install bison flex
sudo apt install default-jre
sudo apt install python-cvxopt python3-cvxopt

### ***NOTE: NOT ON EVERY MACHINE IN 550 BALDWIN YET, BUT NEEDS TO BE ADDED TO SUPPORT TURTLEBOT3 SLAM MAPPING!
sudo apt install ros-melodic-slam-gmapping

### end of script ###

Also, Matlab for Linux was installed as well!

(note that some of the above came from: https://solarianprogrammer.com/2018/04/25/install-numpy-scipy-matplotlib-opencv-python-ubuntu/ and https://www.pyimagesearch.com/2018/05/28/ubuntu-18-04-how-to-install-opencv/ and https://linuxize.com/post/how-to-install-opencv-on-ubuntu-18-04/ and my own (stripped down) vagrant-rss stuff from before, as usual :) )

Remote login to University resources (and potentially the Linux computers!)

Go to this website for instructions on downloading and installing the Cisco VPN client (there is one for Windows, Mac OSX, and Linux): https://kb.uc.edu/KBArticles/VPN-InstallandUse.aspx

Run this client if you want to be able to access anything online as if you are sitting on-campus with an on-campus IP address! (This includes library searches and things like journal articles online from Google search).

If yo want to log in to a dual-boot computer in the lab remotely, you will first need to shutdown and restart that computer into Linux (I recommend you do this in the back of the classroom at the end of the day). You'll also need to log in and run "ifconfig -a" to get the IP address for that particular computer, so that you know what you're trying to connect to. Note that this only works for one day, since the lab machines in 550 Baldwin will reboot into Windows sometime in the wee hours of the morning, between 3am-5am. The computers need to be logged into Linux to allow for this remote access.

Then you need a campus IP address for your computer (that you're using remotely) to log in remotely to the campus machine. Run the VPN client if you aren't in one of the campus dorms to give yourself a campus IP address. (The VPN will route all your internet traffic through the university, so things will load a bit slower, but now you can actually access things.)

Then you need to run a termimal (ssh client) and potentially also a X-Window interface so you can see GUI windows.

Run XMing, set up PuTTY to allow X-Forwarding, log into the system using PuTTY and your 6+2, and then you're all set!

Alternately, you can install the Ubuntu app under Windows 10, and get it working to the point of showing GUI window and allowing ssh, but there is some additional setup you need to do, to do that. See: https://github.com/AS4SR/general_info/wiki/Instructions-for-installing-ROS-and-Gazebo and scroll down to **Note for Windows 10 machines (only if you don't care about ROS working!)...**! (This will get ssh working, but you currently can't get ROS working properly under the Windows subsystem for Linux yet, due to odd issues/interactions between the networking and ROS messaging code.)

If you're using Mac OSX or Linux, you will need to install ssh locally. (You can probably use the same package names as Ubuntu Linux).

The command you run at the terminal window to log in remotely if you're using a native ssh client at a terminal is going to look something like:

ssh -Y your6plus2@the.ip.address.here
or
ssh -X your6plus2@the.ip.address.here
for example:
ssh -Y darlinjh@10.52.5.43

One in, do what you want. To log out and close the session, type:

exit
at the terminal.
Clone this wiki locally