Actions

Robotics Class 2011/Assignment 3: Difference between revisions

From HacDC Wiki

m (Created page with "Write a ROS node that subscribes to the "/face_coords" topic and uses the information provided in that topic to move the robot base by publishing messages on the "/cmd_vel" topic...")
 
mNo edit summary
Line 7: Line 7:
It may help to follow the ROS instructions [http://www.ros.org/wiki/simulator_gazebo/Tutorials/StartingGazebo here] in order to install and get gazebo running.
It may help to follow the ROS instructions [http://www.ros.org/wiki/simulator_gazebo/Tutorials/StartingGazebo here] in order to install and get gazebo running.


The next step will be to make sure you have the ''gazebo_erratic_plugins''.  These are extensions to gazebo to support differential drive robots (like the iRobot Create) that have two driven wheels.  If you installed the ROS installation using Synaptic, you can search Synaptic for "erratic" and you should see a package named '''ros-diamondback-erratic-robot'''.  You will want to install this package through Synaptic.  Once that is complete, you can proceed to checking out the HacDC robot simulation:
The next step will be to make sure you have the ''gazebo_erratic_plugins''.  These are extensions to gazebo to support differential drive robots (like the iRobot Create) that have two driven wheels.  If you installed the ROS installation using Synaptic, you can search Synaptic for "erratic" and you should see a package named '''ros-diamondback-erratic-robot'''.  You will want to install this package through Synaptic.  If you compiled from source, you will want to check out, rosdep install, and rosmake the [http://www.ros.org/wiki/erratic_robot erratic_robot] package.
 
Once that is complete, you can proceed to checking out the HacDC robot simulation:


'''cd''' to where you store your downloaded ROS packages
'''cd''' to where you store your downloaded ROS packages
'''svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/irobotron_description'''
'''svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/irobotron_description'''
'''rosmake irobotron_description'''
'''rosmake irobotron_description'''
Once that completes, you can start the robot in the simulation (make sure you have gazebo running from the above step before doing this):
'''roslaunch irobotron_description create_mobile_base.launch'''
You should then see the robot get inserted into the world.  At this point, the robot is up and running in the simulation and you can do a ''rostopic list'' to see a variety of message topics.  The robot simulator has a camera being simulated that has characteristics similar to the camera on the actual robot.  You can subscribe to the simulated robot's camera stream the same way you have done in the past:
'''rosrun image_view image_view image:=/stereo/left/image_rect'''

Revision as of 19:14, 2 July 2011

Write a ROS node that subscribes to the "/face_coords" topic and uses the information provided in that topic to move the robot base by publishing messages on the "/cmd_vel" topic. The goal of the assignment is to build a face tracker that attempts to move the robot to keep faces centered in the camera frame.

First, you must install gazebo and be able to run the simple gazebo empty world launch script. The simple command to start gazebo is:

roslaunch gazebo_worlds empty_world.launch

It may help to follow the ROS instructions here in order to install and get gazebo running.

The next step will be to make sure you have the gazebo_erratic_plugins. These are extensions to gazebo to support differential drive robots (like the iRobot Create) that have two driven wheels. If you installed the ROS installation using Synaptic, you can search Synaptic for "erratic" and you should see a package named ros-diamondback-erratic-robot. You will want to install this package through Synaptic. If you compiled from source, you will want to check out, rosdep install, and rosmake the erratic_robot package.

Once that is complete, you can proceed to checking out the HacDC robot simulation:

cd to where you store your downloaded ROS packages svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/irobotron_description rosmake irobotron_description

Once that completes, you can start the robot in the simulation (make sure you have gazebo running from the above step before doing this):

roslaunch irobotron_description create_mobile_base.launch

You should then see the robot get inserted into the world. At this point, the robot is up and running in the simulation and you can do a rostopic list to see a variety of message topics. The robot simulator has a camera being simulated that has characteristics similar to the camera on the actual robot. You can subscribe to the simulated robot's camera stream the same way you have done in the past:

rosrun image_view image_view image:=/stereo/left/image_rect