Skip to content

Instantly share code, notes, and snippets.

@sherifm
Last active October 28, 2015 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sherifm/f76cab0e785943f9aadc to your computer and use it in GitHub Desktop.
Save sherifm/f76cab0e785943f9aadc to your computer and use it in GitHub Desktop.

#Kinematics Tool Guide for the ME449 Robotic Manipulation Class - Native ROS on Linux

##1. Overview This documentation is intended to get a user set-up with the kinematics tool for the ME449 Robotic Manipulation class on a Linux machine running an installation of ROS (Robot Operating System). The tool provides a simple solution to visualize a stationary forward kinematics problem or animate a robot's reference trajectory.

To successfully use this kinematics tool natively in ROS you should know:

  • How to install ROS-Indigo.

  • How to set-up your Catkin Workspace and build it.

  • Your ROS environment.

  • How to acquire any missing Linux dependencies (usually using apt-get). You will likely be missing some things from the SciPy Stack and wmctrl.

  • How the basic Linux file system works (directory paths, mv, cp, etc.).

  • Basic .git competencies (mostly clone and pull).

  • How to troubleshoot terminal errors.

##2. Cloning Packages and Building your Workspace##

If you have the aforementioned capabilities here are some guidelines on how to start using the animation tool:

  • Set-up a catkin workspace preferably (but not necessarily) called 'me449_ws' in your home directory.

  • Clone git clone URL_TO_PACKAGE the four packages below into your 'me449_ws/src' directory:

    • The kinematics_animation package.
    • This robot_model package. (This is a modified version of the standard ROS robot_model package. We have modified the Joint State Publisher to allow interactive joint angle inputs).
    • This universal_robot package. It is stripped down to contain the minimum necessary files, to keep it light-weight and help you see through the package contents if you're interested.
    • This barret_model package. It is also stripped down.
  • Now build the workspace (catkin_make). As you know the workspace should build without errors and you should see an 'me449_ws/build' and an 'me449_ws/devel' directory in your workspace. If you do not have that --> keep troubleshooting.

Before you move-on think about whether you want to keep sourcing the me449_ws from your terminal shell every time 'source ~/me449_ws/devel/setup.bash' or prefer editing your ~/.bashrc file to source it in every new terminal window.

##3. Installing non-ROS Linux Packages##

Use Linux' Advanced Packaging tool to install any missing Linux packages. Two packages that you might be missing are:

  • SciPy: Not having SciPy will throw an error when launching the animator. Install using sudo apt-get install python-numpy python-scipy.

  • wmctrl: While not having wmctrl will not throw an error, you would not be able to benefit from the launch script that arranges windows nicely to you screen. Use sudo apt-get install wmctrl.

##4. Launching the Kinematics Tool Demos##

To checkout what the tool can do for you, fire up these lanuchfiles one at a time. Remember that the workspace must be sourced correctly. If you are uncertain check that your me449_ws workspace can be found in the ROS_PACKAGE_PATH environment variable using env |grep ROS_PACKAGE_PATH. source ~/me449_ws/devel/setup.bash if necessary.

  1. UR5 forward kinematics: roslaunch kinematics_animation ur5_forward_kin.launch
  2. UR5 kinematics animation: roslaunch kinematics_animation ur5_animation.launch
  3. WAM forward kinematics:roslaunch kinematics_animation wam_forward_kin.launch
  4. WAM kinematics animation: roslaunch kinematics_animation wam_animation.launch

###Hiding the many frames from your animation:###

If you are bothered by the many frames attached to the robot's links, you can easily hide a frame by unchecking it from the expandable [drop down menu] (https://gist.github.com/sherifm/ba54c406c4f4ae140594#file-rviz_frames-png) on the left hand side. At the time of writing, there was no simple way of configuring the frames to be hidden by default.

##6. Using Your Own Joint Angles and Trajectories##

In step four you launched some demos. Certainly, you will want to visualize forward kinematics for your own set of joint angles or animate your own trajectories. In the me449_ws/src/demos directory you will find example .yaml files (contain joint angles for forward kinematics) and example .csv files (contain trajectories for the animation) for each robot. Do not edit these files. They will get overwritten the next time you pull updates from the servers and - more troublesome - you will run into merge conflicts. Instead, copy the files to a separate personal work directory and then edit the files. Eventually, you will want to generate your own files that follow the same internal naming conventions (i.e. joint names) and file extensions. You can then set the file you would like to visualize/animate by changing the 'file' argument from the command-line when launching, like so:

roslaunch kinematics_animation ur5_forward_kin.launch file:=/home/user/<PATH_TO_MY_FILE>

##7. Making Screenshots on Linux for Your Homeworks##

In your homeworks, you are asked to turn in screenshots of your animations. Here are two tips:

  • If you don't like the print screen (or don't have that button on your computer) try a tool called shutter.

  • If you find the animation to be looping too quickly for you to make live screenshots, try copying a few sets of joint angles from your .csv trajectory into individual .yaml files and launching the stationary forward kinematics tool using those angles. That way you can give yourself plenty of time to make the screenshot.

##8. Using This Tool or Similar on Windows or Mac##

This tool benefits from a popular collection of software frameworks for robot software development called Robot Operating System [(ROS)] (http://www.ros.org/), which typically runs on top of a Linux operating system. You have two alternatives at this point:

  • Use the MATLAB toolbox, which has been set-up specifically for this class to provide the same functionality. See the separate Documentation on the class wiki.

  • Run the tool in a virtualized ROS/Linux environment (with GUI support and accessible Desktop icons) from your Windows or Mac machine. You can find a separate set of [instructions] (https://gist.github.com/sherifm/ba54c406c4f4ae140594) for using this kind of set-up.

##9. Where can I Get Help?##

For ROS-related questions feel free to reach out to me - Sherif Mostafa - at sherifmostafa2015@u.northwestern.edu. For this class we want you focusing on robotic manipulation problems and not ROS problems! I will do my best to reply to you as soon as possible, or set-up a meeting to help you out. I will publish videos to this write-up answering the most re-occuring questions.

###Good luck everyone!###

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment