--- # Jekyll, my lord, please process this page :) --- AAIR Lab --- # Jekyll, my lord, please process this page :) ---

CS 571: Artificial Intelligence

Fall 2019: Homework 0

Due on September 03, 2019 - 11:59 pm


Welcome to CSE 571: Artificial Intelligence. Throughout this course we will use Robot Operating System(ROS) for our programming projects.

ROS is an open-source, meta-operating system for the robots. It provides the services one would expect from an operating system including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management. It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers.

For this homework and course you will need to install and configure ROS on your computer. We will be using ROS Kinetic throughout the course which requires Ubuntu 16.04 LTS. You can also use VM to install Ubuntu on your computer.

Requirements

  1. Ubuntu 16.04

    We have created assignments on Ubuntu 16.04, hence for compatibility issues we need you to work on the same version of Ubuntu. You can use either of the two following options:

    1. Install Ubuntu on PC: You can download Ubutnu from here: http://releases.ubuntu.com/16.04/.
      Learn how to install Ubuntu at https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop-1604.
      If you are looking to install Ubuntu on UEFI systems, you can get help at https://help.ubuntu.com/community/UEFI.

    2. Use Ubuntu on virtual machine: You can use applications like VirtualBox to create a virtual machine. Some relevant tutorials are:
      1. How to create a new VM?
      2. How to import an existing VM?
      We recommend installing Ubuntu on your system (this can be done alongside Windows) as running virtual machine is generally slower than using Ubuntu installed on your system.

      Supported Virtual Machine Softwares (Hypervisors)

      Virtual Machine Image
      If installing Ubuntu is not an option for you, or you have trouble installing it, we are providing the Virtual Machine Image which can be imported directly to Virtualbox or VMware Workstation/Fusion. You have to use your ASUrite credentials to access the image. Please use your ASU email when prompted for email.

      Tutorial for importing the image can be found here: Importing the VM

  2. ROS Kinetic

    You can use the instructions to install Ubuntu given at http://wiki.ros.org/kinetic/Installation/Ubuntu.
    If you are new to ROS and Ubuntu, you can do a full install of ROS. to do this, use the following command at step 1.4 in the installation instructions:

    sudo apt-get install ros-kinetic-desktop-full

  3. ROS Tutorials

    Do the beginner level ROS Tutorials (Python version only) which are available at http://wiki.ros.org/ROS/Tutorials. This includes tutorials for installing and configuring ROS. For this assignment install and configure ROS and go over beginner’s tutorials for python to make yourself familier with ROS. After this homerwork, students should be able to write simple service-client functionalities and simple subscriber-publisher on their own.

Setting Up Turtlebot3

Once you install ROS, you will need to set up Turtlebot3 with Gazebo simulator. If you have installed ROS successfully, Gazebo should already be installed. To set up the Turtlebot3, you will need to first initialize the catkin workspace.

You can follow the instructions given at http://wiki.ros.org/catkin/Tutorials/create_a_workspace. To set up Turtlebot3 in Gazebo, Follow the following steps:

  1. You will need to first clone the turtlebot3_msgs module for Turtlebot3. You can find this on https://github.com/ROBOTIS-GIT/turtlebot3_msgs. You will need to clone this repository and place at catkin_ws/src. The commands to do this are:

    cd ~/catkin_ws/src
    git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git

  2. Now you will need to clone mandatory modules to use Turtlebot3 with ROS. You can find this on https://github.com/ROBOTIS-GIT/turtlebot3. You will need to clone this repsoitory to same place at catkin_ws/src. The commands to do this are:

    cd ~/catkin_ws/src
    git clone https://github.com/ROBOTIS-GIT/turtlebot3.git

  3. The last step is to clone the Turtlebot3 simulators which you can obtain at https://github.com/ROBOTIS-GIT/turtlebot3_simulations. The commands to do this are:

    cd ~/catkin_ws/src
    git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
Once you clone everything move to your catkin_ws and execute command catkin_make to build all the modules.

cd ~/catkin_ws
catkin_make

Now you are ready to use Turtlebot3 with Gazebo. Do the tutorials on Turtlebot3 simulator with Gazebo at http://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/.
A more comprehensive resource to learn about Turtlebot is http://emanual.robotis.com/docs/en/platform/turtlebot3/learn/

Using Turtlebot3

To load the environment, you need to do the following:

  1. Source setup.bash file.

    source ~/catkin_ws/devel/setup.bash

    This has to be done every time you open a new terminal as setup.bash holds important environment variables. This also has use in overlaying multiple workspaces, which you may ignore as of now.

  2. Set TurtleBot model. You have to set one of the three TurtleBot3 models: burger, waffle, or waffle_pi. Lets set it to burger for this demo.

    export TURTLEBOT3_MODEL=burger

    This step also needs to be executed every time you start a new terminal.

  3. Launching a turtlebot environment.

    roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch

    You should be able to see the following screen in Gazebo after executing this command:

    Turtlebot3 Gazebo Init

  4. Teleoperation on Gazebo can be performed using the following command. Run this in a new terminal, and don’t forget to perform steps 1 and 2 in this new terminal.

    roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

    You should now see a prompt where you can use the keys w, a, s, d, x to control the turtlebot. Here is what your terminal will look like after pressing w, w, w keys:

    Turtlebot3 Teleoperation Demo

    And you’ll notice that turtlebot has started moving in the forward direction (along the axis represented by red line in the environment).

    Turtlebot3 Teleoperation Gazebo Demo
To use other environments, you must use the correct launch files. For example, to launch the "Turtlebot3 House" environment you should use the following command:

roslaunch turtlebot3_gazebo turtlebot3_house.launch


Tip

If you do not want to execute steps 1 and 2 every time, you can add those commands in your bashrc file.

gedit ~/.bashrc

Add the two commands at the end of your bashrc file and save it.

Modifying bashrc

After this you just need to source the bashrc file once.

source ~/.bashrc

Play around with the turtlebot and try various environments given in the turtlebot tutorial at http://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/.

Now you are ready for your first homework task.

Tasks

Assignment tasks are available at ASU Canvas for the students registered in this course.