pyrobosim.manipulation.grasping.GraspGenerator.should_try_grasp
- GraspGenerator.should_try_grasp(faces_enabled: Sequence[bool], face_normals: Sequence[ndarray], face_vec: ndarray) tuple[bool, GraspFace]
Helper function to validate whether to compute grasps on a specific face.
Given the set of enabled grasp types, and the normal vectors of the cuboid faces, this function determines whether grasping along a specific normal vector is permitted. For example, if
Only top and front grasps are enabled
The top face normal vector is [0, 0, 1]
The front face normal vector is [-1, 0, 0]
Then this function will
Allow grasps along the vectors [0, 0, 1] and [-1, 0, 0] because these are the top and front faces
Disallow a grasp along the vectors [0, 1, 0] and [0, -1, 0] because side grasps are disabled
Disallow a grasp along the vector [1, 0, 0] because this would be a back grasp which is not supported
- Parameters:
faces_enabled – Faces for which grasp generation is enabled, in the form (front, top, side)
face_normals – Face normals in the canonical directions, in the form (front, top, left, right)
face_vec – Normal vector of the cuboid face to check.
- Returns:
A tuple determining whether the grasp should be attempted, and what face that corresponds to