From DSCL

ME530707 2017

Jump to: navigation, search

530.707 Robot Systems Programming Course Home Page

http://dscl.lcsr.jhu.edu/ME530707_2017

Rosorg-logo.png

Contents

Important Notices

Linux and ROS Versions

Note that as of January 13, 2016 we have revised the version of Linix and ROS that we will use in the course for spring 2017. We will use Ubuntu 16.04 LTS Xenial Xerus (http://releases.ubuntu.com/16.04) or one of its variants such as Xubuntu 16.04 LTS (http://xubuntu.org/getxubuntu) and ROS Kinetic Kame (http://wiki.ros.org/kinetic)

EduMIP Robots

In this course we hope to use EduMIP mobile robots - see The EduMIP Mobile Robot: Running the EduMIP as a ROS Node for more information

530.707 Spring 2016 Class Photo - Click here for higher resolution image.

Article and Photos of Spring 2016 Independent Class Projects

Course Description

This course seeks to introduce students to open-source software tools that are available today for building complex experimental and fieldable robotic systems. The course is grouped into four sections, each of which building on the previous in increasing complexity and specificity: tools and frameworks supporting robotics research, robotics-specific software frameworks, integrating complete robotic systems, and culminates with an independent project of the student's own design using small mobile robots or other robots in the lab. Students will need to provide a computer (with at least a few GB of memory and a few tens of GB of disc space) running Ubuntu 16.04 LTS Xenial Xerus (http://releases.ubuntu.com/16.04) or one of its variants such as Xubuntu 16.04 LTS (http://xubuntu.org/getxubuntu) and ROS Kinetic Kame (http://wiki.ros.org/kinetic) Ubuntu 14.04 LTS Trusty Tahr (http://releases.ubuntu.com/14.04 or one of its variants such as Xubuntu 14.04 LTS) and ROS kinetic Igloo (http://wiki.ros.org/kinetic) - note that these specific versions of Linux and ROS are required! Students should have an understanding of intermediate programming in C/C++ (including data structures and dynamic memory allocation) Familiarity with Linux programming. Familiarity with software version control systems (e.g. subversion, mercurial, git), linear algebra. Required Course Background: EN.530.646 Robot Devices, Kinematics, Dynamics, and Control and EN.600.636 Algorithms for Sensor Based Robotics.

The course is open to undergraduates (4 credit) with the permission of the instructor.

This course is NOT available for "Audit", it is only available for letter grade credit.

Instructors

Faculty

Professor Louis L. Whitcomb
Department of Mechanical Engineering
G.W.C. Whiting School of Engineering
The Johns Hopkins University
office: 223C Latrobe Hall
Phone: 410-516-6724
email: [email]
Office Hours: During regular problem sessions during class or by appointment. For an appointment, please contact my Senior Asministrative Coordinator Ms. Deana Santoni [email]

Teaching Assistants

  • Mr. Laughlin Barker [email]
  • Mr. Shahriar Sefati [email]
  • Mr. Andrew Spielvogel [email]

Class Schedule

  • Tuesday 5:00PM-6:30PM - Room 228 Malone Hall
  • Thursday 5:00PM-6:30PM - Room 228 Malone Hall

Office Hours in the Wyman 140 Lab

We are available to answer individual questions during regular office hours in the Wyman 140 lab. You are welcome to bring your computer to Wyman 140 to work on the assignments during office hours, or to use the desktop computers provided in this lab.

  • Monday 1:30-2:30 - Andrew Spielvogel
  • Monday 4:30-5:30 - Laughlin Barker
  • Friday 12:30-1:30 - Shahriar Sefati

Textbooks

Although there is no required text for the course, if you are new to ROS we recommend that you get and read one or more of the following two introductory ROS texts:

Electronic books available through the Milton Eisenhower Library are accessible from on-camps IP addresses. If you are off-campus, you will need to VPN into the campus network to access these electronic books.

Prerequisites

This course will benefit you the most if you are already familiar with the following subjects:

  • Kinematics & Dynamics
  • Linear Control Theory
  • Basic Machine Vision
  • Basic Probability Theory and Random Processes
  • Some Digital Signal Processing

This course requires that you are already familiar with:

  • The Linux Operating System
  • Imperative Programming Languages
  • Markup Languages
  • Data Structures
  • Linear Algebra

This course will require you to:

  • Use the following programming languages:
    • C++
    • bash
    • Python
  • Use the following markup languages:
    • YAML
    • HTML
    • XML
    • JSON
  • Use the following software tools:
    • Version control systems
      • subversion (svn)
      • git
      • mercurial (hg)
    • gdb
    • valgrind
    • CMake, GNU Make

EduMIP Robots

In this course we hope to use the EduMIP mobile robots - see The EduMIP Mobile Robot and Running the EduMIP as a ROS Node for more information

Wyman 140 Lab

We have 6 computers as dual boot with Windows and 64-bit Xubuntu Linux 16.04 LTS and ROS Kinetic (aka ROS Kinetic Kameo) installed and five turtlebot 2s mobile robots in the Wyman 140 Lab. By Jan 29 or so we hope to have everything set up so that you can boot the computers into Linux, and log in with your JHED ID and password.

  • If you have problems logging in for the First Time on a Workstation: There is a BUG in likewise that sometimes crops up: The first time you log in to a workstation using likewise, the graphical login may fail. Workaround: for your very first (and only the first) login with likewise on a machine:
      • 1. Type CTRL-ALT-F1 to get an ASCII console.
      • 2. Log in with your JHED ID and password. Your home directory on the machine will be named by your jhed id, for my case it is: /home/lwhitco1
      • 3. Log out.
      • 5. Type CTRL-ALT-F7 to get the X-windows login screen.
      • 6. Log in normally using the graphical login screen with you JHED ID and password.
      • 7. For all future logins on this machine, you can log in in normally using the graphical login screen with you JHED ID and password.

Wyman 140 Lab Etiquette:

    • Your account has sudo privileges so BE CAREFUL WHEN USING sudo! The only sudo command you should ever use is "sudo apt-get install ros-kinetic-packagename" where "packagename" is the name of a ros package.
    • Do not edit or modify and ROS files under /opt/ros. If you want to modify a standard ROS package, then download the kinetic versoin of the source-code for the package into your catkin workspace, and modify your local copy. ROS will automatically detect your local copy and use it instead of the system version in /opt/ros.
    • The only version of the operating system we will support is Xubuntu 16.04 64-bit.
    • DO NOT upgrade the operating system to more recent releases.
    • The only version of ROS we will support is ROS kinetic
    • DO NOT install other versions of ROS other than ROS kinetic.
    • Leave the lab spotless.
    • Never not "lock" a workstation with a screen-saver. Locked computers will be powered off.
    • No Backup!: The files on these computers are NOT BACKED UP. Any files that you leave in your account on these computers can disappear at any time. Use https://git.lcsr.jhu.edu to save your projects during and after every work session.
    • When you are finished a work session, log off the computer.
    • If you encounter a problem: Notify Prof. Whitcomb and the TAs if you have any problems with the lab or its equipment. Put "530.707" in the subject line of any email regarding this course.

Turtlebot Computers: Lenovo Thinkpad Yoga 260

We have 7 Lenovo Thinkpad Yoga 260 notebooks. #1-#5 are dedicated to Turtlebot #1-#5. #6 and #7 are extra for project use - see the instructor if you would like to use one.

Wyman 140 Ethernet Network

Workstations 1-6 are set up on a local turtlebot network. The turtlebot netbook computers and workstations 1-6 are set to static IP addresses via a static DHCP lease. Here is the list of computers and IP addresses you should use when working with the turtlebots. If we need additional workstations for working with the turtlebots, we can add them to the turtlebot network.

Computer IP Address Location Status
turtlebot-01 192.168.1.111 turtlebot 1 OK
turtlebot-02 192.168.1.112 turtlebot 2 OK.
turtlebot-03 192.168.1.113 turtlebot 3 OK
turtlebot-04 192.168.1.114 turtlebot 4 OK
turtlebot-05 192.168.1.115 turtlebot 5 OK
turtlebot-06 192.168.1.116 spare, for general purpose class project use OK
turtlebot-07 192.168.1.117 spare, for general purpose class project use OK
workstation-1 191.168.1.121 station 1 OK
workstation-2 191.168.1.122 station 2 OK
workstation-3 191.168.1.123 station 3 OK
workstation-4 191.168.1.124 station 4 OK
workstation-5 191.168.1.125 station 5 OK
workstation-6 191.168.1.126 station 6 OK

Wyman 140 Turtlebot WIFI network

The SSIDs for the turtlebot WIFI networks are turtlebot-2.4GHZ. See the TA or instructor for the WIFI password for the turtlebot WIFI network.

Wyman 140 Lab Access

  • Wyman Park Building: Show your J-Card at the front desk during business hours. After hours, you should be able to enter the building front door with your J-Card. If this does not work for any reason, please call the JHU Campus Police on their non-emergency phone number 410-616-4600 to ask them to come and let you into the building. Let us know if you have an problems.
  • Wyman 140 Room Access: Use your J-Card to swipe in.
  • Wyman 140 Lab Hours of Availability and NON-AVAILABILITY: You can use the lab any time EXCEPT when another class has a weekly lab session scheduled. Here are the times the lab is NOT available to you:
    • 530.343 DADS Labs
      • Mondays 6-9PM
      • Tuesdays 3-6PM
      • Thursdays 2:30-5:30PM
      • Fridays 1:30-4:30PM

You are not permitted to use Wyman 140 during the above times when other classes have lab sessions scheduled.

Syllabus

Week 1: Jan 30 & Feb 1: Course Overview and ROS Basics

NOTE: in this course we will exclusively use Ubuntu 16.04 LTS (or an equivalent release such as Xubuntu 16.04 LTS) and the stable ROS Kinetic Kame release.

  • Topics
    • Course Overview
      • Course Description
      • Prerequisites
      • Assignments
      • Class Project
      • Ethics
    • Background of Robot Software Frameworks and The Open-Source Robotics Community
    • Development Tools, Managing Code, Environments, Installing Software, Building Code
    • The ROS core systems: Packaging, Buildsystems, Messaging, CLI & GUI tools, creating packages, nodes, topics, services, and paramaters.
    • Writing a Simple Publisher and Subscriber (C++)
    • Examining the Simple Publisher and Subscriber
    • Writing a Simple Service and Client (C++)
    • Examining the Simple Service and Client
  • Reading
  • Assignments to do this week
    • Install Ubuntu 16.04 LTS (or an equivalent release such as Xubuntu 16.04 LTS).
    • Install ROS Kinetic Kame
    • Complete these Tutorials
      • Installing and Configuring Your ROS Environment. NOTE: in this course we will exclusively use Ubuntu 16.04 LTS Xenial Xerus (http://releases.ubuntu.com/16.04) or one of its variants such as Xubuntu 16.04 LTS (http://xubuntu.org/getxubuntu) and ROS Kinetic Kame (http://wiki.ros.org/kinetic).
      • Navigating the ROS Filesystem
      • Creating a ROS Package
      • Building a ROS Package
      • Understanding ROS Nodes
      • Understanding ROS Topics
      • Understanding ROS Services and Parameters
      • Using rqt_console and roslaunch
      • Using rosed to edit files in ROS
      • Creating a ROS msg and a ROS srv
      • Writing a publisher and subscriber in C++
      • Writing a Simple Publisher and Subscriber (C++)
      • Examining the Simple Publisher and Subscriber
      • Writing a service and client in C++
      • Examining the Simple Service and Client
  • Assignments to hand in this week
  • Homework #1: Assignments to hand in this week. DUE 5:00PM Tuesday Feb 7, 2017.
    • Write and test a publisher node that publishes a TOPIC and subscriber node that subscribes to this TOPIC.
    • Write and test a server node that provides a SERVICE and client node that calls this SERVICE.
    • Hand in your code project "beginner_tutorials" on https://git.lcsr.jhu.edu
      • Login to our GIT server at https://git.lcsr.jhu.edu via the "LDAP" login tab using your JHED ID and password. If you do not already have one, create an ssh id on your computer and, add your ssh key to your account on git.lcsr.jhu.edu.
      • If this is the first time you are using this GIT server, email lcsr-it@jhu.edu to ask Anton Deguet to increase your quota on git.lcsr.jhu.edu so that you can push your assignments to the server. Be sure to include your JHED ID with your request.
      • Create a project called "beginner_tutorials" on https://git.lcsr.jhu.edu,
      • Add the TAs and the instructor as members of the project
      • Initialize your project "beginner_tutorials" as a git repository
      • Add the files to the repo
      • Commit them to the repo
      • Add the remote repository
      • Push your files
      • Push the repo to the server
      • Email the TAs and instructor when done, with "530.707 Assignment 1" in the subject line.
      • See us with questions.

Week 2: Feb 6 & 8: Roslaunch, Nodes, tf, Parameters, and Rosbag

Week 3: Feb 13 & 15: EduMIPs, Joy, and ROS Node development in C++

  • Topics
    • Assembling the EduMIP mobile robot
    • Installing and testing joysticks
    • Publishing /joy topic with the ROS joy package
    • Joystick tutorials - including teleoperating a robot from a joystick
    • ROS timers
    • Writing your own package to subscribe to the joystick /joy and publish a geometry_msgs/Twist topic to command the EduMIP.
    • Writing launch files for same.
    • Running ROS systems spanning more than one computers.
  • Reading
  • Homework #3: Assignments to hand in this week. DUE 5PM PM Tuesday Feb 21, 2017.
    • Assemble and Test the EduMIP as described here Assembling_and_Testing_the_EduMIP_Kit.
    • Set Up Your Beaglebone Black Wireless Board for Your EduMIP: Install a 32GB Debian Jesse image pre-loaded with ROS Kinetic and support for the Robotics Cape on a Micro-SD card on your BBBW. Follow the instructions here:ME530707_2017_EduMIP_ROS#Setting_Up_Your_Beaglebone_Black_Wireless_Board_for_Your_EduMIP
    • Joystick Assignment #1 of 3: Install your joystick and test it (nothing to hand in for this part of the assignment)
      • Plug in and test your USB joystick
        • List the usb devices on your computer with the "lsusb" command with the joystick plugged USB cable connected and also when disconnected.
        • See that the device /dev/input/js0 appears when your joystick is connected, and that this device vanishes when the joystick is disconnected
        • Use the command "jstest /dev/input/js0" to test your joystick. This utility gives text output of the joystick data.
        • Alternatively, test the joystick with the graphical widget "jstest-gtk".
          • Install this utility with the command "sudo apt-get install jstest-gtk"
          • Run this utility it with the command "jstest-gtk".
    • Joystick Assignment #2 of 3: Tutorial: Configuring and Using a Linux-Supported Joystick with ROS (nothing to hand in for this part of the assignment)
      • Notes on this tutorial for most Ubuntu 16.04 installations:
        • The default joystick is /dev/input/js0 (where "0" is numeral zero, not the letter O.
        • The permissions for /dev/input/js0 are already OK, i.e. you NOT need to change the permissions for /dev/input/js0 with the command "sudo chmod a+rw /dev/input/js0".
        • The ROS joy_node automatically looks for the device /dev/input/js0. You do NOT need to set the parameter with the command "rosparam set joy_node/dev "/dev/input/js0".
      • Run "roscore" in one terminal, then run "rosrun joy joy_node" and look at the topic /joy
      • Be sure to use the commands "rosnode list", "rostopic list", and rostopic echo /joy" to explore the /joy topic messages.
    • Joystick Assignment #3 of 3 (to hand in) (Git Project name: joy_twist ):
      • Create a ROS C++ package entitled "joy_twist", with dependencies to roscpp, std_msgs, geometry_msgs, and sensor_msgs with the command "catkin_create_pkg joy_twist roscpp std_msgs geometry_msgs sensor_msgs".
      • In this package create a C++ node entitled joy_twist.cpp that subscribes to a sensor_msgs/Joy joystick topic entitled "/joy" and publishes a geometry_msgs/Twist topic named "/edumip/cmd". We suggest you use a ROS Timer callback function to publish the Twist messages at 10Hz - see ROS Timer documentation for details.
        • Your node should assign joystick axis 1 to twist.linear.x, and joystick axis 0 to twisr.angular.z --- BUT YOU CAN CHOOSE A DIFFERENT MAPPING IF YOU LIKE --- you may need to change a sign in the assignment so that pushing the joystick forward makes twist.linear.x positive, and pushing the joystick to the right makes the twist.angular.z positive.
      • In this package create a launch file entitled joy_twist.launch iThe edumip_balance_ros noden the /launch directory that
        1. Launches a joy node from the ROS joy package, which opens and reads the USB joystick values and publishes them as sensor_msgs/Joy messages on the topic /joy
        2. Launches your joy_twist node which subscribes to sensor_msgs/Joy messages on the /joy topic and publishes geometry_msgs/Twist messages on the /edumip/cmd topic.
      • Be sure to use the commands "rosnode list", "rostopic list", "rostopic echo", "rostopic type", and "rostopic hz" to explore the /joy and /edumip/cmd topics.
      • Run rqt_graph to see the nodes and topics graphically.
    • Joystick Control of the EduMIP and multi-computer ROS Programming: You will "hand in" this part of the assignment by demonstrating joystick control of your EduMIP to one of the TAs during office hours next week on Feb 20 or Feb 24. See above for office hours.
    1. Running ROS Across Multiple Machines: Do the tutorial Running ROS Across Multiple Machines. Do not hand in anything for this tutorial, it is just to get you started on running ROS across multiple computers.
    2. Configure WiFi on your EduMIP: Follow the instructions here ME530707_2017_EduMIP_ROS#WiFi_.28BBB_Wireless_and_BBB_Classic_.2B_USB_WiFi_Adapter
    3. Determine the IP addresses of your PC and your EdhMIP:
      • ifconfig: Use the command "ifconfig" to see all configured network interfaces (Ethernet, WiFi, USB, etc) on your machine.
      • iwconfig: Use the command "iwconfig" to see all configured WiFi network interfaces on your machine.
      • Who am I? The easiest way to determine the IP address (or addresses) of a Linux machine is to log into it and use the command "ifconfig".
    4. In this example I will assume the following IP addresses (YOURS WILL BE DIFFERENT):
      • My PC has IP address 192.168.1.51
      • My EduMIP BBBW has IP address 192.168.1.54
    5. On your PC set the ROS environment variables to look for the ros master (roscore) on the PC with the .bashrc commands:
      • "export ROS_MASTER_URI=http://192.168.1.51:11311" <- this tells ROS the IP address of the machine that is running the ros master (roscore).
      • "export ROS_IP=192.168.1.51" <- this tells ROS the IP address of this machine (your PC).
    6. On your EduMIP set the ROS environment variables to look for the ros master (roscore) on the PC with the .bashrc commands:
      • "export ROS_MASTER_URI=http://192.168.1.51:11311" <- this tells ROS the IP address of the machine that is running the ros master (roscore).
      • "export ROS_IP=192.168.1.54" <- this tells ROS the IP address of this machine (your EduMIP).
    7. Test your configuration:
      1. On your PC, in a new shell, run roscore.
      2. On your PC, in a new shell, run "rostopic list", you should see the standard default topics from the roscore on your PC.
      3. On your EduMIP, in a new shell, run "rostopic list", you should see the standard default topics from the roscore on your PC. Yay!
      4. You can now publish a topic on one machine, and subscribe to the topic on the other machine. For example
        1. On your EduMip, publish a topic with command "rostopic pub -r 1 my_topic std_msgs/String "hello there"
        2. On your PC, subscribe to this topic with "rostopic echo /my_topic"
        3. On your PC, run "rqt_graph" to visualize the nodes and topics.
          Rqt_plot diagram depicting the nodes, topics, and data flow between the nodes via the topics for Assignment #3. Click for higher resolution image.
    8. Now you can control your EduMIP from a joystick on your PC:
      1. On your PC run your joy_twist launch file with the command "roslaunch joy_twist joy_twist.launch" to run roscore, joy and joy_twist nodes. Recall that:
        • The joy node publishes sensor_msgs/Joy messages on the topic /joy
        • The joy_twist node subscribes to sensor_msgs/Joy messages on the topic /joy and publishes geometry_msgs/Twist messages the /edumip/cmd topic.
      2. On your EduMIP run edumip_balance_ros with the command "rosrun edumip_balance_ros edumip_balance_ros". Recall that:
        • The edumip_balance_ros node subscribes geometry_msgs/Twist messages the /edumip/cmd topic and
        • The edumip_balance_ros node publishes edumip_balance_ros/EduMipState messages on the topic /edumip/state
      3. Stand up your EduMIP and take it for a drive.
      4. Explore the ROS topics, and rqt_graph.
    9. DEMO IT TO YOUR TA (REQUIRED): Demo to a TA during office hours in Wyman 140.

Week 4: Feb 20 & 22: URDF and Robot State Publisher

  • Topics
    • Unified Robot Description Format (URDF)
    • Robot State Publisher
  • Reading
  • Notes from Class: In class we downloaded the urdef tutorial package into my catkin workspace. Here are few notes on the steps taken to do this. In this example we will download a local copy of the urdef_tutorial ROS package into my catkin workspace~/ros_catkin_ws/src/urdf_tutorial. You can edit the local copy in your workspace. The system copy located here /opt/ros/kinetic/share/urdf_tutorial but you cannot edit these files because they are protected system files. Better to edit your own local copy in your catkin workspace rather than mucking with the system copy. This is an example of workspace overlay where we create a package in a local workspace that ROS will use in preference to the default system package of the same name. Linux commands are shown in bold font. Comments are in italic font.
    • cd ~/ros+catkin_ws/src (cd to ~/ros_catkin_ws/src)
    • git clone https://github.com/ros/urdf_tutorial.git (clone the git tutorial from github. Note that this creates the directory ~/catkin_ws/src/urdf_tutorial and associated subdirectories.)
    • cd ~/catkin_ws (cd to ~/catkin_ws)
    • rm -r devel build (remove the catkin_ws/devel and catkin_ws/build directory trees, which deletes ~/catkin_ws/devel/setup.bash
    • catkin_make (Builds everything in my workspace from scratch, including generate a new ~/catkin_ws/devel/setup.bash)
    • source devel/setup.bash (Source the newly created file ~/catkin_ws/devel/setup.bash to add this new workspace to the ROS bash environment variables, in particular it will add the present workspace to the ROS_PACKAGE_PATH environment variable)
    • echo $ROS_PACKAGE_PATH (Look again at the ROS_PACKAGE_PATH environment variable that was set by the previous command. It should NOW be a string with your catkin workspace listed at the first element, followed by the standard package path like this: ROS_PACKAGE_PATH=/home/llw/ros_catkin_ws/src:/opt/ros/kinetic/share )
    • rospack profile (This command forces rospack to rebuild the cache of the ros package path that is used by roscd. The cache the text file ~/.ros/rospack_cache).
    • roscd urdf_tutorial (Now roscd will take me to my local copy of the urdef tutorial in ~/catkin_ws/src/urdf_tutorial instead of taking me to the system copy located here /opt/ros/kinetic/share/urdf_tutorial )
    • roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf (Now I can run the tutorial exercise and edit the local URDF files in ~/catkin_ws/src/urdf_tutorial/urdf)
    • Note that the later tutorial urdf files such as urdf/05-visual.urdf refer to a PR2 gripper model mesh files. If you get error messages from RVIZ like "[ERROR] [1393792989.872632824]: Could not load resource [package://pr2_description/meshes/gripper_v0/l_finger.dae]: Unable to open file "package://pr2_description/meshes/gripper_v0/l_finger.dae" then you need to install the PR2 mesh files. You can install the PR2 model files with the command sudo apt-get install ros-kinetic-pr2-common
    • Note that beginning with urdf/05-visual.urdf RVIZ throws lots of warnings like "TIFFFieldWithTag: Internal error, unknown tag 0x829a." but the program runs OK.
  • Assignments to do this week:
    • Learning URDF Step by Step
      • 1. Building a Visual Robot Model with URDF from Scratch
      • 2. Building a Movable Robot Model with URDF
      • 3. Adding Physical and Collision Properties to a URDF Model
      • 4. Using Xacro to Clean Up a URDF File
    • Learning URDF (including C++ API)
      • 1. Create your own urdf file
      • 2. Parse a urdf file
      • 3. Using the robot state publisher on your own robot
      • 4. Start using the KDL parser (You can skip this tutorial for now if you like, it is not required for this week's assignment.)
      • 5. Using urdf with robot_state_publisher
    • Homework #4: Assignment to hand in this week - DUE 5PM Tuesday Feb 28, 2017: Develop a ROS package named edumip_my_robot for your EduMIP.
      Rqt_plot diagram depicting the nodes, topics, and data flow between the nodes via the topics for Assignment #4. Click for higher resolution image.
      • Your package should consist of at least the following:
        • An URDF file named urdf/edumip_my_robot.urdf' (or better yet a xacro file urdf/edumip_my_robot.xacro ) describing the robot links and joints. Your link and joint names should be prcisely the following:
          • A body link named "edumip_body"
          • A left wheel link named "wheelL"
          • A right wheel link named "wheelR"
          • A left continuous joint named "jointL" with parent link "edumip_body" and child link "wheelL".
          • A right continuous joint named "jointR" with parent link "edumip_body" and child link "wheelR".
          • Here are the measured parameters I used in my xacro file - units are meters and radians:
            • <xacro:property name="wheel_separation" value="0.070" />
            • <xacro:property name="wheel_radius" value="0.034" />
            • <xacro:property name="wheel_width" value="0.010" />
            • <xacro:property name="body_height" value="0.1" />
            • <xacro:property name="body_width" value="0.050" />
            • <xacro:property name="body_length" value="0.035" />
        • A C++ node named src/edumup_my_robot_publisher.cpp
          • Your node should subscribe to the /edumip/state message that has recently been expanded to include wheel joint angles and odometry data (i.e. robot X, Y, and heading).
          • Your node should publish the following:
            • sensor_msgs/JointState messages for this robot on the topic /joint_states.. Look at the message definition file edumip_msgs/msgs/EduMipState.msg to see comments on the state message fields. Remember to update your edumip_msgs package (on your PC and EduMIP) from the git repository! It has changed since last week!
            • A tf transform from the fixed "world" frame to this robot's "robot_base" frame that specified the moving position and orientation of the robot with respect to the fixed "world" frame.
            • NOTE:Your node should have a SINGLE callback function for subscribing to the /edumip/state topic, and within this callback function it should publish the the /jount_states topic and the /tf topic.
              RVIZ screen shot for Assignment #4 showing visualization of your robot_model (defined by your urdf or xacro file) and visualization of your tf frames. Click for higher resolution image.
        • A RVIZ initialization file called "rviz/edumip_my_robot.rviz" that displays your robot_model and tf frames.
        • A launch file named 'launch/edumip_my_robot.launch that
          1. Launches a joy node from the system-defined joy ROS package. Recall that the joy node publishes sensor_msgs/Joy messages on the topic /joy
          2. Launches your joy_twist node from the joy_twist package that you wrote for last week's assignment. Recall that the joy_twist node subscribes to sensor_msgs/Joy messages on the topic /joy and publishes geometry_msgs/Twist messages the /edumip/cmd topic.
          3. Launches your custom edumup_my_robot_publisher C++ node from your edumip_my_robot package that you wrote for this week's assignment. Recall that this node subscribes to the /edumip/state topic and publishes on the /jount_states topic and the /tf topic as described earlier in this assignment.
          4. Launches a standard robot_state_publisher node from the robot_state_publisher package. Recall that this node subscribes to the /jount_states topic and the robot_description parameter and publishes /tf frames for the robot based onyoru urdef and the joint_states.
          5. Sets the parameter "robot_description" to load your urdf/edumip_my_robot.urdf' (or .xacro) that you wrote his week to model your edumip.
          6. Launches RVIZ specifying the a rviz initialization file entitles rviz/edumip_my_robot.rviz. hat you create to visualize your robot_model (defined by your urdf or xacro file) and visualization of your tf frames.
          • Now you should be able to drive your robot around with your joystick and see your robot model drive around in RVIZ complete with depiction of the robot and its coordinate frames.
          • NOTE that RVIZ will not display your robot model correctly until it receives valid /tf transforms for all of the robot links. If the link /tf transforms are not valid then RVIZ will show errors in the "robot_model" RVIZ GUI, and the robot links will appear white instead of the colors specified in your urdf/xacro file.
      • Push the finished package to edumip_my_robot https://git-teach.lcsr.jhu.edu and share it with the course instructors (this is due 5PM Tuesday Feb 28, 2017).
      • DEMO IT TO YOUR TA (REQUIRED): Demo to a TA during office hours in Wyman 140 (this is due by during regular office hours on the week Feb 27-Mar 3, 2017).

Week 5: Feb 27 & Mar 1: Gazebo Intro, SDF, and worlds

Topics

  • Simulating robots, their environments, and robot-environment interaction with Gazebo
  • Gazebo ROS integration.
  • NOTE: You do not need to install Gazebo. Your full ROS kinetic desktop installation will have installed Gazebo V7.0.0 So DO NOT follow the installation instructions on gazebosim.org. If for some reason the ros gazebo package is not installed, install it with sudo apt-get install ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
    • You can verify that Gazebo is installed by issuing the command "gazebo" on the command line - a gazebo window should open after a few seconds delay.
  • NOTE: Gazebo is CPU-intensive, and may not run very well in virtual boxes. A lab full powerful desktop PCs are available for you to use in Lab Room 140 of the Wyman Park Building.

Reading

Assignments to do this week

Required Tutorials

  • Gazebo Version 7.0 Tutorials
    • Beginner - First-time Gazebo Users
    • Get Started
      • Skip "Install". Do not install Gazebo, it was installed when your installed the full ROS kinetic desktop.
      • Quick Start: How to run Gazebo with a simple environment.
      • Gazebo Components: This page provides and overview of the basic components in a Gazebo simulation.
      • Gazebo Architecture: Overview of Gazebo's code structure.
      • Screen Shots
    • Build a Robot
      • Model Structure and Requirements: How Gazebo finds and load models, and requirements for creating a model.
      • Skip this one for now: How to contribute a model.
      • Make a model: Describes how to make models.
      • Make a mobile robot: How to make model for a 2-wheeled mobile robot.
      • Import Meshes
      • Attach Meshes
      • Add a Sensor to the Robot
      • Make a simple gripper
      • Attach gripper to robot.
    • Build a World
      • Build a world
      • Modifying a world
      • Skip these for now "Digital Elevation Models", "Population of models", and "Building Editor" for now --- you can return to them at a later date when and if you need them.
    • Friction: How to set friction properties. Be sure to experiment with the more exhaustive friction example linked at the very end of this tutorial. This is the example that I showed in class with sliding blocks. Modify the gravity, friction, and initial position/orientation of the objects to observe different dynamics.
    • Connect to ROS: ROS integration
      • Ros Overview
      • Skip this: Which combination of ROS/Gazebo versions to use You can skip this as you will use the default version 7.0.0 that comes with ROS kinetic --- see gazebo ROS installation notes above.
      • Installing gazebo_ros_pkgs
      • Using roslaunch: Using roslaunch to start Gazebo, world files and URDF models
      • URDF in Gazebo: Using a URDF in Gazebo

Homework #5: Assignments to hand in this week: DUE 5PM Tuesday March 7, 2017

RVIZ screen shot from Assignment #4 showing visualization of your EduMIP as specified bu its XACRO file and visualization of your tf frames. Click for higher resolution image.
Screen shot of Gazebo screen shot from Assignment #5 showing the EduMIP robot model derived from a XACRO file. Click thumbnail for higher resolution image.
  • Create a new Gazebo ROS package named edumip_my_robot_gazebo_ros with dependencies to at least the following packages: roscpp tf std_msgs sensor_msgs geometry_msgs edumip_msgs gazebo_msgs gazebo_ros.
    • DO not use the directory structure specified in the Creating your own Gazebo ROS Package tutorial and exemplified in the URDF in Gazebo RRBot package that you downloaded and used in this tutorial.
  • Your project should have at least the following sub-directories:
    • edumip_my_robot_gazebo_ros/urdf
    • edumip_my_robot_gazebo_ros/launch
    • edumip_my_robot_gazebo_ros/worlds
  • Create a XACRO file urdf/edumip_my_robot.xacro for your EduMip - you can begin with the XACRO file you created for HW#4. If you did not create a XACRO file for HX#4, then do so now.
    • You can use a xacro file in your launch file to set the robot_description parameter with the launch file command "<param name="robot_description" command="$(find xacro)/xacro --inorder $(find edumip_my_robot_gazebo_ros)/urdf/edumip_my_robot.xacro" />'".
    • Add additional statements to your XACRO file so that it can be automatically translated to SDF format for use by Gazebo.
      • Your robot should have one link named "edumip_body" with at least the following attributes:
        • <visual> with
          • <origin>
          • <geometry>
          • <material>
        • <collision>
          • <origin>
          • <geometry>
        • <inertial> with
          • <origin>
          • <mass>
          • <inertia>
      • Your robot should have two wheels named "WheelL" and "WheelR" with at least these attributes:
        • <visual> with
          • <origin>
          • <geometry>
          • <material>
        • <collision>
          • <origin>
          • <geometry>
        • <inertial> with
          • <origin>
          • <mass>
          • <inertia>
      • Your robot should have two joints named "JointL" and "JointR", each with
        • <parent>
        • <child>
        • <origin>
        • <axis>
    • Your EduMIP should be statically stable at rest in a normal gravitational field when on a flat surface - so offset the inertia center-of-mass origin of edumip_body to be BELOW the wheel joints - doing so will make the model balance upright due.
    • It should have nice happy colors.
    • Colors are specified differently for RVIZ (urdf) and Gazebo (sdf). Coulomb friction is specified as <mu1> and <mu2> dimensionless parameters. You can add these lines to your XACRO file which will generate SDF-compatible color specifications when the XACRO file is translated to SDF:
 <gazebo reference="edumip_body">
   <material>Gazebo/Blue</material>
   <mu1>0.2</mu1>
   <mu2>0.2</mu2>    
 </gazebo>
 <gazebo reference="wheelR">
   <material>Gazebo/Green</material>
   <mu1>0.2</mu1>
   <mu2>0.2</mu2>    
 </gazebo>
 <gazebo reference="wheelL">
   <material>Gazebo/Red</material>
   <mu1>0.2</mu1>
   <mu2>0.2</mu2>    
 </gazebo>
  • Create a gazebo world file named edumip_my_robot.world which provides at least horizontal plane, gravity, and some objects or buildings. Your world file can contain your robot model, or you can spawn your robot model in your launch file. In Gazebo you should be able to cause the robot to move on the plane by applying torques to the wheel (or leg) joints.
  • Create a launch file named edumip_my_robot_gazebo.launch which launches your robot world with your robot in it --- recall that you did this in the assigned tutorial section on roslaunch with gazebo. Your launch file should do the following:
    • Set some parameters - see how the "$(find..." command is used in the tutorial launch files.
      • Set the parameter robot_description to the contents of your xacro file with the command " <param name="robot_description" command="$(find xacro)/xacro --inorder $(find edumip_my_robot_gazebo_ros)/urdf/edumip_my_robot.xacro" />"
      • Set the parameter world_name to the name of the world file using similar syntax.
    • Spawn a model of your EduMip with the roslaunch file using the "spawn_model" node in the "gazebo_ros" package with arguments args="-param robot_description -urdf -model edumip_my_robot". Read the documentation of this package for details.
  • Run your launch file with roslaunch. It should launch gazebo with your robot model at the origin.
    • Make your robot move around in the Gzebo World:
      • Select your robot with the mouse
      • On the right hand side og the gazebo window, with your mouse swipe open the "Joint" pane.
      • Apply some torque to he joints to make your robot move.
    • Introspect on the topics with rostopic list' and rostopic echo.

Week 6: Mar 7 & 9: Gazebo physical simulation, ROS Integration

Topics

  • Simulating robots, their environments, and robot-environment interaction with Gazebo
  • Gazebo ROS integration.
  • Gazebo Intermediate Concepts

Reading

Assignments to Do This Week

Required Tutorials

  • Gazebo Version 2.2 Tutorials
    Rviz screen shot showing the RRBot camera and laser-scanner sensor data. Click for higher resolution image.
    • Connect to Ros: ROS Integration
      • Gazebo plugins in ROS
        • Note: To visualize the laser in gazebo as shown in the Gazebo figure on the right of this web page and in the tutorial
          Gazebo screen shot showing the RRBot camera and laser-scanner sensor data. Click for higher resolution image.
          here you will also need to set the visualize property of the hokuyo laser plugin to true (i.e. "<visualize>true</visualize>").
      • ROS control Before you do this tutorial be sure that you have the kinetic ros-control packages installed with the command "sudo apt-get install ros-kinetic-ros-control ros-kinetic-ros-controllers". If these packages are not installed on your system you will get error messages like [ERROR] [WallTime: 1395611537.772305] [8.025000] Failed to load joint_state_controller and [ERROR] [WallTime: 1395611538.776561] [9.025000] Failed to load joint1_position_controller.
      • ROS communication with Gazebo
      • ROS Plugins
        • Note: If you previously downloaded the gazebo_ros_demos tutorial package from this tutorial then you do not need to create a new custom package names "gazebo_tutorials" for this tutorial since the "gazebo_tutorials" package is already present in the directory ~/catkin_ws/src/gazebo_ros_demos/custom_plugin_tutorial.
      • Advanced ROS integration

Homework #6: Assignment to hand in this week: DUE 5PM Tuesday March 14, 2017 - deadline extended to 5PM Thursday March 16, 2017

Rqt_graph screen shot showiing the data flow for HW#6. Click for higher resolution image.
Expand upon your package named edumip_my_robot_gazebo_ros that you created for last week's assignment.
  • In your robot's xacro file urdf/edumip_my_robot.xacro add a differential drive controller plugin that
    1. Specifies /edumip/cmd as the commandTopic that the plugin will subscribe to.
    2. Specifies the correct name for your robot's wheel joints - should be jointL and jointR, respectively, as named elsewhere in your XACRO file.
    3. Specifies publishWheelJointState to be TRUE to enable the plugin to publish the joint states.
    4. Specifies the appropriate wheel diameter and wheel separation.
    5. Specifies /edumip/odom as the odometryTopic that the plugin will publish.
    • Use your launch file from last week (launch/edumip_my_robot_gazebo.launch) to launch gazebo, then introspect on the topics published by the differential drive controller such as
      • /joint_states
      • /tf
      • /edumip/odom
    • Here is the code I used in my xacro file for the differential drive controler plugin:
<gazebo>
 <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
   <legacyMode>false</legacyMode>
   <rosDebugLevel>3</rosDebugLevel>
   <alwaysOn>true</alwaysOn>
   <updateRate>10</updateRate>
   <leftJoint>jointL</leftJoint>
   <rightJoint>jointR</rightJoint>
   <wheelSeparation>${wheel_separation}</wheelSeparation>
   <wheelDiameter>${wheel_radius*2.0}</wheelDiameter>
   <torque>0.1</torque>
   <commandTopic>/edumip/cmd</commandTopic>
   <odometryTopic>/edumip/odom</odometryTopic>
   <odometryFrame>world</odometryFrame>
   <robotBaseFrame>edumip_body</robotBaseFrame>
   <publishTf>1</publishTf> 
   <publishWheelTF>false</publishWheelTF> 
   <publishWheelJointState>true</publishWheelJointState>  
   <wheelAcceleration>0</wheelAcceleration>
   <wheelTorque>0.1</wheelTorque>
   <odometrySource>world</odometrySource>
 </plugin>
</gazebo>
  • In your robot's xacro file urdf/edumip_my_robot.xacro add camera link and a camera plugin
    1. In your robot's xacro file add new link on top of the robot named camera_link.
    2. In your robot's xacro file add new fixed joint named camera_joint with parent link edumip_base and child link camera_link
    3. In your robot's xacro file add a camera plugin
      1. The camera should be located on the camera_link
      2. The name of the camera should be camera1'
      3. The camera plugin should publish images on the topic /edumip/camera1
    • Here is the code that I used in my xacro file for the camera plugin:
<gazebo reference="camera_link">
 <sensor type="camera" name="camera1">
   <update_rate>30.0</update_rate>
   <camera name="head">
     <horizontal_fov>1.3962634</horizontal_fov>
     <image>
       <width>800</width>
       <height>800</height>
       <format>R8G8B8</format>
     </image>
     <clip>
       <near>0.02</near>
       <far>300</far>
     </clip>
     <noise>
       <type>gaussian</type>
       <mean>0.0</mean>
       <stddev>0.007</stddev>
     </noise>
   </camera>
   <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
     <robotNamespace>edumip</robotNamespace>
     <alwaysOn>true</alwaysOn>
     <updateRate>10.0</updateRate>
     <cameraName>camera1</cameraName>
     <imageTopicName>image_raw</imageTopicName>
     <cameraInfoTopicName>camera_info</cameraInfoTopicName>
     <frameName>camera_link</frameName>
     <hackBaseline>0.07</hackBaseline>
     <distortionK1>0.0</distortionK1>
     <distortionK2>0.0</distortionK2>
     <distortionK3>0.0</distortionK3>
     <distortionT1>0.0</distortionT1>
     <distortionT2>0.0</distortionT2>
   </plugin>
 </sensor>
</gazebo>
Gazebo screen shot for HW #6 showing the EduMIP robot at the gas station. Click for higher resolution image.
RVIZ screen shot for HW #6 showing the EduMIP visualized, and showing the robot camera image generated by the camera plugin, and showing the odometry data published by the differential drive controller plugin. Click for higher resolution image.
  • Use your launch file from last week (launch/edumip_my_robot_gazebo.launch) to launch gazebo - you should be able to see the camera link in the gazebo window.
  • Use rqt_image_view and select the topic /edumip/camera1/image_raw to see the images generated by the camera plugin.
  • Create a RVIZ initialization file in the sub directory of your project rviz named rviz/edumip_gazebo_rviz_hw6.rviz. This rviz initialization file should include visualization of the following data:
    1. RobotModel of parameter robot_description
    2. TF of topic /tf
    3. Odometry of topic /edumip/odom
    4. Image display of topic /edumip/camera1/image_raw
  • Create a new launch file named launch/edumip_my_robot_rviz.launch that does the following:
    1. Loads the parameter from your xacro file urdf/edumip_my_robot.xacro.
    2. Launches a robot_state_publisher node that subscribes to the topic /joint_states and publishes on /tf. This is a system-defined node, you do not need to write it.
    3. Includes the launch entitled joy_twist.launch file from your package joy_twist from HW #3. Recall that this launch file launches a standard joy node and also launches the joy_twist C++ node that you wrote for HW# 3.
    4. Launches RVIZ with the initialization file rviz/edumip_gazebo_rviz_hw6.rviz that you created for this assignment.
  • Run your two launch files - one launches Gazebo and one launches RVIZ. You should be able to drive your robot around in Gazebo with your joystick, and see the robot visualized simultaneously in both Gazebo and RVIZ. In RVIZ you should be able to see the robot, its odometry trail, and the camera image.
  • Push It: Push your finished package to edumip_my_robot_gazebo_ros on https://git-teach.lcsr.jhu.edu and share it with the course instructors (this is due 5PM Tuesday March 14, 2017 - deadline extended to 5PM Thursday March 16, 2017). This is the same git repo that you used for the previous assignment - just update it with this week's work.
  • DEMO IT TO YOUR TA (REQUIRED): Demo driving you robot and simultaneously visualizing it in both Gazebo and RVIZ to a TA during office hours in Wyman 140 (this is due by during regular office hours on the week Mar 13 - Mar 17, 2017).

Week 7: Mar 13 & 15 Turtlebot-2 Simulation in Gazebo, SLAM Navigation

Topics

Reading

Assignments to do this week

Required Tutorials

  • NOTE that the turtlebot tutorials are not all updated to ROS Kinetic, but the tutorials for ROS Jade should work just fine when kinetic-specific tutorials are unavailable.
  • Read 2.1 Turtlebot Developer Habits and and 2.2 Interacting with your Turtlebot a t this link: http://wiki.ros.org/Robots/TurtleBot
  • Install the turtlebot packages and the turtlebot simulator Gazebo and Rviz packages.
    • Update your Linux system and ROS packages and Install the turtlebot ROS packages as follows:
      1. Update your PCs Linux system and ROS packages with the commands first sudo apt-get update and then sudo apt-get dist-upgrade THIS IS IMPORTANT, DO NOT SKIP THIS STEP! If you have not updated recently, the command may pull down several hundreds of MB from the Ubuntu and ROS repositories.
      2. Install the turtlebot ROS packages as described in the Turtlebot Installation Tutorial - item 3.1 Turtlebot Installation: Installing software onto the turtlebot at this link. Do the "Ubuntu Package Install" with the command sudo apt-get install ros-kinetic-turtlebot ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-rviz-launchers ros-kinetic-turtlebot-simulator ros-kinetic-turtlesim ros-kinetic-turtlebot-teleop ros-kinetic-kobuki-ftdi
    • NOTE 1: After you install the above packages, kill your login shells and start a clean shells so that additional required gazebo environment variables are set.
    • NOTE 2: You DO NOT need to do a source installation
    • NOTE 3: You do not need to run the command rosrun kobuki_ftdi create_udev_rules because your notebook computer will not be physically connected to the kobuki base with a USB cable. The notebook computers that are physically on the turtlebot will be connected to the kbuki base with a USB cable. Your computer will communicate to the turtlebot's on-board netbook via WiFi.
  • Read about the Turtlebot simulator package for ROS kinetic.
  • Do the "(Section) 6: Simulation" Tutorials for Gazebo (do not do the "Stage" simulator tutorials).
    • Gazebo Bringup Guide: See the simulated turtlebot in Gazebo.
      • When you run the command roslaunch turtlebot_gazebo turtlebot_world.launch if you get the error "Invalid <arg> tag: environment variable 'TURTLEBOT_GAZEBO_WORLD_FILE' is not set.", refer to the NOTE 1 item on installation above.
    • Explore the Gazebo world: Cruise around in the Gazebo world and use RViz to "see" what's in it.
      • NOTE 4: Do not attempt to install ROS Jade packages, we are using ROS kinetic. So install only ROS kinetic packages.
      • NOTE 5: The tutorial's RVIZ initialization file has some errors in the topic names. For example: when displaying the "DepthCloud" visualization in RVIZ, set its "Color Image Topic" to /camera/rgb/image_raw - this will overlay the Kinect camera image on the Kinect's depth cloud.
    • Make a map and navigate with it: Use the navigation stack to create a map of the Gazebo world and start navigation based on it.
      • NOTE 6:There is a bug in the ROS Kinetic package turtlebot_gazebo in the package's launch file gmapping_demo.launch -- its full path is /opt/ros/kinetic/share/turtlebot_gazebo/launch/gmapping_demo.launch (what is the bug?). We can work around this bug by pulling down a copy of this package source into our own ros catkin workspace with the commands:
        • cd ~/ros_catkin_ws/src (varies depending the name and location of your catkin workspace).
        • git clone https://github.com/turtlebot/turtlebot_simulator
        • cd ..
        • catkin_make
        • source devel/setup.bash
        • rospack profile
        • Check that you have overlaid this package with your local copy. Now when you give the command roscd turtlebot_gazebo your default direcectory should be set to ~/ros_catkin_ws/src/turtlebot_simulator/turtlebot_gazebo.
      • To command the turtlebot motion from the keyboard, this node allows you to use the arrow-keys (up, down, left, right): roslaunch kobuki_keyop safe_keyop.launch
      • Save your map to files with your name as part of the filename - for example I might use the command rosrun map_server map_saver -f map_by_louis to generate the map occupancy grid data file map_by_louis.pgm and its associated meta-data file map_by_louis.yaml.
        • Examine the contents of the .pgm map file with an image viewer such as gimp.
        • Examine the contents of the .yaml metadata map with a text editor or more.
      • Note 7: To run the turtlebot AMCL navigation demo, you need to specify the full path name of the .yaml map file, e.g. roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/llw/my_first_map.yaml
      • NOTE 8: Under ROS kinetic the turtlebot AMCL mapping demo seems to ahve some wonky parameters that cause the robot to rotate (twirl) considerably when given a 2-D navigation goal. My workaround was to run rqt_reconfigure (see below for command) and tune some parameters:
        • I set the node move_base parameter "recovery_behavior_allowed" to false (unchecked).
        • I set the node move_base parameter "clearing_rotation_allowed" to false (unchecked).
        • I set the node move_base navigation parameter speed_lim_w to 1.0 (was 5.8).
        • Note that setting these parameters with rqt_reconfigure is ephemeral - the parameters return to the default values specified in the AMCL package then the package is re-launched.
      • Be sure to
        • List and examine the nodes, topics, service
        • Echo some of the published topics
        • Run rqt_graph to visualize the topic data paths
        • Run rqt_reconfigure with the command rosrun rqt_reconfigure rqt_reconfigure to see some of the configuration parameters of packages that you are running.

Homework #7: Assignments to hand in this week: DUE 5PM Tuesday March 28, 2017

Make a SLAM map and navigate with it with a simulated robot and worls in Gazebo! Do this this assigned tutorial completely and carefully: Make a SLAM map and navigate with it

  • Be sure to
    • List and examine the nodes, topics, service
    • Echo some of the the published topics
    • Run rqt_graph to visualize the topic data paths
    • Save your map to files with your name as part of the filename - for example I might use the command rosrun map_server map_saver -f map_by_louis to generate the map occupancy grid data file map_by_louis.pgm and its associated meta-data file map_by_louis.yaml.
      • Examine the contents of the .pgm map file with an image viewer such as gimp.
      • Examine the contents of the .yaml metadata map with a text editor or more.
  • Note: To run the AMCL mapping demo, you need to specify the full path name of the .yaml map file, e.g. roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/llw/my_first_map.yaml
  • Email the two map files (.pgm and .yaml) that you generated to the instructor and the TAs with the subject line "530.707 HW#7 by your_firstname your_lastname". This is due by 5PM Tuesday March 28, 2017.
  • Demonstrate to the TAs or instructor using your map to navigate the playground world with amcl particle filter navigation (you did this in the last part of the SLAM navigation tutorial). This is due in office hours the week of March 27-31, 2017.

Spring Break: Mar 20 & 22

  • Spring Break

Optional Lab 8: Using and Programming Turtlebot in the Lab

  • This lab is optional, for extra credit. If you do this lab, please complete it by Friday April 14, 2017.

Topics

Reading

Assignments to do this week

Required Tutorials

  • Read and understand these notes on the Wyman 140 Lab.
  • When you start using a turtlebot:
    • Verify that that the laptop is turned on and charged.
    • Verify that that the kobuki base is turned on and charged.
  • Before driving a turtlebot, disconnect all power from the netbook and base.
  • When you finish using a turtlebot
    • Plug in the laptop to charge.
    • Plug in the kobuki base to charge.
    • Log out of the workstation and netbook
  • Turtlebot Tutorials
  • 1. Installation
    • 1. Installation
      • Wyman 140 Workstations and Turtlebot Netbooks:The necessary turtlebot ROS packages are already installed on Wyman 140 Workstations 1-6 and all Turtlebot Netbooks.
      • Installing Turtlebot Packages on Your Personal Notebook: If you want to do turtlebot development on your notebook PC, you will need to install turtlebot packages on your notebook. Most of the packages have already been installed on the turtlebots and the desktop workstations. The command is sudo apt-get install ros-kinetic-turtlebot ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-viz ros-kinetic-turtlebot-simulator ros-kinetic-kobuki-ftdi
      • Note that the command rosrun kobuki_ftdi create_udev_rules has ALREADY BEEN RUN to create the device /dev/kobuki for the turtlebot USB connection on the Turtlebot netbooks. You do not need run this command again on the netbooks. You do not need to run this command on the desktop development stations or on your own notebook PC.
    • 2. Post-Installation Setup of the Turtlebot Netbook READ THIS TUTORIAL, BU DO NOT DO IT, WE ALREADY DID IT FOR EACH TURTLEBOT.
      • Network time protocol service NTP is already installed on the turtlebot netbooks and the desktop development PCs.
    • 3. Workstation Installation
      • Don't forget to install the turtlebot packages onto your own laptop (termed "Worksation" in the tutorial) as described. in this tutorial. These packages are already installed on the lab desktop PCs.
    • 4. Network Configuration
      • Follow these steps to configure the ROS environment variables so that your development machine ROS nodes can talk to ROS nodes on the turtlebot netbook.
      • You will need to configure your personal account's .bashrc to set ROS environment variables on your development machine (termed "Worksation" in the tutorial) as described in this tutorial.
      • You will need to configure your personal account's .bashrc to set ROS environment variables on the turtlebot netbook as described in this tutorial.
      • IF YOU USE A DIFFERENT WORKSTATION OR TURTLEBOT, YOU NEED TO CHANGE THESE ENVIRONMENT VARIABLES BOTH ON YOUR ACCOUNT ON YOUR WORKSTATION AND ON YOUR ACCOUNT ON THE TURTLEBOT NETBOOK.
  • 2. Getting Started
    • 2.1 Bringup
    • 2.2 Teleoperation
      • 1. Keyboard Teleop Keyboard teleoperation of a turtlebot
        • We recommend using this keyboard teleop node: roslaunch kobuki_keyop safe_keyop.launch rather than the default turtlebot keyop node.
        • NOTE:Sometimes the kobuki_keyop safe_keyop.launch is wonky if you do not run a persistent roscore before launching anything.
        • Run the keyboard teleop while 3D sensor and image information are being displayed in RVIZ.
        • Drive the turtlebot around.
        • Try not to crash or to push against immobile objects (the turtlebot wheel motors could overheat and burn out).
  • 3. Advanced Usage

Homework #8: Assignments to hand in this week DUE Friday April 14, 2017.

  • Demonstrate to the TAs or instructor keyboard teleop of the turtlebot with 3D sensor data being displayed in RVIZ.
  • Demonstrate to the TAs or instructor using your map to navigate the Wyman 140 lab with amcl particle filter navigation using the map that you created.

Week 8: March 28 & 30: Independent Project: Project Proposal

Topics

  • Formulate your class project and
  • Form your team
  • Write your project proposal.
  • Get your project proposal approved by Prof. Whitcomb.

Reading

Assignments to do this week

Plan your independent class project and form your team

Here are the project rules:

  • Form a project team of no more than 3 members. You can work independently if you prefer.
  • Formulate a project that
    • Performs at least two specific tasks
    • Uses at least two sensors
    • At least one of the tasks must be performed autonomously or semi-autonimously (i.e. the not just pure teleopertion)
    • Your project MUST include several original ROS nodes that you programmed by you from scratch.
  • Review your preliminary project formulation with the Instructor and TAs during regular office hours and after classes this week. Ask them questions.
  • Determine the availability of all required hardware.
  • Conduct tests of any critical required existing ROS packages.
  • IMPORTANT NOTE:These rules can be waived with the permission of the instructor if you have a good rationale for doing something different.

Homework #8: Assignment to hand in this week - Due 5PM Tuesday March 4, 2017

  • Project Proposal - email A SINGLE PDF description of your proposed project to the Instructor and TAs. Be sure to put "530.707 Proposal for Project YOUR PROJECT NAME by NAMES OF ALL TEAM MEMBERS" in email subject line.
  • Submit a single project proposal document for each project team.
  • Your proposal should include
    • Project Title - give your project a NAME
    • Project Author(s) (i.e. team members),
    • Date
    • Description of proposed project. What does it do? Describe! How does a user interact with it?
    • Software
      • List and description of the NEW ros packages you will program from scratch to accomplish your project.
      • List of the major existing ROS packages you will utilize
      • List what testing you have done on these existing ROS packages.
    • Hardware and infrastructure
      • List and description of any new or additional hardware and infrastructure needed to implement your project.
      • List of existing and infrastructure needed to implement your project.
      • Describe availability of all required hardware
      • List what testing you have done on existing available hardware.
      • Include a detailed list of all new hardware required to be purchased or borrowed, including quantity, description, model number, source/vendor, unit cost, total cost, etc.
    • Safety Plan
      • Are there any safety risks?
      • If so, can they be managed and/or mitigated to an acceptable level fo safety?
      • If so, what is the plan for risk management and/or mitigation?
    • References - list of any references cited in your text
    • Project Timeline: For each week, give the hardware and software development and testing goals for the week.
      1. Week 1 hardware and software development and testing goals.
      2. Week 2 hardware and software development and testing goals.
      3. Week 3 hardware and software development and testing goals.
      4. Week 4 hardware and software development and testing goals.
      5. Week 5 hardware and software development and testing goals. Your goal should be to have your project completed by the end of Week 5 - the last week of classes. This should include your project poster for the class poster session on May 15, and also your project report.
  • Your submitted proposal will be reviewed by the Instructor and TAs, and you will be notified of the result. It will either be "approved" or "not approved" - if "not approved" you will be asked to revise and resubmit the proposal.

Some Tips and Notes on Projects and Programming the EduMIP in ROS

Istalling ROS Packages on the EduMIP:

The ROS installation /op/ros/kinetic on your EduMIP was compiled from source on the EduMIP, it was NOT installed with "apt-get install ros-kinetic-desktop-full". If you want to install additional ROS packages on your EduMIP, we suggest that you download the KINETIC branch of the package souce code into catkin_ws/src and compile it with "catkin_make"

  • So, for example, if I want to install the ROS "serial" package on my edumip, I would need to clone a copy of the source and compile it:
  • Now your EduMIP should use the serial package from your workspace.
  • On my PC, in contrast, I can use apt-get to install this binary package with the command "sudo apt-get install ros-kinetic-serial"

ROS Can't Find my ROS Package

If your ROS environment does not seem to recognize that you have new packages in your catkin_ws/src, try updating your rospack profile with the command "rospack profile", and update your rosdep cache with the command "rosdep update".

Compiling and Linking to the Robtoics Cape "C" Libraries

The robotics cape library and associated header files are already installed on your EduMIP. The link library is /usr/lib/libroboticscape.so, and the two top-level header files are rc_usefulincludes.h and roboticscape.h.

You can refer to the edumip_balance_ros project (https://git.lcsr.jhu.edu/lwhitco1/edumip_balance_ros) to see how to use the robotics cape C header files and C link library with your C++ ROS Node.

See edumip_balance_ros/src/edumip_balance_ros.cpp to see how to include the C header files in a C++ program with the extern "C" directive.

See edumip_balance_ros/CMakeLists.txt to see how to link your program to the roboticscape C library.

Edumip_balance_ros Package

EduMIP Horizontal Configuration

Several teams propose to employ the EduMIP in a horizontal configuration with a caster wheel. To do this you will need to replace the "edumip_balance_ros" project with your own new code to command the wheel servos and to read and publish the wheel encoders. As I reviewed in class yesterday, one possible package you could use is the ROS differential_drive package (http://wiki.ros.org/differential_drive). To use the differential_drive package you will need to write a new C++ node for the edumip that (a) Reads the wheel encoders and publishes them on topics and (b) Subscribes to motor command topics and commands effort to the wheel motors.


Interfacing to Serial Port Devices

To interface your C++ code to a serial device such as the USB ultrasonic sensor demonstrated in class, you will need to be able to open, read, and write to the serial ports. A good package for this is the ROS serial package (http://wiki.ros.org/serial). You can clone a copy of the src into your ROS workspace with the command "git clone https://github.com/wjwwood/serial.git" and compile it with "catkin_make". The "examples" directory has a somewhat complex example of serial port usage. A simpler example is availabl here: https://github.com/garyservin/serial-example

Week 9: Apr 3 & 5: Independent Project: Project Implementation and Testing

  • Topics
    • Additional topics TBD
  • Reading
    • TBD
  • Assignments to do this week
    • Week 2 of project development.
    • Use class time and office hours
  • Homework #9: Assignments to hand in this week
    • Project Progress report #1 (email to instructor and TAs)

HOW TO ORDER COMPONENTS FOR YOUR PROJECT

Week 10: Apr 10 & 12: Independent Project: Project Implementation and Testing

  • Topics: Work on your team project.
    • Additional topics TBD
  • Reading
    • TBD
  • Assignments to do this week
    • Week 3 of project development.
    • Use class time and office hours
  • Homework #10: Assignments to hand in this week
    • Project Progress Report #1 (email to instructor and TAs)

Week 11: Apr 17 & 19: Independent Project: Project Implementation and Testing

  • Topics
    • Additional topics TBD
  • Reading
    • TBD
  • Assignments to do this week
    • Week 4 of project development.
    • Use class time and office hours
  • Homework #11: Assignments to hand in this week
    • Project Progress Report #2 (email to instructor and TAs)

Week 12: Apr 25 & 27: Independent Project: Project Implementation and Testing

  • Topics
    • Additional topics TBD
  • Reading
    • TBD
  • Assignments to do this week
    • Week 4 of [project development.
    • Use class time and office hours
  • Homework #12: Assignments to hand in this week
    • Project Progress Report #3 (email to instructor and TAs)

Week 13: May 1 & 3: Independent Project: Project Implementation and Testing

  • Topics
    • Additional topics TBD
  • Reading
    • TBD
  • Assignments to do this week
    • Week 5 of project development.
    • Use class time and office hours
  • Homework #13: Assignments to hand in this week
    • Project Progress Report #4 (email to instructor and TAs)

May 15 & 16: Independent Project Demonstrations

You must demonstrate your final project to Professor Whitcomb. Please sign up for a spot for your team to demonstrate your project at this doodle poll: https://doodle.com/poll/cdhhu2evtmz5s99e

May 15: Independent Project Poster Session, 2-5 PM Monday, May 15, 2017

  • Final presentations will be a poster session 2-5 PM Monday, May 15, 201 in Hackerman Hall.
  • I posted a poster template for a 24” (wide) x 36” (tall) poster here https://jh.box.com/v/530-707-Dropbox in the file named Poster_Template_Rev_02.pptx
  • We will provide 24”x36” foam-core boards.
  • You need to print your own poster. You can print your poster on the ME Department’s HP Designjet T795ps located on the 3rd floor hallway of Latrobe Hall. Students in 530.707 all have 24/7 J-Card access to this floor.
  • Follow these links for information on printing.
  • The printer is loaded with 42” wide HP Heavyweight Coated Paper, so you can print your poster sideways to save paper.
  • Do not wait until the last day to print your poster!
  • If you can demo your project at the poster session, please do so. If not, showing a video of your project in action is desirable.

530.707 Robot Systems Programming Spring 2017 YouTube Channel!

  • I created a YouTube channel for you to post videos of your class project videos. Here is the link:

https://www.youtube.com/channel/UClezHSosZ6xqP3vUxqoRg8w

  • If you make a video of your project in action, please upload a copy to this youtube channel.
  • Let me know if you have any problems accessing or uploading to this channel!

Independent Project Final report is due by end of exam period

Here is the outline:

  • Project report (PDF) Email PDF project report of your project to the Instructor and TAs. Be sure to put 530.707 in email subject line. Your project report should include
    • Project Title, Author(s) (i.e. team members), Date
    • Description of proposed project goals
    • Software
      • List and description of the new ros packages you implemented to accomplish your project. Include git repository URL for each package.
      • List of the major existing ROS packages you utilized
    • Hardware and infrastructure
      • List and description of any new or additional hardware and infrastructure you needed to implement your project.
      • List of existing and infrastructure you needed to implement your project.
    • Sample Data Products (if any) from the project
    • Link to brief online video of your project in action (desired but not required).
    • Project "Lessons Learned"
    • Suggestions for future projects
    • References - list of any references cited in your text
  • Project video (desired but not required).

Article and Photos of Previous Independent Class Projects

Ethics

Students are encouraged to work in groups to learn, brainstorm, and collaborate in learning how to solve problems.

Problem Sets and Lab Assignments Final Writeups: Your final writeups for pre-lab exercises and lab assignments must be done independently without reference to any notes from group sessions, the work of others, or other sources such as the internet.

While working on your final writeups for assignments, you may refer to your own class notes, your own laboratory notes, and the text.

Disclosure of Outside Sources: If you use outside sources other than your class notes and your text to solve problems in the pre-lab and lab assignments (i.e. if you have used sources such as your roommate, study partner, the Internet, another textbook, a file from your office-mate's files) then you must disclose the outside source and what you took from the source in your writeup.

In this course, we adopt the ethical guidelines articulated by Professor Lester Su for M.E. 530.101 Freshman experiences in mechanical engineering I, which are quoted with permission as follows:

Cheating is wrong. Cheating hurts our community by undermining academic integrity, creating mistrust, and fostering unfair competition. The university will punish cheaters with failure on an assignment, failure in a course, permanent transcript notation, suspension, and/or expulsion.

Offenses may be reported to medical, law or other professional or graduate schools when a cheater applies. Violations can include cheating on exams, plagiarism, reuse of assignments without permission, improper use of the Internet and electronic devices, unauthorized collaboration, alteration of graded assignments, forgery and falsification, lying, facilitating academic dishonesty, and unfair competition. Ignorance of these rules is not an excuse.

On every exam, you will sign the following pledge: "I agree to complete this exam without unauthorized assistance from any person, materials or device. [Signed and dated]"

For more information, see the guide on "Academic Ethics for Undergraduates" and the Ethics Board web site (http://ethics.jhu.edu).

I do want to make clear that I'm aware that the vast majority of students are honest, and the last thing I want to do is discourage students from working together. After all, working together on assignments is one of the most effective ways to learn, both through learning from and explaining things to others. The ethics rules are in place to ensure that the playing field is level for all students. The following examples will hopefully help explain the distinction between what constitutes acceptable cooperation and what is not allowable.

Student 1: Yo, I dunno how to do problem 2 on the homework, can you clue me in? 

Student 2: Well, to be brief, I simply applied the **** principle
that is thoroughly explained in  Chapter **** in the course text.

Student 1: Dude, thanks! (Goes off to work on problem.)

- This scenario describes an acceptable interaction. 
There is nothing wrong with pointing someone in the right direction.


Student Y: The homework is due in fifteen minutes and I haven't 
done number 5 yet! Help me!

Student Z: Sure, but I don't have time to explain it to you, so
here. Don't just copy it, though.
(Hands over completed assignment.)

Student Y: I owe you one, man. (Goes off to copy number 5.)

 - This scenario is a textbook ethics violation on the part of 
 both students. Student Y's offense is obvious; student Z is 
 guilty by virtue of facilitating plagiarism, even though he/she 
 is unaware of what student Y actually did.


Joe Student: Geez, I am so swamped, I can't possibly write up the 
lab report and do the lab data calculations before it's all due.

Jane student: Well, since we were lab partners and collected all 
the data together...maybe you could just use my Excel spreadsheet
with the calculations, as long as you did the write-up yourself....

Joe Student: Yeah, that's a great idea!

- That is not a great idea. By turning in a lab report with Jane's
spreadsheet included, Joe is submitting something that isn't his 
own work.


Study group member I: All right, since there's three of us and
there's six problems on the homework, let's each do two. I'll 
do one and two and give you copies when I'm done.

Study group member II: Good idea, that'll save us a lot of work.
I'll take three and five.

Study group member III: Then I guess I'll do four and six. Are you
guys sure this is OK? Seems fishy to me.

Study group member I: What's the problem? It's not like we're
copying the entire assignment. Two problems each is still a lot 
of work.

- This is clearly wrong. Copying is copying even if it's only 
part of an assignment.


Mike (just before class): Hey, can you help me? I lost my
calculator, so I've got all the problems worked out but I 
couldn't get the numerical answers. What is the answer for 
problem 1?

Ike: Let's see (flips through assignment)... I got 2.16542.
 
Mike: (Writing) Two point one six five four two...what about 
number 2?

Ike: For that one... I got 16.0.

Mike: (Writing) Sixteen point oh...great, got it, thanks. 
Helping out a friend totally rules!

- Helping out a friend this way does not rule, totally or 
partially. As minor as this offense seems, Mike is still 
submitting Ike's work as his own when Mike gets the numerical 
answer and copies it in this way.


This page was last modified on 9 May 2017, at 16:40.