Contents
Welcome to the first lab session of CoTeSys-ROS Fall School!
The challenge of the day will be to get the robot in simulation to navigate to a specific pose. To do that, we will sequence a number of steps:
- tuck the arms
- find the checkerboard on the side of a table (table 1)
- compute the checkerboard's pose
- approach the pose 1m in front of the checkerboard
- rise the robot's spine
- untuck the arms
- approach close to table 1
- and finally, move to the table 2 sideways.
A more complex application would include moving around in a cluttered room and find the checkerboard autonomously.
Prerequisites
Here are some useful tidbits that will help you get around:
- to teleop the robot's base, use:
roslaunch pr2_teleop teleop_keyboard.launch
- to move (Pan/Tilt) the robot's head:
rosrun teleop_head teleop_head_keyboard
- to check the robot's camera view:
rosrun image_view image_view image:=/wide_stereo/left/image_rect
Start Simulation
Bring up the robot, in one terminal:
rosmake pr2_navigation export ROBOT_INITIAL_POSE="-x 3 -Y 3.14" roslaunch ias_gazebo ros_fallschool.launch
Launch a set of tools in another terminal:
rosmake approach_table_tools roslaunch approach_table_tools tools.launch
Start Rviz
rosrun rviz rviz
Change Fixed Frame "map" to "odom_combined"
Vizualize the following:
- robot model
- grid
- checkboard pose
- approach pose
- camera view
Create Your Package
Create your package, calling it nav_executive, and start developing your own executive:
cd $HOME/ros/sandbox/<group number>
roscreate-pkg nav_executive approach_table_tools actionlib move_base_msgs pr2_common_action_msgs pr2_controllers_msgs drive_base_action
Download the nav_executive.cpp C++ skeleton to start with. It is available by clicking on 'Attachments'. Save the file into the nav_executive package. Add one line to nav_executive/CMakeLists.txt to set it up to compile:
rosbuild_add_executable(nav_executive nav_executive.cpp)
Check that your package builds properly
rosmake nav_executive
Now, open up nav_executive/nav_executive.cpp, look for TODO, and start hacking!
Solution
Our solution is: in executive.cpp. Please click on 'Attachments' to retrieve this file.