ORK_Tabletop is a simple pipeline for object recognition that only requires the mesh of an object for training/detection.
Through this tutorial, you will:
Let's first set up the working environment together!
sudo apt-get install ros-<your ROS distro>-rviz ros-<your ROS distro>-rqt_reconfigure ros-<your ROS distro>-openni*
In separate terminals, run the following commands:
Set the Fixed Frame (top left of rviz window) to /camera_depth_optical_frame.
Add a PointCloud2 display, and set the topic to /camera/depth/points. Turning the background to light gray can help with viewing. This is the unregistered point cloud in the frame of the depth (IR) camera. It is not matched with the RGB camera images.
Now let's look at a registered point cloud, aligned with the RGB data. Open the dynamic reconfigure GUI:
And select /camera/driver from the drop-down menu. Enable the depth_registration checkbox.
Now go back to rviz, and change your PointCloud2 topic to /camera/depth_registered/points. Set Color Transformer to RGB8. You should see a color, 3D point cloud of your scene.
(Detailed explanation can be found here)
In order to find planes using ORK_Tabletop, run the following command:
Then go to rviz graphical window, and add the OrkTable display. Now you should see some planes detected by ORK_Tabletop if your camera is pointing to some plane surfaces.
If you follow the installation guide mentioned earlier, you know that ORK uses couchDB to manage the objects database. In order to have tabletop detect objects, we need to feed the databases with objects' 3D models (yeah, I know that you knew it already :-) ).
When I first installed ORK, my database was empty, but I was so excited to see how how tabletop detection happens, I just wanted to avoid the nightmare of making up a database. Luckily, ork tutorials comes with 3D model of a coke can. So, I downloaded the tutorials:
then upload it to the ORK database:
Now if you open the link http://localhost:5984/or_web_ui/_design/viewer/objects.html you should see the coke object listed in your database.
As everything is set up; let's see how ork_tabletop detects our coke can (**happy face**). In a terminal, run
The go back to rviz graphical interface, and add the OrkObject display. Now if you have a coke can placed on one of the detected planes, ork_tabletop should see it and your beautiful rviz interface should be displaying it, like this:
Notice:
On this site, you can click on the image to enlarge it.
In the image, you only see the coke because OrkTable is unchecked in rviz interface. This should not be the case on your beautiful rviz unless you actually uncheck that box ;-)
Problem: It happened to me a couple of times that ORK_tabletop complained about the 3D input and did not want to show off its power.
Answer: What I did to solve this was: I checked the configuration file that I called in the detection command. Normally, the input topics of tabletop are defined as RosKinect. I checked if the default topics were the same as what published by openni. If that's not the case, I just uncomment the parameter option and modify these topics accordingly. And hopefully, tabletop would be happy with this modification and show off its power the next time I run it.
That might be the only problem I've ever encountered with tabletop. And so you will hopefully. ;-)
Now that you see things on the rviz, why don't you just move the 3D camera around to see how fast ORK_tabletop detects thing? ;-)
Have fun exploring!