Skip to content

Commit

Permalink
Merge pull request graspit-simulator#22 from iretiayo/cmake_install
Browse files Browse the repository at this point in the history
 Changed graspit_interface ros package to work with globally installed graspit
  • Loading branch information
jvarley authored Aug 4, 2017
2 parents 288c360 + da43f18 commit e87557a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 25 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ env:

################################################################################

# Install system dependencies, namely a very barebones ROS setup.
# Install system dependencies, namely a very barebones ROS setup#.
before_install:
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
Expand All @@ -53,13 +53,20 @@ install:
# fails. Running `catkin_test_results` aggregates all the results and returns
# non-zero when a test fails (which notifies Travis the build failed).
script:
- cd
- git clone https://github.com/graspit-simulator/graspit.git
- cd graspit
- mkdir build
- cd build
- cmake ..
- sudo make install
- export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
- source /opt/ros/$ROS_DISTRO/setup.bash
- cd
- mkdir -p test_ws/src
- cd test_ws/src
- echo CI_SOURCE_PATH $CI_SOURCE_PATH
- ln -s $CI_SOURCE_PATH graspit_interface
- git clone https://github.com/graspit-simulator/graspit-ros --recursive
- catkin_init_workspace
- cd ..
- catkin_make
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ find_package(catkin REQUIRED COMPONENTS
geometry_msgs
sensor_msgs
roscpp
graspit
actionlib
actionlib_msgs)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
find_package(Qt4 COMPONENTS QtCore REQUIRED)
find_package(graspit)


## Uncomment this if the package has a setup.py. This macro ensures
Expand Down Expand Up @@ -160,6 +160,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
## Your package locations should be listed before other locations
include_directories(include
${catkin_INCLUDE_DIRS}
${GRASPIT_INCLUDE_DIRS}
${QT_INCLUDES})

ADD_DEFINITIONS(${QT_DEFINITIONS})
Expand Down
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
graspit_interface
=================

This plugin exposes a ROS interface for the GraspIt! simulator via [graspit-ros](https://github.com/graspit-simulator/graspit-ros). The main purpose for writing this plugin was to demonstrate what we believe is the easiest way to expose GraspIt!
This plugin exposes a ROS interface for the GraspIt! simulator. The main purpose for writing this plugin was to demonstrate what we believe is the easiest way to expose GraspIt!
functionality as a variety ROS services and action servers.

Please feel free to use this as a template to write your own bridge between a ros system and GraspIt!.
Expand All @@ -12,7 +12,24 @@ To see how a client interacts with this interface, check out our python client
[graspit_commander](https://github.com/graspit-simulator/graspit_commander).


Setup:
GraspIt Setup:
------
```
git clone https://github.com/graspit-simulator/graspit.git
cd graspit
mkdir build
cd build
cmake ..
make -j5
sudo make install
```

You might need to add /usr/local/lib to the loaded library path as in:
```
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
```

ROS Setup:
------
```
//create ros workspace
Expand All @@ -23,7 +40,6 @@ source /opt/ros/indigo/setup.bash
catkin_init_workspace .
//clone packages
git clone https://github.com/graspit-simulator/graspit-ros.git --recursive
git clone https://github.com/graspit-simulator/graspit_interface.git
git clone https://github.com/graspit-simulator/graspit_commander.git
Expand Down
6 changes: 3 additions & 3 deletions include/graspit_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#endif

//GraspIt! includes
#include <graspit_source/include/plugin.h>
#include "graspit_source/include/EGPlanner/searchState.h"
#include "graspit_source/include/EGPlanner/simAnnPlanner.h"
#include <graspit/plugin.h>
#include <graspit/EGPlanner/searchState.h>
#include <graspit/EGPlanner/simAnnPlanner.h>

//Message includes
#include <graspit_interface/SearchSpace.h>
Expand Down
5 changes: 3 additions & 2 deletions scripts/launch_graspit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ if env | grep -q ^GRASPIT=
then
echo "Using GRASPIT=" $GRASPIT
else
export GRASPIT=$(rospack find graspit)/graspit_source
export GRASPIT="/home/${USER}/.graspit"
echo "Using GRASPIT=" $GRASPIT
fi

export GRASPIT_PLUGIN_DIR=$(dirname $(catkin_find --first-only libgraspit_interface.so))

rosrun graspit graspit_simulator -p libgraspit_interface --node_name graspit
graspit_simulator -p libgraspit_interface --node_name graspit
29 changes: 15 additions & 14 deletions src/graspit_interface.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#include "graspit_interface.h"

#include "graspit_source/include/graspitCore.h"
#include "graspit_source/include/robot.h"
#include "graspit_source/include/world.h"
#include "graspit_source/include/ivmgr.h"

#include "graspit_source/include/quality.h"
#include "graspit_source/include/grasp.h"
#include "graspit_source/include/EGPlanner/searchState.h"
#include "graspit_source/include/EGPlanner/egPlanner.h"
#include "graspit_source/include/EGPlanner/simAnnPlanner.h"
#include "graspit_source/include/EGPlanner/guidedPlanner.h"

#include "cmdline/cmdline.h"

#include <graspit/graspitCore.h>
#include <graspit/robot.h>
#include <graspit/world.h>
#include <graspit/ivmgr.h>

#include <graspit/quality/quality.h>
#include <graspit/quality/qualVolume.h>
#include <graspit/quality/qualEpsilon.h>
#include <graspit/grasp.h>
#include <graspit/EGPlanner/searchState.h>
#include <graspit/EGPlanner/egPlanner.h>
#include <graspit/EGPlanner/simAnnPlanner.h>
#include <graspit/EGPlanner/guidedPlanner.h>

#include <graspit/cmdline/cmdline.h>

namespace GraspitInterface
{
Expand Down

0 comments on commit e87557a

Please sign in to comment.