GraspIt plugin dbase_grasp_planner computing grasp in database throws error about get_mark_next_dbase_task_of_type
(My goal: I am trying to add new objects to a local copy of the household_objects_database, and compute grasps for them, so that I can test grasps using tabletop_detection and pr2_pick_and_place for some of our own object models. I have done the former - adding object models, but the latter - computing grasps - is giving me problems.)
What I have done so far: I installed a local copy of household_objects_database in a PostgreSQL localhost database, and I added some of our own object models successfully to the database, using insert_model.cpp from household_objects_database, changing the database connection line from wgs36 to localhost.
What I need: Now I would like to compute the grasps for the new objects I added - because seems like the grasps are not automatically computed when the object models are added to the database (Is that correct? Because in the pgadmin3 GUI, I see our new models in original_model and scaled_model tables, but I don't see any grasps for these new scaled_model_ids in the "grasp" table.)
Where I'm stuck:
To compute grasps using the GraspIt plugin in dbase_grasp_planner, I am running this file with some modifications
$ roslaunch graspit_ros_planning ros_graspit_interface.launch
which I got to run following two other ROS Answers pages. (I also changed the IP to localhost in dbTaskDispatcher.cpp, and recompiled my copies of graspit_dbase_tasks and dbase_grasp_planner to generate new libgraspit_dbase_tasks.so and libdbase_grasp_planner.so files, the latter is needed by the launch file.)
What all that does is that now the launch file starts the GraspIt plugin, connects to the localhost database successfully. However, GraspIt now throws this error:
Processing arguments Function name dbase_grasp_planning plugin creator autostart 1 [ INFO] [1368320844.809613707]: Function call: get_mark_next_dbase_task_of_type(ARRAY['GRASP_PLANNING','GUIDED_GRASP_PLANNING','VELO_GRASP_PLANNING','GRASP_CLUSTERING']) [ERROR] [1368320844.922216835]: Database get list: query failed. Error: ERROR: function get_mark_next_dbase_task_of_type(text[]) does not exist LINE 1: SELECT get_mark_next_dbase_task_of_type FROM get_mark_next_... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. [ERROR] [1368320844.922357154]: Failed to get the id of the next task of given type to be run [ERROR] [1368320844.922438910]: Function call: get_mark_next_dbase_task_of_type(ARRAY['GRASP_PLANNING','GUIDED_GRASP_PLANNING','VELO_GRASP_PLANNING','GRASP_CLUSTERING']) Dispatcher: error reading next task deleting IVmgr QThreadStorage: Thread 0xaac540 exited after QThreadStorage 7 destroyed
I searched for get_mark_next_dbase_task_of_type many times, and all that comes up is the source code from household_objects_database/database_task.h. Seems like it's looking for a function called get_mark_next_dbase_task_of_type in the database, but the database only has 4 Functions, compute_grasp_robustness, get_grasps, get_models, update_grasps, none of them are that.
I see what it's looking for. Tables dbase_task, dbase_task_type, task_outcome all have relevant stuff. It's trying to get the columns from dbase_task that say TO_RUN, set them to RUNNING, and runs them; when it finishes a task, it sets it to COMPLETED. But I don't know how to give them to it.
So I am reaching a conjecture that I have to create entries in the table that say TO_RUN, create that get_mark_next_dbase_task_of_type() SQL function in the database, and then ...
The "get_mark..." function does need to be in the database, and it should be in the latest version... Which version of the database did you download? Then, generating grasps is indeed not documented - I will try to add a short tutorial on the wiki.
(Thank you SO much for the response, Matei! I was about to email you just now.) Hmm I downloaded the household_objects-0.6_fuerte_prerelease_1.backup, is that not the latest version? Is the SQL function accessible somewhere in a repo that I can just copy-paste it into my function?
We found that in a previous version of the .backup file, the 0.5_electric one, there were functions get_mark_next_dbase_task(), get_mark_next_task(), and save_grasp(), which are not in the 0.6_fuerte.backup file. Still, there is no get_mark_next_dbase_task_of_type() though.
Does anyone know if the mentioned "generating grasps tutorial" ever got created?