ros-interactive-manipulation / graspit_simulator

ROS wrapper and tools for the GraspIt! simulator
4 stars 7 forks source link

dbase_grasp_planner compilation error #2

Open JSR694 opened 8 years ago

JSR694 commented 8 years ago

Hi all,

I'm trying to compile dbase_grasp_planner from source, but am running into the following errors:

[ 50%] [ 50%] Building CXX object dbase_grasp_planner_localhost/CMakeFiles/dbase_grasp_planner_localhost.dir/src/guided_grasp_planning_task.cpp.o
Building CXX object dbase_grasp_planner_localhost/CMakeFiles/dbase_grasp_planner_localhost.dir/src/grasp_planning_task.cpp.o
/home/jack/ros_stuff/graspdb_ws/src/dbase_grasp_planner_localhost/src/grasp_planning_task.cpp: In member function ‘bool dbase_grasp_planner_localhost::GraspPlanningTask::saveGrasp(const GraspPlanningState*, const GraspPlanningState*)’:
/home/jack/ros_stuff/graspdb_ws/src/dbase_grasp_planner_localhost/src/grasp_planning_task.cpp:281:37: error: ‘class GraspableBody’ has no member named ‘getDBModel’
   GraspitDBModel* dbModel= mObject->getDBModel();
                                     ^
/home/jack/ros_stuff/graspdb_ws/src/dbase_grasp_planner_localhost/src/guided_grasp_planning_task.cpp: In member function ‘bool dbase_grasp_planner_localhost::GuidedGraspPlanningTask::saveGrasp(const GraspPlanningState*, const GraspPlanningState*)’:
/home/jack/ros_stuff/graspdb_ws/src/dbase_grasp_planner_localhost/src/guided_grasp_planning_task.cpp:181:37: error: ‘class GraspableBody’ has no member named ‘getDBModel’
   GraspitDBModel* dbModel= mObject->getDBModel();
                                     ^
make[2]: *** [dbase_grasp_planner_localhost/CMakeFiles/dbase_grasp_planner_localhost.dir/src/grasp_planning_task.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [dbase_grasp_planner_localhost/CMakeFiles/dbase_grasp_planner_localhost.dir/src/guided_grasp_planning_task.cpp.o] Error 1
make[1]: *** [dbase_grasp_planner_localhost/CMakeFiles/dbase_grasp_planner_localhost.dir/all] Error 2
make: *** [all] Error 2

I've modified the source code so that it connects to my local household_objects_db. I've also made the following modifications for compatibility with current tools and libraries:

Two other things to note are that I'm using Jennifer Buehler's fork of GraspIt, and that I've also ported graspit_dbase_tasks to catkin (and changed its database connection parameters; this package compiles without issue).

All that being said, I'm stumped by the error I'm getting here. GraspableBody is defined in graspit's body.h; the getDBModel() function is dependent on a compiler flag, but this flag is set to true in the CMakeLists.txt for this version of GraspIt (see line 305).

Any help would be much appreciated!

Thanks, Jack

CMakeLists.txt

JenniferBuehler commented 8 years ago

I'm not very familiar with dbase_grasp_planner, but will have a closer look soon and see if I can help.

One thing would be good to sort out first: You may not need to use my fork if you are not using grasp_planning_graspit or any of the other packages in graspit-pkgs. Is this the case?

My understanding is as well that the migration for this repository here to catkin/cmake is ongoing work/TODO at the moment, is that right, @jvarley?. It still has to be made compatible with the new cmake setup of graspit, which doesn't support catkin (yet?).

The original graspit source was meant to stay catkin-free I think. One way to use the new graspit version from here would be to include the original graspit source with externalproject_add. Or, include it as regular cmake (not catkin) dependency. In the latter case, the cmake build in graspit doesn't come with a graspitConfig.cmake yet, but I think that this is going to be merged as PR soon there as well, or what's you opinion, @jvarley?

JenniferBuehler commented 8 years ago

Oh yeah I just had another look, with the version in this repo you are actually using an old verison of graspit, pulling it from svn (unless the one on svn has been updated, I haven't inspected the source on the svn now). In any case, if you have the new graspit version (from my fork) in your catkin ws as well, that's bound to have plenty of compatibility issues.

Maybe this issue can help to push forward with merging these packages with the new graspit version... :)

JSR694 commented 8 years ago

Hi Jenny! Thanks for taking a look at this.

You may not need to use my fork if you are not using grasp_planning_graspit or any of the other packages in graspit-pkgs. Is this the case?

I'd like to use the urdf2* packages. Are those dependent on the rest of the metapackage, including your fork of graspit? Could I remove the rest of the metapackage and just keep them?

if you have the new graspit version (from my fork) in your catkin ws as well, that's bound to have plenty of compatibility issues.

I removed graspit_simulator's copy of graspit and replaced it with your fork.

JenniferBuehler commented 8 years ago

Hi Jack,

urdf2* packages don't depend on grasp_planning_graspit or graspit packages. Anyway in this case, at this point it makes no real difference whether you use original graspit or my fork.

I see what you did is replace the graspit folder of this repository with my fork of graspit. That won't work however (regardless whether my fork or original), because the packages in this repository here are not set up for using the newer version of graspit - they still work with the old version in the svn. As you can see from the commits, the last updates here are a few years back, plus it is not made for catkin yet (still using manifest.xml instead of package.xml). I'm not sure how soon it is planned to update the packages here to work with the new version and cmake/catkin.

You could try to remove all other packages in this repo except dbase_grasp_planner and write a new CMakeLists.txt for it, for which you'd also have to look at dbase_grasp_planning.pro. Would be a bit of fiddling though. What exactly do you want to do? Maybe there is a currently easier way to achieve what you're trying to do without using this package.

JSR694 commented 8 years ago

Jenny,

Thanks for clarifying those dependencies. I spent enough time fruitlessly fiddling before posting this issue, that I'm reluctant to start anew :).

What exactly do you want to do? Maybe there is a currently easier way to achieve what you're trying to do without using this package.

I wanted to automate the generation and storage of grasps for a set of new objects. dbase_grasp_planner interfaces with Willow Garage's household_objects_db, a Postgres database of objects and grasps for a PR2 gripper. It seemed like my best option when I found it, but I now think that an hdf5 file would be better suited to my application. I'm actually in contact with @jvarley regarding adding relevant functionality to graspit. So, for now, that's the option I'll be pursuing, and this issue is no longer of immediate importance to me. :)