Homework 1 - Robot Operating System (ROS)

Due at 11:00 pm on Tuesday 07 February 2017

As discussed in class, we will be using the Robot Operating System (ROS) in the course this semester. ROS has numerous features to aid users in the development of their robot software. However, these features take some time to learn. The point of this homework is to take you through some tutorial exercises to help you learn some of the basic features of ROS. Note, however, that you will not be programming any robots in this homework.

Computer Resources Note

Note that you may use CSN computers to complete this assignment or you may use your own computer. If you choose to use your own computer, you will need to run Linux (Ubuntu 14.04 is known to work for this) and install ROS Indigo (following the ROS Indigo Installation Instructions) before completing these exercises or use a virtual machine with Linux and ROS Indigo (such as the one prepared by Nootrix).

As of this assignment date, the only CSN computers that are available to run ROS are the six "GPEL" computers in DEH 115. (GPEL is an anachronistic acronym that stands for "General Purpose Engineering Lab" and hearkens back to the days when the School of Computer Science was housed in the Engineering Lab building.) These are the only Linux computers in DEH 115. The other computers in that lab are Windows and Mac machines that will not work for this lab.

Unfortunately for us, the CSN computers in DEH 115 are running Ubuntu 16.04 rather than 14.04 but the ROS Indigo packages we're using are prepared for 14.04. So, CSN system administrator James Cassidy has created a workaround for us. He has a Docker file with Ubuntu 14.04 and ROS Indigo that you can use for this assignment. Simply follow the instructions below.

ROS Docker Instructions

  1. Download the Ubuntu 14.04/ROS Indigo Dockerfile, save it, and unzip it.
  2. Open up a terminal, cd to the unzipped rosdocked-master directory, and build your Ubuntu 14.04/ROS Indigo image by typing ./build.sh ros in the terminal.
  3. Wait. Seriously, the build process will not be fast, so do something else while it happens—work on other assignments, lock your screen and go for a stroll around campus, whatever. Fortunately, you only have to do this step once. (Or, maybe twice. *sigh* But we'll cross that bridge when we come to it.) Unfortunately, given the current setup, you will need to go through the build process once for each machine you use. And, if I'm not mistaken, you'll need to build it using a different image name on each different machine. So, you might tell it to ./build.sh ros8 when you're using gpel8 and ./build.sh ros9 when you're using gpel9, etc. Unfortunately, I was wrong. Not only do you have to use a unique image name on every different gpel machine you use, you also need to use an image name that is unique with respect to every other image name used by every other Docker user. So, I recommend using your 4x4 in your image name. For example, I might call my image ros_houg8802_8 for my image on gpel8. Also, if you downloaded the Dockerfile before Monday afternoon, your copy probably doesn't contain instructions for including the TurtleBot libraries that you'll need, so download the new zip file and start the build process again for any machine you had already built on with the old zip file.
  4. Now that the image has been built, you can access it by typing ./run.sh ros (or ./run.sh ros_houg8802_8 if you built it using ./build.sh ros_houg8802_8, etc.) in the directory in which it was built. Since you'll need to do this in any terminal in which you want to run ROS and the tutorials have you opening roughly a million terminals (that may be a slight exaggeration; still you'll need to open many terminals), I suggest that you create an alias for running this shell script in your run commands (.*rc) file or create a similar shortcut for yourself.

I am hoping that James will have the eight CSN workstations in Felgar Hall 300 online and ready for us to use soon. These machines will run Ubuntu 14.04 and have ROS (and Gazebo) ready for us to use without the Docker hassle. Unfortunately, I have no estimated time line from James on when he will have these machines ready for us.

The Assignment

Work through the ROS tutorials, completing the following exercises as you go. As you complete these exercises and add items to your completed assignment, number them to correspond to the numbering below (e.g., the modified run commands file will be answer 1.1, the return value of echo $ROS_PACKAGE_PATH would be answer 3.1). Note that not all exercises will result in answers being added to your completed assignment.

  1. Set up your environment such that the correct ROS run commands are sourced in your run commands (.*rc) file by your shell on startup. If you are using bash under Ubuntu, with a standard install, you may follow the directions in Step 1.6 of the ROS Indigo installation instructions for Ubuntu directly. Otherwise, you will need to adapt these instructions slightly.
    1. Add your modified run commands file to your completed assignment.
  2. Work through the tutorial on installing and configuring your ROS environment following the option for catkin.
    1. Add the output of export | grep ROS to your completed assignment.
    2. Add the output of catkin_make to your completed assignment.
  3. Work through the tutorial on navigating the ROS filesystem following the option for catkin. (Note that on all remaining tutorials for which there are options for catkin or rosbuild, you should follow the catkin option.)
    1. Add the output of echo $ROS_PACKAGE_PATH to your completed assignment.
  4. Work through the tutorial on creating a ROS package.
    1. Add your customized final package.xml file to your completed assignment.
  5. Work through the tutorial of building a ROS package.
    1. Add the output of catkin_make to your completed assignment.
  6. Work through the tutorial on understanding ROS nodes. (On the CSN Linux boxes you may skip Step 1.1 Prerequisites because the simulator has already been installed.)
    1. Do a screen capture of the window that appears when you enter rosrun turtlesim turtlesim_node and add this to your completed assignment.
    2. Add the output of rosnode list (after renaming) to your completed assignment.
  7. Work through the tutorial on understanding ROS topics. (Again, on the CSN Linux boxes you may skip the installation steps as rqt_graph has already been installed.)
    1. Do a screen capture of the window that appears when you enter rqt_graph in Step 1.2.1 and add this to your completed assignment.
    2. Do a screen capture of the rqt_plot window after you select to plot /turtle1/pose/x and /turtle1/pose/y and add this to your completed assignment.
  8. Work through the tutorial on understanding ROS services and parameters.
    1. Do a screen capture of the TurtleSim window when you enter rosparam set background_r 150 and rosservice call clear and add this to your completed assignment.
  9. Work through the tutorial on using rqt_console and roslaunch.
    1. Do a screen capture of your rqt_console window when you enter rosrun turtlesim turtlesim_node and add this to your completed assignment.
    2. Do a screen capture of your rqt_logger_level window when you enter rosrun turtlesim turtlesim_node and add this to your completed assignment.
    3. Do a screen capture of your rqt_graph window when you enter roslaunch beginner_tutorials turtlemimic.launch and rostopic pub /turtlesim1/turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]' and add this to your completed assignment.
  10. Work through the tutorial on using rosed.
  11. Work through the tutorial on creating a ROS msg and srv.
  12. Work through the tutorial on writing a simple publisher and subscriber in C++.
  13. Work through the tutorial on examining the simple publisher and subscriber.
  14. Work through the tutorial on writing a service and client node in C++.
  15. Work through the tutorial on examining the simple service and client.
    1. Add the output of rosrun beginner_tutorials add_two_ints_client 1 3 to your completed assignment.
  16. Work through the tutorial on recording and playing back data.
    1. Add the contents of the bagfile created with rosbag record -O subset /turtle1/command_velocity /turtle1/pose to your completed assignment.
  17. Work through the tutorial on troubleshooting with roswtf.
    1. Add the output of roscd and roswtf in Step 1.2 to your completed assignment.
  18. Work through the tutorial on navigating the wiki.

What to Submit

Turn in an electronic copy of this assignment via D2L.