Giter Club home page Giter Club logo

gpg's Introduction

Grasp Pose Generator (GPG)

1) Overview

This package creates grasp candidates for 3D point clouds and can check if they are antipodal using geometric conditions. To use the package, you only need PCL and Eigen (see below).

This package is part of GPD. Please notice that no machine learning is included in this part. The package just generates 6-DOF grasp poses for a 2-finger grasp.

2) Requirements

  1. PCL 1.7 or later
  2. Eigen 3.0 or later

3) Compilation

  1. Open a terminal and clone the grasp_candidates_generator repository into some folder:

    $ cd <location_of_your_workspace>
    $ git clone https://github.com/atenpas/gpg.git
    
  2. Build the project:

    $ cd grasp_candidates_generator
    $ mkdir build && cd build
    $ cmake ..
    $ make
    
  3. (optional) Install the project:

    $ sudo make install
    

4) Generate Grasp Candidates for a Point Cloud File

Run the following from within the build folder:

$ ./generate_candidates ../cfg/params.cfg ~/data/some_cloud.pcd

5) Parameters

Brief explanations of parameters are given in cfg/params.cfg.

6) Citation

If you like this package and use it in your own work, please cite our arXiv paper:

@misc{1603.01564,
Author = {Marcus Gualtieri and Andreas ten Pas and Kate Saenko and Robert Platt},
Title = {High precision grasp pose detection in dense clutter},
Year = {2016},
Eprint = {arXiv:1603.01564},
} 

gpg's People

Contributors

atenpas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gpg's Issues

a little bug in the code~

I think theres something wrong with line 110 in generate_candidates.cpp, it should be
view_points << camera_pose[3], camera_pose[7], camera_pose[11]; instead of
view_points << camera_pose[3], camera_pose[6], camera_pose[9];

Segmentation fault (core dumped)

Finding hand poses ...
Segmentation fault (core dumped)

When I deal with my pcd file, I often met this problem, can you help me?
Thanks a lot!

Build error: ‘set’ is not a member of ‘std’

I'm trying to build this on an Ubuntu 16 machine. When building I get this error:

[ 50%] Built target gpg_antipodal /homes/corcodel/gpd/gpg/src/gpg/cloud_camera.cpp: In member function ‘void CloudCamera::voxelizeCloud(double)’: /homes/corcodel/gpd/gpg/src/gpg/cloud_camera.cpp:237:3: error: ‘set’ is not a member of ‘std’ std::set< Eigen::Vector4i, CloudCamera::UniqueVectorFirstThreeElementsComparator> bins; ^ /homes/corcodel/gpd/gpg/src/gpg/cloud_camera.cpp:237:3: note: suggested alternatives: In file included from /usr/include/boost/fusion/container/set/detail/preprocessed/set_fwd.hpp:11:0, from /usr/include/boost/fusion/container/set/set_fwd.hpp:15, from /usr/include/boost/fusion/mpl/detail/clear.hpp:14, from /usr/include/boost/fusion/mpl/clear.hpp:13, from /usr/include/boost/fusion/mpl.hpp:17, from /usr/include/boost/fusion/include/mpl.hpp:12, from /usr/local/include/pcl-1.9/pcl/common/impl/accumulators.hpp:44, from /usr/local/include/pcl-1.9/pcl/common/centroid.h:954, from /usr/local/include/pcl-1.9/pcl/features/normal_3d.h:45, from /usr/local/include/pcl-1.9/pcl/features/normal_3d_omp.h:43, from /homes/corcodel/gpd/gpg/include/gpg/cloud_camera.h:45, from /homes/corcodel/gpd/gpg/src/gpg/cloud_camera.cpp:1: /usr/include/boost/fusion/container/set/detail/preprocessed/set10_fwd.hpp:17:12: note: ‘boost::fusion::set’ struct set; ^ In file included from /usr/include/boost/lexical_cast/detail/converter_lexical.hpp:51:0, from /usr/include/boost/lexical_cast/try_lexical_convert.hpp:34, from /usr/include/boost/lexical_cast.hpp:32, from /usr/include/boost/date_time/string_parse_tree.hpp:13, from /usr/include/boost/date_time/period_parser.hpp:14, from /usr/include/boost/date_time/date_facet.hpp:23, from /usr/include/boost/date_time/gregorian/gregorian_io.hpp:16, from /usr/include/boost/date_time/gregorian/gregorian.hpp:31, from /usr/include/boost/date_time/posix_time/time_formatters.hpp:12, from /usr/include/boost/date_time/posix_time/posix_time.hpp:24, from /usr/local/include/pcl-1.9/pcl/io/boost.h:58, from /usr/local/include/pcl-1.9/pcl/io/file_io.h:42, from /usr/local/include/pcl-1.9/pcl/io/pcd_io.h:44, from /homes/corcodel/gpd/gpg/include/gpg/cloud_camera.h:49, from /homes/corcodel/gpd/gpg/src/gpg/cloud_camera.cpp:1: /usr/include/boost/container/container_fwd.hpp:126:7: note: ‘boost::container::set’ class set; ^

Any ideas what might it be?

Approach, binormal, axis vector to Rotation matrix or euler angles

Hi @atenpas ,

I am able to get grasp candidates for custom pointclouds.
I am missing a point vector to 6D pose conversion.

According to your work --> Approach vector is x-axis,
binormal is y-axis,
axis is z-axis are 3D vectors. Is it the same as rotation matrix ?
rotation matrix = array[ x vector, y-vector, and z-vector] ?

is this correct ? I think I am missing a point.

Thank you! please suggest if i am work.

CloudCamera::calculateNormalsOrganized() failed when processing PointCloudXYZRGBA

When input point clouds are XYZRGBA, cloud camera failed at normal calculation.

The assertion failure message:
/usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h:241: void Eigen::PlainObjectBase<Derived>::resize(Eigen::PlainObjectBase<Derived>::Index, Eigen::PlainObjectBase<Derived>::Index) [with Derived = Eigen::Matrix<double, 3, -1>; Eigen::PlainObjectBase<Derived>::Index = long int]: Assertion (!(RowsAtCompileTime!=Dynamic) || (nbRows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (nbCols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || (nbRows<=MaxRowsAtCompileTime)) && (!(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic) || (nbCols<=MaxColsAtCompileTime)) && nbRows>=0 && nbCols>=0 && "Invalid sizes when resizing a matrix or array."' failed.

GDB back trace when the assertion happened:
Thread 1 "grasp_library" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
0 0x00007ffff46b5e97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1 0x00007ffff46b7801 in __GI_abort () at abort.c:79
2 0x00007ffff46a739a in __assert_fail_base (fmt=0x7ffff482e7d8 "%s%s%s:%u: %s%sAssertion %s' failed.\n%n", assertion=assertion@entry=0x5555555b6600 "(!(RowsAtCompileTime!=Dynamic) || (nbRows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (nbCols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || ("..., file=file@entry=0x5555555b65c0 "/usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h", line=line@entry=241, function=function@entry=0x5555555b77e0 <Eigen::PlainObjectBase<Eigen::Matrix<double, 3, -1, 0, 3, -1> >::resize(long, long)::PRETTY_FUNCTION> "void Eigen::PlainObjectBase::resize(Eigen::PlainObjectBase::Index, Eigen::PlainObjectBase::Index) [with Derived = Eigen::Matrix<double, 3, -1>; Eigen::PlainObjectBase<Derive"...) at assert.c:92
3 0x00007ffff46a7412 in __GI___assert_fail (assertion=0x5555555b6600 "(!(RowsAtCompileTime!=Dynamic) || (nbRows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (nbCols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || ("..., file=0x5555555b65c0 "/usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h", line=241, function=0x5555555b77e0 <Eigen::PlainObjectBase<Eigen::Matrix<double, 3, -1, 0, 3, -1> >::resize(long, long)::PRETTY_FUNCTION> "void Eigen::PlainObjectBase::resize(Eigen::PlainObjectBase::Index, Eigen::PlainObjectBase::Index) [with Derived = Eigen::Matrix<double, 3, -1>; Eigen::PlainObjectBase<Derive"...) at assert.c:101
4 0x00005555555800fa in Eigen::PlainObjectBase<Eigen::Matrix<double, 3, -1, 0, 3, -1> >::resize(long, long) ()
5 0x00007ffff6e221d8 in CloudCamera::calculateNormalsOrganized() () at /usr/local/lib/libgrasp_candidates_generator.so
6 0x00007ffff6e24596 in CloudCamera::calculateNormals(int) () at /usr/local/lib/libgrasp_candidates_generator.so
7 0x00007ffff6e03f1a in CandidatesGenerator::preprocessPointCloud(CloudCamera&) () at /usr/local/lib/libgrasp_candidates_generator.so
8 0x000055555557083d in GraspLibraryNode::detectGraspPosesInTopic() ()
9 0x00005555555705a1 in GraspLibraryNode::onInit() ()
10 0x0000555555571196 in main ()

Understanding the different parameters

Hello, thanks for the package. I'm trying to understand the different paramters. I have a 2 finger robot parallel gripper, on a Fetch Robot. What is the difference between finger_width and hand_outer_diameter. Also, what is the difference between hand_depth and hand_height? Clarification would be helpful. Thanks

Suggestion to change the package name

Hello,

I have been following your work. It's such an amazing work. I would like to report one main thing, the package name acronym doesn't make much sense, as you know the gpg is a encryption method. Naming your repo similarly is confusing and moreover it doesn't make good keyword for searches online. Why can't it be something like grasp_pose_generator. It makes more sense and moreover better keywords.

Generated 0 grasp candidates

I changed multiple parameters and tested it, but I am getting zero grasps. could someone help me with that ? thank you!
This is what I get after running

finger_width: 0.01
hand_outer_diameter: 0.12
hand_depth: 0.06
hand_height: 0.02
init_bite: 0.01
CFG: Not a valid b received!
voxelize: 1
remove_outliers: 0
workspace: -1.0 1.0 -1.0 1.0 -1.0 1.0
camera_pose: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
num_samples: 5
num_threads: 4
nn_radius: 0.001
num_orientations: 1
rotation_axis: 2
plot_grasps: 1
plot_normals: 1
Loaded point cloud with 1319524 points
3
Processing cloud with: 1319524 points.
After workspace filtering: 0 points left.
[pcl::KdTreeFLANN::setInputCloud] Cannot create a KDTree with an empty input cloud!
Estimating local reference frames ...
Error: No samples or no indices!
Generated 0 grasp candidate sets.
Generated 0 grasp candidates.

Do I need mesh to get grasps ?
This is what I get after pressing r

Some hands grasp nothing

I run gpg over a partial pointcloud of a cuboid collected by Kinect, but it looks like your algorithm is interested in the blank area below the object. How to make it generate more desired candidates?

2019-01-16 16:51:32.023774
Failed to find match for field 'rgba'.
finger_width: 0.01
hand_outer_diameter: 0.12
hand_depth: 0.06
hand_height: 0.02
init_bite: 0.01
voxelize: 1
remove_outliers: 0
workspace: -1.0 1.0 -1.0 1.0 -1.0 1.0
camera_pose: -1 8.74227908e-08 3.55271368e-15 1.41000152e-02 6.18172749e-08 7.07107067e-01 7.07106531e-01 -5.47394216e-01 6.18172180e-08 7.07106531e-01 -7.07107067e-01 7.41109848e-01 0 0 0 1
num_samples: 2
num_threads: 4
nn_radius: 0.01
num_orientations: 1
rotation_axis: 2
plot_grasps: 1
plot_normals: 1
Loaded point cloud with 328 points
3
Processing cloud with: 328 points.
After workspace filtering: 328 points left.
After voxelization: 206 points left.
Subsampled 2 at random uniformly.
Calculating surface normals ...
camera: 0, #indices: 206, #normals: 206
runtime (normals): 0.000823014
Reversing direction of normals that do not point to at least one camera ...
reversed 0 normals
runtime (reverse normals): 3.4601e-06
Drawing 206 normals
Estimating local reference frames ...
Estimated 2 local reference frames in 7.1371e-05 sec.
Finding hand poses ...
Found 2 grasp candidate sets in 9.1517e-05 sec.
====> HAND SEARCH TIME: 0.000218619

gpg
gpg_2

Support for PCL GPU?

PCL supports GPU optimization for normal estimation in this class. It's a pretty simple change, the interface is pretty much the same. Would you want to make a branch and implement it yourself or create a pull request?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.