Class GraspTable


  • public class GraspTable
    extends java.lang.Object
    A table of grasp configurations that has been generated using a robot hand,
    a number of preshapes, and some grasp policy.
    • Field Detail

      • GTABLE_VERSION

        public static final long GTABLE_VERSION
        this version increase each time the file format is changed
    • Constructor Detail

      • GraspTable

        public GraspTable​(long cPtr,
                          boolean cMemoryOwn)
      • GraspTable

        public GraspTable​(java.lang.String handName,
                          java.lang.String objectId)
        constructor
        Parameters:
        handName - [in] name of robot hand
        objectId - [in] name of object that is being grasped
    • Method Detail

      • getCPtr

        public static long getCPtr​(GraspTable obj)
      • delete

        public void delete()
      • getCalibForceIndex

        public int getCalibForceIndex()
        gets the index of the calibration force if its used. The calibration force is
        stored in the 'quality' list in the GraspData objects.
        Returns:
        index of calibration force if used, -1 otherwise
      • setCalibForceIndex

        public void setCalibForceIndex​(int idx)
        set the index of the calibration force
        Parameters:
        idx - [in] calibration force index
      • addGrasp

        public void addGrasp​(GraspTable.GraspData data)
        add a grasp to this GraspTable
        Parameters:
        data - [in] Grasp data
      • size

        public long size()
        get the nr of grasps in this GraspTable
        Returns:
        nr of grasps in this GraspTable
      • getHandName

        public java.lang.String getHandName()
        get name of hand
        Returns:
        name of hand
      • getObjectName

        public java.lang.String getObjectName()
        get name of object
        Returns:
        name of object
      • nrTactileArrayGrasp

        public int nrTactileArrayGrasp()
        get the number of tactile arrays on this hand
        Returns:
      • getTactileArrayDim

        public Pair_i_i getTactileArrayDim​(int i)
        get the dimensions of the i'th tactile array
        Parameters:
        i - [in] the tactile array id
        Returns:
      • hasCalibForce

        public boolean hasCalibForce()
        check if this table has calib force data
        Returns:
        true if this table has calib force data (equal to getCalibForceIndex()>=0), false
        otherwise
      • save

        public void save​(java.lang.String filename)
        save this grasp table to file filename
        Parameters:
        filename - [in] name of file