|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Running the cart pushing stack in StageDescription: How to run cart pushing in the stage simulator
The first step is to make the cart_pushing_stage package:
Next, bring up the cart pushing stack in simulation using a top-level launch file in cart_pushing_stage.
roslaunch cart_pushing_stage cart_pushing_stage_fake_localization.launch
Now, wait. You will see a bunch of output on the screen including warning statements similar to these:
[ WARN] [1288047974.656092532, 45.700000000]: The base_scan observation buffer has not been updated for 44.30 seconds, and it should be updated every 0.40 seconds.
This will go on for about 50 seconds (this is about the time it takes the planner to pre-generate and store information about the motion primitives it will use for planning). At the end of about 50 seconds to a minute, you will see the following output:
[ INFO] [1288047980.187947340, 51.200000000]: done pre-computing action data based on motion primitives [ INFO] [1288047980.512539984, 51.500000000]: [sbpl_cart_planner] Initialized successfully [ INFO] [1288047980.517918998, 51.500000000]: MAP SIZE: 2332, 1825 [ INFO] [1288047980.523779320, 51.500000000]: Subscribed to Topics: base_scan [ INFO] [1288047980.601912395, 51.600000000]: Setting up SBPL subscriber [ INFO] [1288047980.643435447, 51.600000000]: Initialized twist recovery with twist linear: x: -0.3 y: 0 z: 0 angular: x: 0 y: 0 z: 0 and duration 1.5
The cart pushing stack is now ready to roll.
To visualize the output of the cart pushing stack, launch rviz locally using a specially configured file:
roslaunch cart_pushing_executive rviz_move_base_cartpushing.launch
You can now give goals to the cart pushing stack just like you would give goals to the navigation stack. The goals are for the robot, not the cart and you have to be careful to give the robot a feasible goal. Note that the goal corresponds to a cart angle of zero. Check out this tutorial if you don't know how to use rviz with the navigation stack.
Interpreting the visualization
The visualization gives you a lot of information about what is going on. The planned path for the robot and cart will be represented as a series of blue robot and green cart outlines. You can adjust the density of these outlines by changing the visualizer_skip_poses parameter. This parameter can be found in the launch/move_base/sbpl_global_planner.yaml file in the sbpl_cart_planner package. A parameter of 1 will display every waypoint in the plan while a parameter of 5 will display a waypoint every 5 waypoints.