parameters: (self, pose, width)
return_statement: return grasps
docstring: Generate grasps by using the grasp generator generate action; based on
          server_test.py example on moveit_simple_grasps pkg.
docstring_summary: Generate grasps by using the grasp generator generate action; based on
          server_test.py example on moveit_simple_grasps pkg.
docstring_tokens: Generate grasps by using the grasp generator generate action ; based on server_test . py example on moveit_simple_grasps pkg .
function: def _generate_grasps(self, pose, width):
          """
          Generate grasps by using the grasp generator generate action; based on
          server_test.py example on moveit_simple_grasps pkg.
          """
  
          # Create goal:
          goal = GenerateGraspsGoal()
  
          goal.pose  = pose
          goal.width = width
  
          options = GraspGeneratorOptions()
          # simple_graps.cpp doesn't implement GRASP_AXIS_Z!
          #options.grasp_axis      = GraspGeneratorOptions.GRASP_AXIS_Z
          options.grasp_direction = GraspGeneratorOptions.GRASP_DIRECTION_UP
          options.grasp_rotation  = GraspGeneratorOptions.GRASP_ROTATION_FULL
  
          # @todo disabled because it works better with the default options
          #goal.options.append(options)
  
          # Send goal and wait for result:
          state = self._grasps_ac.send_goal_and_wait(goal)
          if state != GoalStatus.SUCCEEDED:
              rospy.logerr('Grasp goal failed!: %s' % self._grasps_ac.get_goal_status_text())
              return None
  
          grasps = self._grasps_ac.get_result().grasps
  
          # Publish grasps (for debugging/visualization purposes):
          self._publish_grasps(grasps)
  
          return grasps
function_tokens: def _generate_grasps ( self , pose , width ) : # Create goal: goal = GenerateGraspsGoal ( ) goal . pose = pose goal . width = width options = GraspGeneratorOptions ( ) # simple_graps.cpp doesn't implement GRASP_AXIS_Z! #options.grasp_axis      = GraspGeneratorOptions.GRASP_AXIS_Z options . grasp_direction = GraspGeneratorOptions . GRASP_DIRECTION_UP options . grasp_rotation = GraspGeneratorOptions . GRASP_ROTATION_FULL # @todo disabled because it works better with the default options #goal.options.append(options) # Send goal and wait for result: state = self . _grasps_ac . send_goal_and_wait ( goal ) if state != GoalStatus . SUCCEEDED : rospy . logerr ( 'Grasp goal failed!: %s' % self . _grasps_ac . get_goal_status_text ( ) ) return None grasps = self . _grasps_ac . get_result ( ) . grasps # Publish grasps (for debugging/visualization purposes): self . _publish_grasps ( grasps ) return grasps