Ask Your Question
0

How to solve 'Tabletop detection returned error code 2' ?

asked 2012-04-17 02:54:16 -0500

sam gravatar image

I follow pr2_tabletop_manipulation_apps.

I run

 export ROBOT=sim
 roslaunch pr2_gazebo pr2_empty_world.launch 
 roslaunch gazebo_worlds table.launch 
 roslaunch pr2_tabletop_manipulation_launch      pr2_tabletop_manipulation.launch

I also run the source code of Writing a Simple Pick and Place Application

It shows:

 sam@sam:~/code/ros/test/launch/pr2_pick_and_place_tutorial$ ./bin/t 
 [ INFO] [1334666827.188273982, 82.119000000]: Calling tabletop detector
 [ERROR] [1334666827.711098626, 82.376000000]: Tabletop detection      returned error code 2
 sam@sam:~/code/ros/test/launch/pr2_pick_and_place_tutorial$

How to solve it?

Thank you~

edit retag flag offensive close merge delete

Comments

hey sam, I am also facing the same problem, figured out a solution yet?

aknirala gravatar image aknirala  ( 2012-06-11 20:46:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-06-13 07:45:16 -0500

updated 2013-06-24 23:06:27 -0500

hey sam,

Hope you have got this working by now.

I was finally able to run this. I guess the issue over here is computation speed (I guess). As I made no other significant changes which have affected this. I didn't open rviz for the last time. I am using 2.93Ghz Quad core i3 processor,2GB RAM ,nVidia GeForce 9600M GT, ROS electric on Ubuntu 11.10

Make sure that stereo camera is able to see the table and object (cup) on it. The rviz should look sth like : image description


If it does not see the table on the pipeline terminal it will print:

[ INFO] [1340007291.143192424, 526.884000000]: Tabletop detection service called; waiting for a point_cloud2 on topic /narrow_stereo_textured/points2
[ INFO] [1340007291.726868962, 526.937000000]: Point cloud received after 0.053000000 seconds; processing
[ INFO] [1340007292.465272028, 527.018000000]: Input cloud converted to base_link frame after 0.134000000 seconds
[ INFO] [1340007292.465797253, 527.018000000]: Starting process on new cloud in frame base_link
[ INFO] [1340007292.480850283, 527.019000000]: Step 1 done
[ INFO] [1340007292.481365595, 527.019000000]: Filtered cloud only has 0 points
[ INFO] [1340007292.486792836, 527.020000000]: In total, segmentation took 0.136000000 seconds
[ERROR] [1340007292.498026677, 527.020000000]: Segmentation service returned error 2

Here are the exact steps which I followed:-

  1. roscore
  2. roslaunch pr2_gazebo pr2_empty_world.launch
  3. rosservice call laser_tilt_controller/set_periodic_cmd '{ command: { header: { stamp: 0 }, profile: "linear" , period: 3 , amplitude: 1 , offset: 0 }}', not needed as it uses narrow stereo camera
  4. roslaunch gazebo_worlds table.launch
  5. rosrun gazebo spawn_model -gazebo -file `rospack find gazebo_worlds`/objects/coffee_cup.model -model coffee_cup -x 0.7 -z 0.6
  6. Put the arms on side (outside the view of the laser scane camera)
    with help of http://ros.org/wiki/pr2_simulator/Tutorials/Teleop%20PR2%20arm%20in%20simulation
  7. roslaunch pr2_tabletop_manipulation_launch pr2_tabletop_manipulation.launch stereo:=true
    As in Bringing up the PR2 pipeline : I didn't set
    set use_slip_controllers:=true in
    pr2_tabletop_manipulation_launch pr2_tabletop_manipulation.launch as it was giving an error like
    Machine [c1] already added and does not match duplicate entry
    Also I created a database with household_objects-0.5_electric_prerelease_3.backup
  8. Finaly ran the code for simple pick and place

It was able to pick the cup and move it, while placing the cup I guess it slipped out, but thats good enough. I will now try to run it on multiple machines for better speed.

Edited : corrected the cause of error
as of now I don't know the simple thing of how to rotate the stereo cameras. I have posted this at : http://answers.ros.org/question/36680/changing-the-stereo-camera-angle-in-pr2-simulation/ Hope you can help

Edited : I got the answer (of how to position the stereo camera).

cheers

edit flag offensive delete link more

Comments

What's your step 6 do? Thank you~

sam gravatar image sam  ( 2012-06-20 22:08:48 -0500 )edit

By default arms are in front of PR2 and thus they can also be detected as a cluster (hence object to be picked and placed) so it needs to be moved to the side, outside the view of camera. Exactly like the tutorial of 'Teleop PR2 arm in simulation' I wrote a small code which can move both arms.

aknirala gravatar image aknirala  ( 2012-06-21 22:16:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-04-17 02:54:16 -0500

Seen: 629 times

Last updated: Jun 24 '13