# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from moveit_msgs/GraspPlanningRequest.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

import genpy
import geometry_msgs.msg
import moveit_msgs.msg
import object_recognition_msgs.msg
import shape_msgs.msg
import std_msgs.msg
import trajectory_msgs.msg

class GraspPlanningRequest(genpy.Message):
  _md5sum = "c234e9a645708cc86b57a43999746ae6"
  _type = "moveit_msgs/GraspPlanningRequest"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """# Requests that grasp planning be performed for the target object
# returns a list of candidate grasps to be tested and executed

# the planning group used
string group_name

# the object to be grasped
CollisionObject target

# the names of the relevant support surfaces (e.g. tables) in the collision map
# can be left empty if no names are available
string[] support_surfaces

# an optional list of grasps to be evaluated by the planner
Grasp[] candidate_grasps

# an optional list of obstacles that we have semantic information about
# and that can be moved in the course of grasping
CollisionObject[] movable_obstacles


================================================================================
MSG: moveit_msgs/CollisionObject
# A header, used for interpreting the poses
Header header

# The id of the object (name used in MoveIt)
string id

# The object type in a database of known objects
object_recognition_msgs/ObjectType type

# The collision geometries associated with the object.
# Their poses are with respect to the specified header

# Solid geometric primitives
shape_msgs/SolidPrimitive[] primitives
geometry_msgs/Pose[] primitive_poses

# Meshes
shape_msgs/Mesh[] meshes
geometry_msgs/Pose[] mesh_poses

# Bounding planes (equation is specified, but the plane can be oriented using an additional pose)
shape_msgs/Plane[] planes
geometry_msgs/Pose[] plane_poses

# Adds the object to the planning scene. If the object previously existed, it is replaced.
byte ADD=0

# Removes the object from the environment entirely (everything that matches the specified id)
byte REMOVE=1

# Append to an object that already exists in the planning scene. If the object does not exist, it is added.
byte APPEND=2

# If an object already exists in the scene, new poses can be sent (the geometry arrays must be left empty)
# if solely moving the object is desired
byte MOVE=3

# Operation to be performed
byte operation

================================================================================
MSG: std_msgs/Header
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data 
# in a particular coordinate frame.
# 
# sequence ID: consecutively increasing ID 
uint32 seq
#Two-integer timestamp that is expressed as:
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
# time-handling sugar is provided by the client library
time stamp
#Frame this data is associated with
string frame_id

================================================================================
MSG: object_recognition_msgs/ObjectType
################################################## OBJECT ID #########################################################

# Contains information about the type of a found object. Those two sets of parameters together uniquely define an
# object

# The key of the found object: the unique identifier in the given db
string key

# The db parameters stored as a JSON/compressed YAML string. An object id does not make sense without the corresponding
# database. E.g., in object_recognition, it can look like: "{'type':'CouchDB', 'root':'http://localhost'}"
# There is no conventional format for those parameters and it's nice to keep that flexibility.
# The object_recognition_core as a generic DB type that can read those fields
# Current examples:
# For CouchDB:
#   type: 'CouchDB'
#   root: 'http://localhost:5984'
#   collection: 'object_recognition'
# For SQL household database:
#   type: 'SqlHousehold'
#   host: 'wgs36'
#   port: 5432
#   user: 'willow'
#   password: 'willow'
#   name: 'household_objects'
#   module: 'tabletop'
string db

================================================================================
MSG: shape_msgs/SolidPrimitive
# Define box, sphere, cylinder, cone 
# All shapes are defined to have their bounding boxes centered around 0,0,0.

uint8 BOX=1
uint8 SPHERE=2
uint8 CYLINDER=3
uint8 CONE=4

# The type of the shape
uint8 type


# The dimensions of the shape
float64[] dimensions

# The meaning of the shape dimensions: each constant defines the index in the 'dimensions' array

# For the BOX type, the X, Y, and Z dimensions are the length of the corresponding
# sides of the box.
uint8 BOX_X=0
uint8 BOX_Y=1
uint8 BOX_Z=2


# For the SPHERE type, only one component is used, and it gives the radius of
# the sphere.
uint8 SPHERE_RADIUS=0


# For the CYLINDER and CONE types, the center line is oriented along
# the Z axis.  Therefore the CYLINDER_HEIGHT (CONE_HEIGHT) component
# of dimensions gives the height of the cylinder (cone).  The
# CYLINDER_RADIUS (CONE_RADIUS) component of dimensions gives the
# radius of the base of the cylinder (cone).  Cone and cylinder
# primitives are defined to be circular. The tip of the cone is
# pointing up, along +Z axis.

uint8 CYLINDER_HEIGHT=0
uint8 CYLINDER_RADIUS=1

uint8 CONE_HEIGHT=0
uint8 CONE_RADIUS=1

================================================================================
MSG: geometry_msgs/Pose
# A representation of pose in free space, composed of position and orientation. 
Point position
Quaternion orientation

================================================================================
MSG: geometry_msgs/Point
# This contains the position of a point in free space
float64 x
float64 y
float64 z

================================================================================
MSG: geometry_msgs/Quaternion
# This represents an orientation in free space in quaternion form.

float64 x
float64 y
float64 z
float64 w

================================================================================
MSG: shape_msgs/Mesh
# Definition of a mesh

# list of triangles; the index values refer to positions in vertices[]
MeshTriangle[] triangles

# the actual vertices that make up the mesh
geometry_msgs/Point[] vertices

================================================================================
MSG: shape_msgs/MeshTriangle
# Definition of a triangle's vertices
uint32[3] vertex_indices

================================================================================
MSG: shape_msgs/Plane
# Representation of a plane, using the plane equation ax + by + cz + d = 0

# a := coef[0]
# b := coef[1]
# c := coef[2]
# d := coef[3]

float64[4] coef

================================================================================
MSG: moveit_msgs/Grasp
# This message contains a description of a grasp that would be used
# with a particular end-effector to grasp an object, including how to
# approach it, grip it, etc.  This message does not contain any
# information about a "grasp point" (a position ON the object).
# Whatever generates this message should have already combined
# information about grasp points with information about the geometry
# of the end-effector to compute the grasp_pose in this message.

# A name for this grasp
string id

# The internal posture of the hand for the pre-grasp
# only positions are used
trajectory_msgs/JointTrajectory pre_grasp_posture

# The internal posture of the hand for the grasp
# positions and efforts are used
trajectory_msgs/JointTrajectory grasp_posture

# The position of the end-effector for the grasp.  This is the pose of
# the "parent_link" of the end-effector, not actually the pose of any
# link *in* the end-effector.  Typically this would be the pose of the
# most distal wrist link before the hand (end-effector) links began.
geometry_msgs/PoseStamped grasp_pose

# The estimated probability of success for this grasp, or some other
# measure of how "good" it is.
float64 grasp_quality

# The approach direction to take before picking an object
GripperTranslation pre_grasp_approach

# The retreat direction to take after a grasp has been completed (object is attached)
GripperTranslation post_grasp_retreat

# The retreat motion to perform when releasing the object; this information
# is not necessary for the grasp itself, but when releasing the object,
# the information will be necessary. The grasp used to perform a pickup
# is returned as part of the result, so this information is available for 
# later use.
GripperTranslation post_place_retreat

# the maximum contact force to use while grasping (<=0 to disable)
float32 max_contact_force

# an optional list of obstacles that we have semantic information about
# and that can be touched/pushed/moved in the course of grasping
string[] allowed_touch_objects

================================================================================
MSG: trajectory_msgs/JointTrajectory
Header header
string[] joint_names
JointTrajectoryPoint[] points

================================================================================
MSG: trajectory_msgs/JointTrajectoryPoint
# Each trajectory point specifies either positions[, velocities[, accelerations]]
# or positions[, effort] for the trajectory to be executed.
# All specified values are in the same order as the joint names in JointTrajectory.msg

float64[] positions
float64[] velocities
float64[] accelerations
float64[] effort
duration time_from_start

================================================================================
MSG: geometry_msgs/PoseStamped
# A Pose with reference coordinate frame and timestamp
Header header
Pose pose

================================================================================
MSG: moveit_msgs/GripperTranslation
# defines a translation for the gripper, used in pickup or place tasks
# for example for lifting an object off a table or approaching the table for placing

# the direction of the translation
geometry_msgs/Vector3Stamped direction

# the desired translation distance
float32 desired_distance

# the min distance that must be considered feasible before the
# grasp is even attempted
float32 min_distance

================================================================================
MSG: geometry_msgs/Vector3Stamped
# This represents a Vector3 with reference coordinate frame and timestamp
Header header
Vector3 vector

================================================================================
MSG: geometry_msgs/Vector3
# This represents a vector in free space. 
# It is only meant to represent a direction. Therefore, it does not
# make sense to apply a translation to it (e.g., when applying a 
# generic rigid transformation to a Vector3, tf2 will only apply the
# rotation). If you want your data to be translatable too, use the
# geometry_msgs/Point message instead.

float64 x
float64 y
float64 z"""
  __slots__ = ['group_name','target','support_surfaces','candidate_grasps','movable_obstacles']
  _slot_types = ['string','moveit_msgs/CollisionObject','string[]','moveit_msgs/Grasp[]','moveit_msgs/CollisionObject[]']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.

    The available fields are:
       group_name,target,support_surfaces,candidate_grasps,movable_obstacles

    :param args: complete set of field values, in .msg order
    :param kwds: use keyword arguments corresponding to message field names
    to set specific fields.
    """
    if args or kwds:
      super(GraspPlanningRequest, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.group_name is None:
        self.group_name = ''
      if self.target is None:
        self.target = moveit_msgs.msg.CollisionObject()
      if self.support_surfaces is None:
        self.support_surfaces = []
      if self.candidate_grasps is None:
        self.candidate_grasps = []
      if self.movable_obstacles is None:
        self.movable_obstacles = []
    else:
      self.group_name = ''
      self.target = moveit_msgs.msg.CollisionObject()
      self.support_surfaces = []
      self.candidate_grasps = []
      self.movable_obstacles = []

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      _x = self.group_name
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self
      buff.write(_get_struct_3I().pack(_x.target.header.seq, _x.target.header.stamp.secs, _x.target.header.stamp.nsecs))
      _x = self.target.header.frame_id
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self.target.id
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self.target.type.key
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self.target.type.db
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      length = len(self.target.primitives)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.primitives:
        _x = val1.type
        buff.write(_get_struct_B().pack(_x))
        length = len(val1.dimensions)
        buff.write(_struct_I.pack(length))
        pattern = '<%sd'%length
        buff.write(struct.Struct(pattern).pack(*val1.dimensions))
      length = len(self.target.primitive_poses)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.primitive_poses:
        _v1 = val1.position
        _x = _v1
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v2 = val1.orientation
        _x = _v2
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.target.meshes)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.meshes:
        length = len(val1.triangles)
        buff.write(_struct_I.pack(length))
        for val2 in val1.triangles:
          buff.write(_get_struct_3I().pack(*val2.vertex_indices))
        length = len(val1.vertices)
        buff.write(_struct_I.pack(length))
        for val2 in val1.vertices:
          _x = val2
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.target.mesh_poses)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.mesh_poses:
        _v3 = val1.position
        _x = _v3
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v4 = val1.orientation
        _x = _v4
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.target.planes)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.planes:
        buff.write(_get_struct_4d().pack(*val1.coef))
      length = len(self.target.plane_poses)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.plane_poses:
        _v5 = val1.position
        _x = _v5
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v6 = val1.orientation
        _x = _v6
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      _x = self.target.operation
      buff.write(_get_struct_b().pack(_x))
      length = len(self.support_surfaces)
      buff.write(_struct_I.pack(length))
      for val1 in self.support_surfaces:
        length = len(val1)
        if python3 or type(val1) == unicode:
          val1 = val1.encode('utf-8')
          length = len(val1)
        buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
      length = len(self.candidate_grasps)
      buff.write(_struct_I.pack(length))
      for val1 in self.candidate_grasps:
        _x = val1.id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v7 = val1.pre_grasp_posture
        _v8 = _v7.header
        _x = _v8.seq
        buff.write(_get_struct_I().pack(_x))
        _v9 = _v8.stamp
        _x = _v9
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v8.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v7.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v7.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.positions))
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.velocities))
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.accelerations))
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.effort))
          _v10 = val3.time_from_start
          _x = _v10
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v11 = val1.grasp_posture
        _v12 = _v11.header
        _x = _v12.seq
        buff.write(_get_struct_I().pack(_x))
        _v13 = _v12.stamp
        _x = _v13
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v12.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v11.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v11.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v11.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v11.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.positions))
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.velocities))
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.accelerations))
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.effort))
          _v14 = val3.time_from_start
          _x = _v14
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v15 = val1.grasp_pose
        _v16 = _v15.header
        _x = _v16.seq
        buff.write(_get_struct_I().pack(_x))
        _v17 = _v16.stamp
        _x = _v17
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v16.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v18 = _v15.pose
        _v19 = _v18.position
        _x = _v19
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v20 = _v18.orientation
        _x = _v20
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.grasp_quality
        buff.write(_get_struct_d().pack(_x))
        _v21 = val1.pre_grasp_approach
        _v22 = _v21.direction
        _v23 = _v22.header
        _x = _v23.seq
        buff.write(_get_struct_I().pack(_x))
        _v24 = _v23.stamp
        _x = _v24
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v23.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v25 = _v22.vector
        _x = _v25
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v21
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v26 = val1.post_grasp_retreat
        _v27 = _v26.direction
        _v28 = _v27.header
        _x = _v28.seq
        buff.write(_get_struct_I().pack(_x))
        _v29 = _v28.stamp
        _x = _v29
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v28.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v30 = _v27.vector
        _x = _v30
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v26
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v31 = val1.post_place_retreat
        _v32 = _v31.direction
        _v33 = _v32.header
        _x = _v33.seq
        buff.write(_get_struct_I().pack(_x))
        _v34 = _v33.stamp
        _x = _v34
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v33.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v35 = _v32.vector
        _x = _v35
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v31
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _x = val1.max_contact_force
        buff.write(_get_struct_f().pack(_x))
        length = len(val1.allowed_touch_objects)
        buff.write(_struct_I.pack(length))
        for val2 in val1.allowed_touch_objects:
          length = len(val2)
          if python3 or type(val2) == unicode:
            val2 = val2.encode('utf-8')
            length = len(val2)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val2))
      length = len(self.movable_obstacles)
      buff.write(_struct_I.pack(length))
      for val1 in self.movable_obstacles:
        _v36 = val1.header
        _x = _v36.seq
        buff.write(_get_struct_I().pack(_x))
        _v37 = _v36.stamp
        _x = _v37
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v36.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _x = val1.id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v38 = val1.type
        _x = _v38.key
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _x = _v38.db
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(val1.primitives)
        buff.write(_struct_I.pack(length))
        for val2 in val1.primitives:
          _x = val2.type
          buff.write(_get_struct_B().pack(_x))
          length = len(val2.dimensions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val2.dimensions))
        length = len(val1.primitive_poses)
        buff.write(_struct_I.pack(length))
        for val2 in val1.primitive_poses:
          _v39 = val2.position
          _x = _v39
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v40 = val2.orientation
          _x = _v40
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(val1.meshes)
        buff.write(_struct_I.pack(length))
        for val2 in val1.meshes:
          length = len(val2.triangles)
          buff.write(_struct_I.pack(length))
          for val3 in val2.triangles:
            buff.write(_get_struct_3I().pack(*val3.vertex_indices))
          length = len(val2.vertices)
          buff.write(_struct_I.pack(length))
          for val3 in val2.vertices:
            _x = val3
            buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        length = len(val1.mesh_poses)
        buff.write(_struct_I.pack(length))
        for val2 in val1.mesh_poses:
          _v41 = val2.position
          _x = _v41
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v42 = val2.orientation
          _x = _v42
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(val1.planes)
        buff.write(_struct_I.pack(length))
        for val2 in val1.planes:
          buff.write(_get_struct_4d().pack(*val2.coef))
        length = len(val1.plane_poses)
        buff.write(_struct_I.pack(length))
        for val2 in val1.plane_poses:
          _v43 = val2.position
          _x = _v43
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v44 = val2.orientation
          _x = _v44
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.operation
        buff.write(_get_struct_b().pack(_x))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.target is None:
        self.target = moveit_msgs.msg.CollisionObject()
      if self.candidate_grasps is None:
        self.candidate_grasps = None
      if self.movable_obstacles is None:
        self.movable_obstacles = None
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.group_name = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.group_name = str[start:end]
      _x = self
      start = end
      end += 12
      (_x.target.header.seq, _x.target.header.stamp.secs, _x.target.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.header.frame_id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.type.key = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.type.key = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.type.db = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.type.db = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.primitives = []
      for i in range(0, length):
        val1 = shape_msgs.msg.SolidPrimitive()
        start = end
        end += 1
        (val1.type,) = _get_struct_B().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sd'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.dimensions = s.unpack(str[start:end])
        self.target.primitives.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.primitive_poses = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Pose()
        _v45 = val1.position
        _x = _v45
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v46 = val1.orientation
        _x = _v46
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.target.primitive_poses.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.meshes = []
      for i in range(0, length):
        val1 = shape_msgs.msg.Mesh()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.triangles = []
        for i in range(0, length):
          val2 = shape_msgs.msg.MeshTriangle()
          start = end
          end += 12
          val2.vertex_indices = _get_struct_3I().unpack(str[start:end])
          val1.triangles.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.vertices = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Point()
          _x = val2
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          val1.vertices.append(val2)
        self.target.meshes.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.mesh_poses = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Pose()
        _v47 = val1.position
        _x = _v47
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v48 = val1.orientation
        _x = _v48
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.target.mesh_poses.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.planes = []
      for i in range(0, length):
        val1 = shape_msgs.msg.Plane()
        start = end
        end += 32
        val1.coef = _get_struct_4d().unpack(str[start:end])
        self.target.planes.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.plane_poses = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Pose()
        _v49 = val1.position
        _x = _v49
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v50 = val1.orientation
        _x = _v50
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.target.plane_poses.append(val1)
      start = end
      end += 1
      (self.target.operation,) = _get_struct_b().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.support_surfaces = []
      for i in range(0, length):
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1 = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1 = str[start:end]
        self.support_surfaces.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.candidate_grasps = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.Grasp()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.id = str[start:end]
        _v51 = val1.pre_grasp_posture
        _v52 = _v51.header
        start = end
        end += 4
        (_v52.seq,) = _get_struct_I().unpack(str[start:end])
        _v53 = _v52.stamp
        _x = _v53
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v52.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v52.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v51.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v51.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v51.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = s.unpack(str[start:end])
          _v54 = val3.time_from_start
          _x = _v54
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v51.points.append(val3)
        _v55 = val1.grasp_posture
        _v56 = _v55.header
        start = end
        end += 4
        (_v56.seq,) = _get_struct_I().unpack(str[start:end])
        _v57 = _v56.stamp
        _x = _v57
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v56.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v56.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v55.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v55.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v55.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = s.unpack(str[start:end])
          _v58 = val3.time_from_start
          _x = _v58
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v55.points.append(val3)
        _v59 = val1.grasp_pose
        _v60 = _v59.header
        start = end
        end += 4
        (_v60.seq,) = _get_struct_I().unpack(str[start:end])
        _v61 = _v60.stamp
        _x = _v61
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v60.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v60.frame_id = str[start:end]
        _v62 = _v59.pose
        _v63 = _v62.position
        _x = _v63
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v64 = _v62.orientation
        _x = _v64
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        start = end
        end += 8
        (val1.grasp_quality,) = _get_struct_d().unpack(str[start:end])
        _v65 = val1.pre_grasp_approach
        _v66 = _v65.direction
        _v67 = _v66.header
        start = end
        end += 4
        (_v67.seq,) = _get_struct_I().unpack(str[start:end])
        _v68 = _v67.stamp
        _x = _v68
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v67.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v67.frame_id = str[start:end]
        _v69 = _v66.vector
        _x = _v69
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v65
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v70 = val1.post_grasp_retreat
        _v71 = _v70.direction
        _v72 = _v71.header
        start = end
        end += 4
        (_v72.seq,) = _get_struct_I().unpack(str[start:end])
        _v73 = _v72.stamp
        _x = _v73
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v72.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v72.frame_id = str[start:end]
        _v74 = _v71.vector
        _x = _v74
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v70
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v75 = val1.post_place_retreat
        _v76 = _v75.direction
        _v77 = _v76.header
        start = end
        end += 4
        (_v77.seq,) = _get_struct_I().unpack(str[start:end])
        _v78 = _v77.stamp
        _x = _v78
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v77.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v77.frame_id = str[start:end]
        _v79 = _v76.vector
        _x = _v79
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v75
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        start = end
        end += 4
        (val1.max_contact_force,) = _get_struct_f().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.allowed_touch_objects = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val2 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val2 = str[start:end]
          val1.allowed_touch_objects.append(val2)
        self.candidate_grasps.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.movable_obstacles = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.CollisionObject()
        _v80 = val1.header
        start = end
        end += 4
        (_v80.seq,) = _get_struct_I().unpack(str[start:end])
        _v81 = _v80.stamp
        _x = _v81
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v80.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v80.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.id = str[start:end]
        _v82 = val1.type
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v82.key = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v82.key = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v82.db = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v82.db = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.primitives = []
        for i in range(0, length):
          val2 = shape_msgs.msg.SolidPrimitive()
          start = end
          end += 1
          (val2.type,) = _get_struct_B().unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.dimensions = s.unpack(str[start:end])
          val1.primitives.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.primitive_poses = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Pose()
          _v83 = val2.position
          _x = _v83
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v84 = val2.orientation
          _x = _v84
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          val1.primitive_poses.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.meshes = []
        for i in range(0, length):
          val2 = shape_msgs.msg.Mesh()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.triangles = []
          for i in range(0, length):
            val3 = shape_msgs.msg.MeshTriangle()
            start = end
            end += 12
            val3.vertex_indices = _get_struct_3I().unpack(str[start:end])
            val2.triangles.append(val3)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.vertices = []
          for i in range(0, length):
            val3 = geometry_msgs.msg.Point()
            _x = val3
            start = end
            end += 24
            (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
            val2.vertices.append(val3)
          val1.meshes.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.mesh_poses = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Pose()
          _v85 = val2.position
          _x = _v85
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v86 = val2.orientation
          _x = _v86
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          val1.mesh_poses.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.planes = []
        for i in range(0, length):
          val2 = shape_msgs.msg.Plane()
          start = end
          end += 32
          val2.coef = _get_struct_4d().unpack(str[start:end])
          val1.planes.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.plane_poses = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Pose()
          _v87 = val2.position
          _x = _v87
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v88 = val2.orientation
          _x = _v88
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          val1.plane_poses.append(val2)
        start = end
        end += 1
        (val1.operation,) = _get_struct_b().unpack(str[start:end])
        self.movable_obstacles.append(val1)
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e)  # most likely buffer underfill


  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    :param buff: buffer, ``StringIO``
    :param numpy: numpy python module
    """
    try:
      _x = self.group_name
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self
      buff.write(_get_struct_3I().pack(_x.target.header.seq, _x.target.header.stamp.secs, _x.target.header.stamp.nsecs))
      _x = self.target.header.frame_id
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self.target.id
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self.target.type.key
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self.target.type.db
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      length = len(self.target.primitives)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.primitives:
        _x = val1.type
        buff.write(_get_struct_B().pack(_x))
        length = len(val1.dimensions)
        buff.write(_struct_I.pack(length))
        pattern = '<%sd'%length
        buff.write(val1.dimensions.tostring())
      length = len(self.target.primitive_poses)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.primitive_poses:
        _v89 = val1.position
        _x = _v89
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v90 = val1.orientation
        _x = _v90
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.target.meshes)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.meshes:
        length = len(val1.triangles)
        buff.write(_struct_I.pack(length))
        for val2 in val1.triangles:
          buff.write(val2.vertex_indices.tostring())
        length = len(val1.vertices)
        buff.write(_struct_I.pack(length))
        for val2 in val1.vertices:
          _x = val2
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.target.mesh_poses)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.mesh_poses:
        _v91 = val1.position
        _x = _v91
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v92 = val1.orientation
        _x = _v92
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.target.planes)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.planes:
        buff.write(val1.coef.tostring())
      length = len(self.target.plane_poses)
      buff.write(_struct_I.pack(length))
      for val1 in self.target.plane_poses:
        _v93 = val1.position
        _x = _v93
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v94 = val1.orientation
        _x = _v94
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      _x = self.target.operation
      buff.write(_get_struct_b().pack(_x))
      length = len(self.support_surfaces)
      buff.write(_struct_I.pack(length))
      for val1 in self.support_surfaces:
        length = len(val1)
        if python3 or type(val1) == unicode:
          val1 = val1.encode('utf-8')
          length = len(val1)
        buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
      length = len(self.candidate_grasps)
      buff.write(_struct_I.pack(length))
      for val1 in self.candidate_grasps:
        _x = val1.id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v95 = val1.pre_grasp_posture
        _v96 = _v95.header
        _x = _v96.seq
        buff.write(_get_struct_I().pack(_x))
        _v97 = _v96.stamp
        _x = _v97
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v96.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v95.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v95.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v95.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v95.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.positions.tostring())
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.velocities.tostring())
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.accelerations.tostring())
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.effort.tostring())
          _v98 = val3.time_from_start
          _x = _v98
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v99 = val1.grasp_posture
        _v100 = _v99.header
        _x = _v100.seq
        buff.write(_get_struct_I().pack(_x))
        _v101 = _v100.stamp
        _x = _v101
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v100.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v99.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v99.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v99.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v99.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.positions.tostring())
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.velocities.tostring())
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.accelerations.tostring())
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.effort.tostring())
          _v102 = val3.time_from_start
          _x = _v102
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v103 = val1.grasp_pose
        _v104 = _v103.header
        _x = _v104.seq
        buff.write(_get_struct_I().pack(_x))
        _v105 = _v104.stamp
        _x = _v105
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v104.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v106 = _v103.pose
        _v107 = _v106.position
        _x = _v107
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v108 = _v106.orientation
        _x = _v108
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.grasp_quality
        buff.write(_get_struct_d().pack(_x))
        _v109 = val1.pre_grasp_approach
        _v110 = _v109.direction
        _v111 = _v110.header
        _x = _v111.seq
        buff.write(_get_struct_I().pack(_x))
        _v112 = _v111.stamp
        _x = _v112
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v111.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v113 = _v110.vector
        _x = _v113
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v109
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v114 = val1.post_grasp_retreat
        _v115 = _v114.direction
        _v116 = _v115.header
        _x = _v116.seq
        buff.write(_get_struct_I().pack(_x))
        _v117 = _v116.stamp
        _x = _v117
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v116.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v118 = _v115.vector
        _x = _v118
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v114
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v119 = val1.post_place_retreat
        _v120 = _v119.direction
        _v121 = _v120.header
        _x = _v121.seq
        buff.write(_get_struct_I().pack(_x))
        _v122 = _v121.stamp
        _x = _v122
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v121.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v123 = _v120.vector
        _x = _v123
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v119
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _x = val1.max_contact_force
        buff.write(_get_struct_f().pack(_x))
        length = len(val1.allowed_touch_objects)
        buff.write(_struct_I.pack(length))
        for val2 in val1.allowed_touch_objects:
          length = len(val2)
          if python3 or type(val2) == unicode:
            val2 = val2.encode('utf-8')
            length = len(val2)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val2))
      length = len(self.movable_obstacles)
      buff.write(_struct_I.pack(length))
      for val1 in self.movable_obstacles:
        _v124 = val1.header
        _x = _v124.seq
        buff.write(_get_struct_I().pack(_x))
        _v125 = _v124.stamp
        _x = _v125
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v124.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _x = val1.id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v126 = val1.type
        _x = _v126.key
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _x = _v126.db
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(val1.primitives)
        buff.write(_struct_I.pack(length))
        for val2 in val1.primitives:
          _x = val2.type
          buff.write(_get_struct_B().pack(_x))
          length = len(val2.dimensions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val2.dimensions.tostring())
        length = len(val1.primitive_poses)
        buff.write(_struct_I.pack(length))
        for val2 in val1.primitive_poses:
          _v127 = val2.position
          _x = _v127
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v128 = val2.orientation
          _x = _v128
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(val1.meshes)
        buff.write(_struct_I.pack(length))
        for val2 in val1.meshes:
          length = len(val2.triangles)
          buff.write(_struct_I.pack(length))
          for val3 in val2.triangles:
            buff.write(val3.vertex_indices.tostring())
          length = len(val2.vertices)
          buff.write(_struct_I.pack(length))
          for val3 in val2.vertices:
            _x = val3
            buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        length = len(val1.mesh_poses)
        buff.write(_struct_I.pack(length))
        for val2 in val1.mesh_poses:
          _v129 = val2.position
          _x = _v129
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v130 = val2.orientation
          _x = _v130
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(val1.planes)
        buff.write(_struct_I.pack(length))
        for val2 in val1.planes:
          buff.write(val2.coef.tostring())
        length = len(val1.plane_poses)
        buff.write(_struct_I.pack(length))
        for val2 in val1.plane_poses:
          _v131 = val2.position
          _x = _v131
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v132 = val2.orientation
          _x = _v132
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.operation
        buff.write(_get_struct_b().pack(_x))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    :param str: byte array of serialized message, ``str``
    :param numpy: numpy python module
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.target is None:
        self.target = moveit_msgs.msg.CollisionObject()
      if self.candidate_grasps is None:
        self.candidate_grasps = None
      if self.movable_obstacles is None:
        self.movable_obstacles = None
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.group_name = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.group_name = str[start:end]
      _x = self
      start = end
      end += 12
      (_x.target.header.seq, _x.target.header.stamp.secs, _x.target.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.header.frame_id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.type.key = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.type.key = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.target.type.db = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.target.type.db = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.primitives = []
      for i in range(0, length):
        val1 = shape_msgs.msg.SolidPrimitive()
        start = end
        end += 1
        (val1.type,) = _get_struct_B().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sd'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
        self.target.primitives.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.primitive_poses = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Pose()
        _v133 = val1.position
        _x = _v133
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v134 = val1.orientation
        _x = _v134
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.target.primitive_poses.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.meshes = []
      for i in range(0, length):
        val1 = shape_msgs.msg.Mesh()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.triangles = []
        for i in range(0, length):
          val2 = shape_msgs.msg.MeshTriangle()
          start = end
          end += 12
          val2.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
          val1.triangles.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.vertices = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Point()
          _x = val2
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          val1.vertices.append(val2)
        self.target.meshes.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.mesh_poses = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Pose()
        _v135 = val1.position
        _x = _v135
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v136 = val1.orientation
        _x = _v136
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.target.mesh_poses.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.planes = []
      for i in range(0, length):
        val1 = shape_msgs.msg.Plane()
        start = end
        end += 32
        val1.coef = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=4)
        self.target.planes.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.target.plane_poses = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Pose()
        _v137 = val1.position
        _x = _v137
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v138 = val1.orientation
        _x = _v138
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.target.plane_poses.append(val1)
      start = end
      end += 1
      (self.target.operation,) = _get_struct_b().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.support_surfaces = []
      for i in range(0, length):
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1 = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1 = str[start:end]
        self.support_surfaces.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.candidate_grasps = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.Grasp()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.id = str[start:end]
        _v139 = val1.pre_grasp_posture
        _v140 = _v139.header
        start = end
        end += 4
        (_v140.seq,) = _get_struct_I().unpack(str[start:end])
        _v141 = _v140.stamp
        _x = _v141
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v140.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v140.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v139.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v139.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v139.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          _v142 = val3.time_from_start
          _x = _v142
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v139.points.append(val3)
        _v143 = val1.grasp_posture
        _v144 = _v143.header
        start = end
        end += 4
        (_v144.seq,) = _get_struct_I().unpack(str[start:end])
        _v145 = _v144.stamp
        _x = _v145
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v144.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v144.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v143.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v143.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v143.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          _v146 = val3.time_from_start
          _x = _v146
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v143.points.append(val3)
        _v147 = val1.grasp_pose
        _v148 = _v147.header
        start = end
        end += 4
        (_v148.seq,) = _get_struct_I().unpack(str[start:end])
        _v149 = _v148.stamp
        _x = _v149
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v148.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v148.frame_id = str[start:end]
        _v150 = _v147.pose
        _v151 = _v150.position
        _x = _v151
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v152 = _v150.orientation
        _x = _v152
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        start = end
        end += 8
        (val1.grasp_quality,) = _get_struct_d().unpack(str[start:end])
        _v153 = val1.pre_grasp_approach
        _v154 = _v153.direction
        _v155 = _v154.header
        start = end
        end += 4
        (_v155.seq,) = _get_struct_I().unpack(str[start:end])
        _v156 = _v155.stamp
        _x = _v156
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v155.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v155.frame_id = str[start:end]
        _v157 = _v154.vector
        _x = _v157
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v153
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v158 = val1.post_grasp_retreat
        _v159 = _v158.direction
        _v160 = _v159.header
        start = end
        end += 4
        (_v160.seq,) = _get_struct_I().unpack(str[start:end])
        _v161 = _v160.stamp
        _x = _v161
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v160.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v160.frame_id = str[start:end]
        _v162 = _v159.vector
        _x = _v162
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v158
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v163 = val1.post_place_retreat
        _v164 = _v163.direction
        _v165 = _v164.header
        start = end
        end += 4
        (_v165.seq,) = _get_struct_I().unpack(str[start:end])
        _v166 = _v165.stamp
        _x = _v166
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v165.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v165.frame_id = str[start:end]
        _v167 = _v164.vector
        _x = _v167
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v163
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        start = end
        end += 4
        (val1.max_contact_force,) = _get_struct_f().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.allowed_touch_objects = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val2 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val2 = str[start:end]
          val1.allowed_touch_objects.append(val2)
        self.candidate_grasps.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.movable_obstacles = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.CollisionObject()
        _v168 = val1.header
        start = end
        end += 4
        (_v168.seq,) = _get_struct_I().unpack(str[start:end])
        _v169 = _v168.stamp
        _x = _v169
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v168.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v168.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.id = str[start:end]
        _v170 = val1.type
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v170.key = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v170.key = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v170.db = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v170.db = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.primitives = []
        for i in range(0, length):
          val2 = shape_msgs.msg.SolidPrimitive()
          start = end
          end += 1
          (val2.type,) = _get_struct_B().unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          val1.primitives.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.primitive_poses = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Pose()
          _v171 = val2.position
          _x = _v171
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v172 = val2.orientation
          _x = _v172
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          val1.primitive_poses.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.meshes = []
        for i in range(0, length):
          val2 = shape_msgs.msg.Mesh()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.triangles = []
          for i in range(0, length):
            val3 = shape_msgs.msg.MeshTriangle()
            start = end
            end += 12
            val3.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
            val2.triangles.append(val3)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.vertices = []
          for i in range(0, length):
            val3 = geometry_msgs.msg.Point()
            _x = val3
            start = end
            end += 24
            (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
            val2.vertices.append(val3)
          val1.meshes.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.mesh_poses = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Pose()
          _v173 = val2.position
          _x = _v173
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v174 = val2.orientation
          _x = _v174
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          val1.mesh_poses.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.planes = []
        for i in range(0, length):
          val2 = shape_msgs.msg.Plane()
          start = end
          end += 32
          val2.coef = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=4)
          val1.planes.append(val2)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.plane_poses = []
        for i in range(0, length):
          val2 = geometry_msgs.msg.Pose()
          _v175 = val2.position
          _x = _v175
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v176 = val2.orientation
          _x = _v176
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          val1.plane_poses.append(val2)
        start = end
        end += 1
        (val1.operation,) = _get_struct_b().unpack(str[start:end])
        self.movable_obstacles.append(val1)
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e)  # most likely buffer underfill

_struct_I = genpy.struct_I
def _get_struct_I():
    global _struct_I
    return _struct_I
_struct_2I = None
def _get_struct_2I():
    global _struct_2I
    if _struct_2I is None:
        _struct_2I = struct.Struct("<2I")
    return _struct_2I
_struct_2f = None
def _get_struct_2f():
    global _struct_2f
    if _struct_2f is None:
        _struct_2f = struct.Struct("<2f")
    return _struct_2f
_struct_2i = None
def _get_struct_2i():
    global _struct_2i
    if _struct_2i is None:
        _struct_2i = struct.Struct("<2i")
    return _struct_2i
_struct_3I = None
def _get_struct_3I():
    global _struct_3I
    if _struct_3I is None:
        _struct_3I = struct.Struct("<3I")
    return _struct_3I
_struct_3d = None
def _get_struct_3d():
    global _struct_3d
    if _struct_3d is None:
        _struct_3d = struct.Struct("<3d")
    return _struct_3d
_struct_4d = None
def _get_struct_4d():
    global _struct_4d
    if _struct_4d is None:
        _struct_4d = struct.Struct("<4d")
    return _struct_4d
_struct_B = None
def _get_struct_B():
    global _struct_B
    if _struct_B is None:
        _struct_B = struct.Struct("<B")
    return _struct_B
_struct_b = None
def _get_struct_b():
    global _struct_b
    if _struct_b is None:
        _struct_b = struct.Struct("<b")
    return _struct_b
_struct_d = None
def _get_struct_d():
    global _struct_d
    if _struct_d is None:
        _struct_d = struct.Struct("<d")
    return _struct_d
_struct_f = None
def _get_struct_f():
    global _struct_f
    if _struct_f is None:
        _struct_f = struct.Struct("<f")
    return _struct_f
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from moveit_msgs/GraspPlanningResponse.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

import genpy
import geometry_msgs.msg
import moveit_msgs.msg
import std_msgs.msg
import trajectory_msgs.msg

class GraspPlanningResponse(genpy.Message):
  _md5sum = "bb8169d403b6e9f96bf61e22a50d13ae"
  _type = "moveit_msgs/GraspPlanningResponse"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """
# the list of planned grasps
Grasp[] grasps

# whether an error occurred
MoveItErrorCodes error_code


================================================================================
MSG: moveit_msgs/Grasp
# This message contains a description of a grasp that would be used
# with a particular end-effector to grasp an object, including how to
# approach it, grip it, etc.  This message does not contain any
# information about a "grasp point" (a position ON the object).
# Whatever generates this message should have already combined
# information about grasp points with information about the geometry
# of the end-effector to compute the grasp_pose in this message.

# A name for this grasp
string id

# The internal posture of the hand for the pre-grasp
# only positions are used
trajectory_msgs/JointTrajectory pre_grasp_posture

# The internal posture of the hand for the grasp
# positions and efforts are used
trajectory_msgs/JointTrajectory grasp_posture

# The position of the end-effector for the grasp.  This is the pose of
# the "parent_link" of the end-effector, not actually the pose of any
# link *in* the end-effector.  Typically this would be the pose of the
# most distal wrist link before the hand (end-effector) links began.
geometry_msgs/PoseStamped grasp_pose

# The estimated probability of success for this grasp, or some other
# measure of how "good" it is.
float64 grasp_quality

# The approach direction to take before picking an object
GripperTranslation pre_grasp_approach

# The retreat direction to take after a grasp has been completed (object is attached)
GripperTranslation post_grasp_retreat

# The retreat motion to perform when releasing the object; this information
# is not necessary for the grasp itself, but when releasing the object,
# the information will be necessary. The grasp used to perform a pickup
# is returned as part of the result, so this information is available for 
# later use.
GripperTranslation post_place_retreat

# the maximum contact force to use while grasping (<=0 to disable)
float32 max_contact_force

# an optional list of obstacles that we have semantic information about
# and that can be touched/pushed/moved in the course of grasping
string[] allowed_touch_objects

================================================================================
MSG: trajectory_msgs/JointTrajectory
Header header
string[] joint_names
JointTrajectoryPoint[] points

================================================================================
MSG: std_msgs/Header
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data 
# in a particular coordinate frame.
# 
# sequence ID: consecutively increasing ID 
uint32 seq
#Two-integer timestamp that is expressed as:
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
# time-handling sugar is provided by the client library
time stamp
#Frame this data is associated with
string frame_id

================================================================================
MSG: trajectory_msgs/JointTrajectoryPoint
# Each trajectory point specifies either positions[, velocities[, accelerations]]
# or positions[, effort] for the trajectory to be executed.
# All specified values are in the same order as the joint names in JointTrajectory.msg

float64[] positions
float64[] velocities
float64[] accelerations
float64[] effort
duration time_from_start

================================================================================
MSG: geometry_msgs/PoseStamped
# A Pose with reference coordinate frame and timestamp
Header header
Pose pose

================================================================================
MSG: geometry_msgs/Pose
# A representation of pose in free space, composed of position and orientation. 
Point position
Quaternion orientation

================================================================================
MSG: geometry_msgs/Point
# This contains the position of a point in free space
float64 x
float64 y
float64 z

================================================================================
MSG: geometry_msgs/Quaternion
# This represents an orientation in free space in quaternion form.

float64 x
float64 y
float64 z
float64 w

================================================================================
MSG: moveit_msgs/GripperTranslation
# defines a translation for the gripper, used in pickup or place tasks
# for example for lifting an object off a table or approaching the table for placing

# the direction of the translation
geometry_msgs/Vector3Stamped direction

# the desired translation distance
float32 desired_distance

# the min distance that must be considered feasible before the
# grasp is even attempted
float32 min_distance

================================================================================
MSG: geometry_msgs/Vector3Stamped
# This represents a Vector3 with reference coordinate frame and timestamp
Header header
Vector3 vector

================================================================================
MSG: geometry_msgs/Vector3
# This represents a vector in free space. 
# It is only meant to represent a direction. Therefore, it does not
# make sense to apply a translation to it (e.g., when applying a 
# generic rigid transformation to a Vector3, tf2 will only apply the
# rotation). If you want your data to be translatable too, use the
# geometry_msgs/Point message instead.

float64 x
float64 y
float64 z
================================================================================
MSG: moveit_msgs/MoveItErrorCodes
int32 val

# overall behavior
int32 SUCCESS=1
int32 FAILURE=99999

int32 PLANNING_FAILED=-1
int32 INVALID_MOTION_PLAN=-2
int32 MOTION_PLAN_INVALIDATED_BY_ENVIRONMENT_CHANGE=-3
int32 CONTROL_FAILED=-4
int32 UNABLE_TO_AQUIRE_SENSOR_DATA=-5
int32 TIMED_OUT=-6
int32 PREEMPTED=-7

# planning & kinematics request errors
int32 START_STATE_IN_COLLISION=-10
int32 START_STATE_VIOLATES_PATH_CONSTRAINTS=-11

int32 GOAL_IN_COLLISION=-12
int32 GOAL_VIOLATES_PATH_CONSTRAINTS=-13
int32 GOAL_CONSTRAINTS_VIOLATED=-14

int32 INVALID_GROUP_NAME=-15
int32 INVALID_GOAL_CONSTRAINTS=-16
int32 INVALID_ROBOT_STATE=-17
int32 INVALID_LINK_NAME=-18
int32 INVALID_OBJECT_NAME=-19

# system errors
int32 FRAME_TRANSFORM_FAILURE=-21
int32 COLLISION_CHECKING_UNAVAILABLE=-22
int32 ROBOT_STATE_STALE=-23
int32 SENSOR_INFO_STALE=-24

# kinematics errors
int32 NO_IK_SOLUTION=-31
"""
  __slots__ = ['grasps','error_code']
  _slot_types = ['moveit_msgs/Grasp[]','moveit_msgs/MoveItErrorCodes']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.

    The available fields are:
       grasps,error_code

    :param args: complete set of field values, in .msg order
    :param kwds: use keyword arguments corresponding to message field names
    to set specific fields.
    """
    if args or kwds:
      super(GraspPlanningResponse, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.grasps is None:
        self.grasps = []
      if self.error_code is None:
        self.error_code = moveit_msgs.msg.MoveItErrorCodes()
    else:
      self.grasps = []
      self.error_code = moveit_msgs.msg.MoveItErrorCodes()

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      length = len(self.grasps)
      buff.write(_struct_I.pack(length))
      for val1 in self.grasps:
        _x = val1.id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v177 = val1.pre_grasp_posture
        _v178 = _v177.header
        _x = _v178.seq
        buff.write(_get_struct_I().pack(_x))
        _v179 = _v178.stamp
        _x = _v179
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v178.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v177.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v177.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v177.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v177.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.positions))
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.velocities))
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.accelerations))
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.effort))
          _v180 = val3.time_from_start
          _x = _v180
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v181 = val1.grasp_posture
        _v182 = _v181.header
        _x = _v182.seq
        buff.write(_get_struct_I().pack(_x))
        _v183 = _v182.stamp
        _x = _v183
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v182.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v181.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v181.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v181.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v181.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.positions))
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.velocities))
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.accelerations))
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.effort))
          _v184 = val3.time_from_start
          _x = _v184
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v185 = val1.grasp_pose
        _v186 = _v185.header
        _x = _v186.seq
        buff.write(_get_struct_I().pack(_x))
        _v187 = _v186.stamp
        _x = _v187
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v186.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v188 = _v185.pose
        _v189 = _v188.position
        _x = _v189
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v190 = _v188.orientation
        _x = _v190
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.grasp_quality
        buff.write(_get_struct_d().pack(_x))
        _v191 = val1.pre_grasp_approach
        _v192 = _v191.direction
        _v193 = _v192.header
        _x = _v193.seq
        buff.write(_get_struct_I().pack(_x))
        _v194 = _v193.stamp
        _x = _v194
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v193.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v195 = _v192.vector
        _x = _v195
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v191
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v196 = val1.post_grasp_retreat
        _v197 = _v196.direction
        _v198 = _v197.header
        _x = _v198.seq
        buff.write(_get_struct_I().pack(_x))
        _v199 = _v198.stamp
        _x = _v199
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v198.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v200 = _v197.vector
        _x = _v200
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v196
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v201 = val1.post_place_retreat
        _v202 = _v201.direction
        _v203 = _v202.header
        _x = _v203.seq
        buff.write(_get_struct_I().pack(_x))
        _v204 = _v203.stamp
        _x = _v204
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v203.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v205 = _v202.vector
        _x = _v205
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v201
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _x = val1.max_contact_force
        buff.write(_get_struct_f().pack(_x))
        length = len(val1.allowed_touch_objects)
        buff.write(_struct_I.pack(length))
        for val2 in val1.allowed_touch_objects:
          length = len(val2)
          if python3 or type(val2) == unicode:
            val2 = val2.encode('utf-8')
            length = len(val2)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val2))
      _x = self.error_code.val
      buff.write(_get_struct_i().pack(_x))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.grasps is None:
        self.grasps = None
      if self.error_code is None:
        self.error_code = moveit_msgs.msg.MoveItErrorCodes()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.grasps = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.Grasp()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.id = str[start:end]
        _v206 = val1.pre_grasp_posture
        _v207 = _v206.header
        start = end
        end += 4
        (_v207.seq,) = _get_struct_I().unpack(str[start:end])
        _v208 = _v207.stamp
        _x = _v208
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v207.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v207.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v206.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v206.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v206.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = s.unpack(str[start:end])
          _v209 = val3.time_from_start
          _x = _v209
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v206.points.append(val3)
        _v210 = val1.grasp_posture
        _v211 = _v210.header
        start = end
        end += 4
        (_v211.seq,) = _get_struct_I().unpack(str[start:end])
        _v212 = _v211.stamp
        _x = _v212
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v211.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v211.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v210.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v210.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v210.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = s.unpack(str[start:end])
          _v213 = val3.time_from_start
          _x = _v213
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v210.points.append(val3)
        _v214 = val1.grasp_pose
        _v215 = _v214.header
        start = end
        end += 4
        (_v215.seq,) = _get_struct_I().unpack(str[start:end])
        _v216 = _v215.stamp
        _x = _v216
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v215.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v215.frame_id = str[start:end]
        _v217 = _v214.pose
        _v218 = _v217.position
        _x = _v218
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v219 = _v217.orientation
        _x = _v219
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        start = end
        end += 8
        (val1.grasp_quality,) = _get_struct_d().unpack(str[start:end])
        _v220 = val1.pre_grasp_approach
        _v221 = _v220.direction
        _v222 = _v221.header
        start = end
        end += 4
        (_v222.seq,) = _get_struct_I().unpack(str[start:end])
        _v223 = _v222.stamp
        _x = _v223
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v222.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v222.frame_id = str[start:end]
        _v224 = _v221.vector
        _x = _v224
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v220
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v225 = val1.post_grasp_retreat
        _v226 = _v225.direction
        _v227 = _v226.header
        start = end
        end += 4
        (_v227.seq,) = _get_struct_I().unpack(str[start:end])
        _v228 = _v227.stamp
        _x = _v228
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v227.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v227.frame_id = str[start:end]
        _v229 = _v226.vector
        _x = _v229
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v225
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v230 = val1.post_place_retreat
        _v231 = _v230.direction
        _v232 = _v231.header
        start = end
        end += 4
        (_v232.seq,) = _get_struct_I().unpack(str[start:end])
        _v233 = _v232.stamp
        _x = _v233
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v232.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v232.frame_id = str[start:end]
        _v234 = _v231.vector
        _x = _v234
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v230
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        start = end
        end += 4
        (val1.max_contact_force,) = _get_struct_f().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.allowed_touch_objects = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val2 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val2 = str[start:end]
          val1.allowed_touch_objects.append(val2)
        self.grasps.append(val1)
      start = end
      end += 4
      (self.error_code.val,) = _get_struct_i().unpack(str[start:end])
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e)  # most likely buffer underfill


  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    :param buff: buffer, ``StringIO``
    :param numpy: numpy python module
    """
    try:
      length = len(self.grasps)
      buff.write(_struct_I.pack(length))
      for val1 in self.grasps:
        _x = val1.id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v235 = val1.pre_grasp_posture
        _v236 = _v235.header
        _x = _v236.seq
        buff.write(_get_struct_I().pack(_x))
        _v237 = _v236.stamp
        _x = _v237
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v236.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v235.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v235.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v235.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v235.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.positions.tostring())
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.velocities.tostring())
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.accelerations.tostring())
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.effort.tostring())
          _v238 = val3.time_from_start
          _x = _v238
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v239 = val1.grasp_posture
        _v240 = _v239.header
        _x = _v240.seq
        buff.write(_get_struct_I().pack(_x))
        _v241 = _v240.stamp
        _x = _v241
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v240.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        length = len(_v239.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v239.joint_names:
          length = len(val3)
          if python3 or type(val3) == unicode:
            val3 = val3.encode('utf-8')
            length = len(val3)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val3))
        length = len(_v239.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v239.points:
          length = len(val3.positions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.positions.tostring())
          length = len(val3.velocities)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.velocities.tostring())
          length = len(val3.accelerations)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.accelerations.tostring())
          length = len(val3.effort)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.effort.tostring())
          _v242 = val3.time_from_start
          _x = _v242
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _v243 = val1.grasp_pose
        _v244 = _v243.header
        _x = _v244.seq
        buff.write(_get_struct_I().pack(_x))
        _v245 = _v244.stamp
        _x = _v245
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v244.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v246 = _v243.pose
        _v247 = _v246.position
        _x = _v247
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v248 = _v246.orientation
        _x = _v248
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.grasp_quality
        buff.write(_get_struct_d().pack(_x))
        _v249 = val1.pre_grasp_approach
        _v250 = _v249.direction
        _v251 = _v250.header
        _x = _v251.seq
        buff.write(_get_struct_I().pack(_x))
        _v252 = _v251.stamp
        _x = _v252
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v251.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v253 = _v250.vector
        _x = _v253
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v249
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v254 = val1.post_grasp_retreat
        _v255 = _v254.direction
        _v256 = _v255.header
        _x = _v256.seq
        buff.write(_get_struct_I().pack(_x))
        _v257 = _v256.stamp
        _x = _v257
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v256.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v258 = _v255.vector
        _x = _v258
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v254
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _v259 = val1.post_place_retreat
        _v260 = _v259.direction
        _v261 = _v260.header
        _x = _v261.seq
        buff.write(_get_struct_I().pack(_x))
        _v262 = _v261.stamp
        _x = _v262
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v261.frame_id
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
        _v263 = _v260.vector
        _x = _v263
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _x = _v259
        buff.write(_get_struct_2f().pack(_x.desired_distance, _x.min_distance))
        _x = val1.max_contact_force
        buff.write(_get_struct_f().pack(_x))
        length = len(val1.allowed_touch_objects)
        buff.write(_struct_I.pack(length))
        for val2 in val1.allowed_touch_objects:
          length = len(val2)
          if python3 or type(val2) == unicode:
            val2 = val2.encode('utf-8')
            length = len(val2)
          buff.write(struct.Struct('<I%ss'%length).pack(length, val2))
      _x = self.error_code.val
      buff.write(_get_struct_i().pack(_x))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    :param str: byte array of serialized message, ``str``
    :param numpy: numpy python module
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.grasps is None:
        self.grasps = None
      if self.error_code is None:
        self.error_code = moveit_msgs.msg.MoveItErrorCodes()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.grasps = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.Grasp()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.id = str[start:end]
        _v264 = val1.pre_grasp_posture
        _v265 = _v264.header
        start = end
        end += 4
        (_v265.seq,) = _get_struct_I().unpack(str[start:end])
        _v266 = _v265.stamp
        _x = _v266
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v265.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v265.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v264.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v264.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v264.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          _v267 = val3.time_from_start
          _x = _v267
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v264.points.append(val3)
        _v268 = val1.grasp_posture
        _v269 = _v268.header
        start = end
        end += 4
        (_v269.seq,) = _get_struct_I().unpack(str[start:end])
        _v270 = _v269.stamp
        _x = _v270
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v269.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v269.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v268.joint_names = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val3 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val3 = str[start:end]
          _v268.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v268.points = []
        for i in range(0, length):
          val3 = trajectory_msgs.msg.JointTrajectoryPoint()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sd'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val3.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          _v271 = val3.time_from_start
          _x = _v271
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v268.points.append(val3)
        _v272 = val1.grasp_pose
        _v273 = _v272.header
        start = end
        end += 4
        (_v273.seq,) = _get_struct_I().unpack(str[start:end])
        _v274 = _v273.stamp
        _x = _v274
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v273.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v273.frame_id = str[start:end]
        _v275 = _v272.pose
        _v276 = _v275.position
        _x = _v276
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v277 = _v275.orientation
        _x = _v277
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        start = end
        end += 8
        (val1.grasp_quality,) = _get_struct_d().unpack(str[start:end])
        _v278 = val1.pre_grasp_approach
        _v279 = _v278.direction
        _v280 = _v279.header
        start = end
        end += 4
        (_v280.seq,) = _get_struct_I().unpack(str[start:end])
        _v281 = _v280.stamp
        _x = _v281
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v280.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v280.frame_id = str[start:end]
        _v282 = _v279.vector
        _x = _v282
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v278
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v283 = val1.post_grasp_retreat
        _v284 = _v283.direction
        _v285 = _v284.header
        start = end
        end += 4
        (_v285.seq,) = _get_struct_I().unpack(str[start:end])
        _v286 = _v285.stamp
        _x = _v286
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v285.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v285.frame_id = str[start:end]
        _v287 = _v284.vector
        _x = _v287
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v283
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        _v288 = val1.post_place_retreat
        _v289 = _v288.direction
        _v290 = _v289.header
        start = end
        end += 4
        (_v290.seq,) = _get_struct_I().unpack(str[start:end])
        _v291 = _v290.stamp
        _x = _v291
        start = end
        end += 8
        (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v290.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v290.frame_id = str[start:end]
        _v292 = _v289.vector
        _x = _v292
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _x = _v288
        start = end
        end += 8
        (_x.desired_distance, _x.min_distance,) = _get_struct_2f().unpack(str[start:end])
        start = end
        end += 4
        (val1.max_contact_force,) = _get_struct_f().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.allowed_touch_objects = []
        for i in range(0, length):
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          start = end
          end += length
          if python3:
            val2 = str[start:end].decode('utf-8', 'rosmsg')
          else:
            val2 = str[start:end]
          val1.allowed_touch_objects.append(val2)
        self.grasps.append(val1)
      start = end
      end += 4
      (self.error_code.val,) = _get_struct_i().unpack(str[start:end])
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e)  # most likely buffer underfill

_struct_I = genpy.struct_I
def _get_struct_I():
    global _struct_I
    return _struct_I
_struct_2I = None
def _get_struct_2I():
    global _struct_2I
    if _struct_2I is None:
        _struct_2I = struct.Struct("<2I")
    return _struct_2I
_struct_2f = None
def _get_struct_2f():
    global _struct_2f
    if _struct_2f is None:
        _struct_2f = struct.Struct("<2f")
    return _struct_2f
_struct_2i = None
def _get_struct_2i():
    global _struct_2i
    if _struct_2i is None:
        _struct_2i = struct.Struct("<2i")
    return _struct_2i
_struct_3d = None
def _get_struct_3d():
    global _struct_3d
    if _struct_3d is None:
        _struct_3d = struct.Struct("<3d")
    return _struct_3d
_struct_4d = None
def _get_struct_4d():
    global _struct_4d
    if _struct_4d is None:
        _struct_4d = struct.Struct("<4d")
    return _struct_4d
_struct_d = None
def _get_struct_d():
    global _struct_d
    if _struct_d is None:
        _struct_d = struct.Struct("<d")
    return _struct_d
_struct_f = None
def _get_struct_f():
    global _struct_f
    if _struct_f is None:
        _struct_f = struct.Struct("<f")
    return _struct_f
_struct_i = None
def _get_struct_i():
    global _struct_i
    if _struct_i is None:
        _struct_i = struct.Struct("<i")
    return _struct_i
class GraspPlanning(object):
  _type          = 'moveit_msgs/GraspPlanning'
  _md5sum = '6c1eec2555db251f88e13e06d2a82f0f'
  _request_class  = GraspPlanningRequest
  _response_class = GraspPlanningResponse
