Robot Operating System (ROS): An Introduction Paul Nyholm David Wheeler BYU MAGICC Lab Brigham Young University
Exploration Path Planner Motivation Robot 1: Mission Statement Using an altimeter, Xbox Kinect, and IMU, safely drive through a room creating a map of the environment. Kinect Map Exploration Path Planner Altimeter Estimator IMU Robot Control
Motivation Robot 2: Mission Statement Using an laser range finder, GPS, and IMU, safely fly to specific user defined waypoints and search for moving vehicles. Vehicle Detection Laser Global Map Waypoint GUI GPS Estimator IMU Robot Control
Motivation ROS: High Modularity Follows Intuitive Information Flow
Exploration Path Planner Concept ROS Node ROS Message Independent Python or C++ programs. Node crash protection. Inter-program communication. Subscriber Publisher Kinect Map Exploration Path Planner Altimeter Estimator IMU /topic_name Robot Control
Concept Subscriber Example: #include "ros/ros.h" #include "std_msgs/String.h“ void chatterCallback(const std_msgs::String::ConstPtr& msg) { ROS_INFO("I heard: [%s]", msg->data.c_str()); } int main(int argc, char **argv) ros::init(argc, argv, "listener"); ros::NodeHandle n; ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback); ros::spin(); return 0;
Concept Publisher Example: #include "ros/ros.h" #include "std_msgs/String.h" #include <sstream> int main(int argc, char **argv) { ros::init(argc, argv, "talker"); ros::NodeHandle n;. ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000); ros::Rate loop_rate(10); int count = 0; while (ros::ok()) std_msgs::String msg; std::stringstream ss; ss << "hello world " << count; msg.data = ss.str(); ROS_INFO("%s", msg.data.c_str()); chatter_pub.publish(msg); ros::spinOnce(); loop_rate.sleep(); ++count; } return 0;
Concept roscore my_talker rosrun talker my_talker chatter:=new_chatter_topic altimeter roslaunch rosrun altimeter my_altimeter range:=range_topic Estimator rosrun estimator my_estimator alt_topic:=range_topic estimate:=current_estimate
Exploration Path Planner Concept Define one node at a time using message interface Blackbox everything else Subscriber Publisher Kinect Map Exploration Path Planner Altimeter Estimator IMU /topic_name Robot Control
Tools ROS offers many built in tools that are helpful for collecting, visualizing, and processing data rqt suite rosbag tf rviz wstool
Tools rqt_graph Gives a graphical representation of the active nodes and topics
Tools rqt_plot Plots incoming messages on specified topics
Tools rqt_bag & rosbag rosbag records (subscribes to) specified topics and makes them available for playback (publishing) useful for analysis and simulation chatter IMU commands states goal chatter IMU commands states goal rosbag record topic_name rosbag play bagfile.bag
Tools rqt_bag GUI access to rosbag Selectively publish topics
Tools TF Keeps track of coordinate frames and transformations Lookup transformations between different frames at specified times (including the past) Does the math for you!!!
Tools rviz Visualize coordinate frames, point clouds, paths, goals, models, and much more
Useful wstool commands Free Version Control Sources Tools wstool ROS tool to manage various version control sources supports git, mercurial, subversion, bazaar Useful wstool commands wstool update wstool status wstool diff wstool info Free Version Control Sources github.com bitbucket.com google it
Setup Ubuntu 12.04 LTS (www.ubuntu.com) ROS Hydro (www.ros.org)
Setup catkin workspace high level build manager where your source code (packages) lives cmake lower level build manager creates your .make file catkin_ws/ build/ devel/ src/ CMakeLists.txt (never touch this) package_one/ CMakeLists.txt (must be modified) package.xml msg/ msg1.msg msg2.msg source1.cpp source2.cpp include/ header.h package_two/ …
Setup Qt Creator Qt is a power, easy to use IDE for C++ projects Can be used for programming catkin packages Installation on Ubuntu: $ sudo apt-get install qtcreator Opening Catkin Workspace with Qt Creator: $ cd ~/catkin_ws/src $ qtcreator CMakeLists.txt It is easiest to run this from the command line so that Qt Creator has access to your required environment variables