robotology / cardinal-points-grasp

Simple superquadric-based grasping pose generator for iCub
GNU General Public License v2.0
5 stars 4 forks source link

cardinal-points-grasp

Simple superquadric-based grasping pose generator and renderer for iCub

Dependencies

Installation

git clone https://github.com/robotology/cardinal-points-grasp.git
cd cardinal-points-grasp
mkdir build && cd build
cmake ../
make install

Interaction diagram

Diagram

Usage

This module is supposed to be used to generate and execute grasps on simple objects that lie on a surface (e.g. a table) in front of the robot. Given an object to grasp, the following actions get undertaken:

  1. cardinal-points-grasp interfaces with point-cloud-read to retrieve a point cloud (if the object is present in the scene).
  2. The point cloud is sent to find-superquadric and the parameters of the superquadric shape that best fits the point cloud are obtained.
  3. A number of feasible side and top grasps are generated and displayed according to the size and position of the resulting superquadric. The module makes sure that none of the poses are unreachable by the robot.
  4. The candidate grasps are ranked according to a hierarchical cost function that takes into account, in order
    1. The kinematic accuracy that the position can be reached with (primary cost)
    2. The orientation accuracy and the way the superquadric is being grasped (this secondary cost guides the algorithm toward grabbing the short sides of the superquadric)
  5. The best grasp is selected and its offset gets corrected by going through a iolReachingCalibration RPC.
  6. If requested, the grasp gets executed with the desired hand.

The module visualizes the point cloud, superquadric, and suitable grasps. The best grasp is highlighted by a larger indicator, and for each grasp the cost function is displayed in the format [primary_cost]_[secondary_cost].

Once all the modules are running and connected (the code comes with a yarpmanager app to keep track of the connections) it can be interacted via RPC calls to /graspProcessor/cmd:rpc. The available commands are as follows:

All of these commands (at the moment) return an ack if the module reaches the end of the procedure, otherwise nack

Calibration

This module is made to interact with the Interactive Object Learning (IOL) suite of modules. It interacts with 'iolReachingCalibration' to compensate for the kinematic offset between the stereo rig and the robot root reference frame. When calibrating such module, make sure that the 2D centroid of the detected object is on top of the object, that is where the robot lands its hand for calibration. Otherwise, the calibration will consider points lower than the top end of the object, resulting in an undesired shift along the z-axis (robot reference frame) while executing any grasp.

Command-line parameters

Example

yarp rpc /graspProcessor/rpc
>>grasp_pose Box right
Response: [ack]
alt text