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

import moveit_msgs.msg

class GetPlanningSceneRequest(genpy.Message):
  _md5sum = "d81da6c0e5e015646a4efe344f33d7dc"
  _type = "moveit_msgs/GetPlanningSceneRequest"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """# Get parts of the planning scene that are of interest
# All scene components are returned if none are specified
PlanningSceneComponents components

================================================================================
MSG: moveit_msgs/PlanningSceneComponents
# This message defines the components that make up the PlanningScene message.
# The values can be used as a bitfield to specify which parts of the PlanningScene message
# are of interest

# Scene name, model name, model root
uint32 SCENE_SETTINGS=1

# Joint values of the robot state
uint32 ROBOT_STATE=2

# Attached objects (including geometry) for the robot state
uint32 ROBOT_STATE_ATTACHED_OBJECTS=4

# The names of the world objects
uint32 WORLD_OBJECT_NAMES=8

# The geometry of the world objects
uint32 WORLD_OBJECT_GEOMETRY=16

# The maintained octomap 
uint32 OCTOMAP=32

# The maintained list of transforms
uint32 TRANSFORMS=64

# The allowed collision matrix
uint32 ALLOWED_COLLISION_MATRIX=128

# The default link padding and link scaling
uint32 LINK_PADDING_AND_SCALING=256

# The stored object colors
uint32 OBJECT_COLORS=512

# Bitfield combining options indicated above
uint32 components
"""
  __slots__ = ['components']
  _slot_types = ['moveit_msgs/PlanningSceneComponents']

  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:
       components

    :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(GetPlanningSceneRequest, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.components is None:
        self.components = moveit_msgs.msg.PlanningSceneComponents()
    else:
      self.components = moveit_msgs.msg.PlanningSceneComponents()

  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.components.components
      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.components is None:
        self.components = moveit_msgs.msg.PlanningSceneComponents()
      end = 0
      start = end
      end += 4
      (self.components.components,) = _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:
      _x = self.components.components
      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.components is None:
        self.components = moveit_msgs.msg.PlanningSceneComponents()
      end = 0
      start = end
      end += 4
      (self.components.components,) = _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
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from moveit_msgs/GetPlanningSceneResponse.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 octomap_msgs.msg
import sensor_msgs.msg
import shape_msgs.msg
import std_msgs.msg
import trajectory_msgs.msg

class GetPlanningSceneResponse(genpy.Message):
  _md5sum = "7bedc4871b1d0af6ec8b8996db347e7f"
  _type = "moveit_msgs/GetPlanningSceneResponse"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """PlanningScene scene


================================================================================
MSG: moveit_msgs/PlanningScene
# name of planning scene
string name

# full robot state
RobotState robot_state

# The name of the robot model this scene is for
string robot_model_name

#additional frames for duplicating tf (with respect to the planning frame)
geometry_msgs/TransformStamped[] fixed_frame_transforms

#full allowed collision matrix
AllowedCollisionMatrix allowed_collision_matrix

# all link paddings
LinkPadding[] link_padding

# all link scales
LinkScale[] link_scale

# Attached objects, collision objects, even the octomap or collision map can have 
# colors associated to them. This array specifies them.
ObjectColor[] object_colors

# the collision map
PlanningSceneWorld world

# Flag indicating whether this scene is to be interpreted as a diff with respect to some other scene
bool is_diff

================================================================================
MSG: moveit_msgs/RobotState
# This message contains information about the robot state, i.e. the positions of its joints and links
sensor_msgs/JointState joint_state

# Joints that may have multiple DOF are specified here
sensor_msgs/MultiDOFJointState multi_dof_joint_state

# Attached collision objects (attached to some link on the robot)
AttachedCollisionObject[] attached_collision_objects

# Flag indicating whether this scene is to be interpreted as a diff with respect to some other scene
# This is mostly important for handling the attached bodies (whether or not to clear the attached bodies
# of a moveit::core::RobotState before updating it with this message)
bool is_diff

================================================================================
MSG: sensor_msgs/JointState
# This is a message that holds data to describe the state of a set of torque controlled joints. 
#
# The state of each joint (revolute or prismatic) is defined by:
#  * the position of the joint (rad or m),
#  * the velocity of the joint (rad/s or m/s) and 
#  * the effort that is applied in the joint (Nm or N).
#
# Each joint is uniquely identified by its name
# The header specifies the time at which the joint states were recorded. All the joint states
# in one message have to be recorded at the same time.
#
# This message consists of a multiple arrays, one for each part of the joint state. 
# The goal is to make each of the fields optional. When e.g. your joints have no
# effort associated with them, you can leave the effort array empty. 
#
# All arrays in this message should have the same size, or be empty.
# This is the only way to uniquely associate the joint name with the correct
# states.


Header header

string[] name
float64[] position
float64[] velocity
float64[] effort

================================================================================
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: sensor_msgs/MultiDOFJointState
# Representation of state for joints with multiple degrees of freedom, 
# following the structure of JointState.
#
# It is assumed that a joint in a system corresponds to a transform that gets applied 
# along the kinematic chain. For example, a planar joint (as in URDF) is 3DOF (x, y, yaw)
# and those 3DOF can be expressed as a transformation matrix, and that transformation
# matrix can be converted back to (x, y, yaw)
#
# Each joint is uniquely identified by its name
# The header specifies the time at which the joint states were recorded. All the joint states
# in one message have to be recorded at the same time.
#
# This message consists of a multiple arrays, one for each part of the joint state. 
# The goal is to make each of the fields optional. When e.g. your joints have no
# wrench associated with them, you can leave the wrench array empty. 
#
# All arrays in this message should have the same size, or be empty.
# This is the only way to uniquely associate the joint name with the correct
# states.

Header header

string[] joint_names
geometry_msgs/Transform[] transforms
geometry_msgs/Twist[] twist
geometry_msgs/Wrench[] wrench

================================================================================
MSG: geometry_msgs/Transform
# This represents the transform between two coordinate frames in free space.

Vector3 translation
Quaternion rotation

================================================================================
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: geometry_msgs/Quaternion
# This represents an orientation in free space in quaternion form.

float64 x
float64 y
float64 z
float64 w

================================================================================
MSG: geometry_msgs/Twist
# This expresses velocity in free space broken into its linear and angular parts.
Vector3  linear
Vector3  angular

================================================================================
MSG: geometry_msgs/Wrench
# This represents force in free space, separated into
# its linear and angular parts.
Vector3  force
Vector3  torque

================================================================================
MSG: moveit_msgs/AttachedCollisionObject
# The CollisionObject will be attached with a fixed joint to this link
string link_name

#This contains the actual shapes and poses for the CollisionObject
#to be attached to the link
#If action is remove and no object.id is set, all objects
#attached to the link indicated by link_name will be removed
CollisionObject object

# The set of links that the attached objects are allowed to touch
# by default - the link_name is already considered by default
string[] touch_links

# If certain links were placed in a particular posture for this object to remain attached 
# (e.g., an end effector closing around an object), the posture necessary for releasing
# the object is stored here
trajectory_msgs/JointTrajectory detach_posture

# The weight of the attached object, if known
float64 weight

================================================================================
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: 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: 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: 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/TransformStamped
# This expresses a transform from coordinate frame header.frame_id
# to the coordinate frame child_frame_id
#
# This message is mostly used by the 
# <a href="http://wiki.ros.org/tf">tf</a> package. 
# See its documentation for more information.

Header header
string child_frame_id # the frame id of the child frame
Transform transform

================================================================================
MSG: moveit_msgs/AllowedCollisionMatrix
# The list of entry names in the matrix
string[] entry_names

# The individual entries in the allowed collision matrix
# square, symmetric, with same order as entry_names
AllowedCollisionEntry[] entry_values

# In addition to the collision matrix itself, we also have 
# the default entry value for each entry name.

# If the allowed collision flag is queried for a pair of names (n1, n2)
# that is not found in the collision matrix itself, the value of
# the collision flag is considered to be that of the entry (n1 or n2)
# specified in the list below. If both n1 and n2 are found in the list 
# of defaults, the result is computed with an AND operation

string[] default_entry_names
bool[] default_entry_values

================================================================================
MSG: moveit_msgs/AllowedCollisionEntry
# whether or not collision checking is enabled
bool[] enabled

================================================================================
MSG: moveit_msgs/LinkPadding
#name for the link
string link_name

# padding to apply to the link
float64 padding

================================================================================
MSG: moveit_msgs/LinkScale
#name for the link
string link_name

# scaling to apply to the link
float64 scale

================================================================================
MSG: moveit_msgs/ObjectColor
# The object id for which we specify color
string id

# The value of the color
std_msgs/ColorRGBA color

================================================================================
MSG: std_msgs/ColorRGBA
float32 r
float32 g
float32 b
float32 a

================================================================================
MSG: moveit_msgs/PlanningSceneWorld
# collision objects
CollisionObject[] collision_objects

# The octomap that represents additional collision data
octomap_msgs/OctomapWithPose octomap

================================================================================
MSG: octomap_msgs/OctomapWithPose
# A 3D map in binary format, as Octree
Header header

# The pose of the octree with respect to the header frame 
geometry_msgs/Pose origin

# The actual octree msg
octomap_msgs/Octomap octomap

================================================================================
MSG: octomap_msgs/Octomap
# A 3D map in binary format, as Octree
Header header

# Flag to denote a binary (only free/occupied) or full occupancy octree (.bt/.ot file)
bool binary

# Class id of the contained octree 
string id

# Resolution (in m) of the smallest octree nodes
float64 resolution

# binary serialization of octree, use conversions.h to read and write octrees
int8[] data
"""
  __slots__ = ['scene']
  _slot_types = ['moveit_msgs/PlanningScene']

  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:
       scene

    :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(GetPlanningSceneResponse, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.scene is None:
        self.scene = moveit_msgs.msg.PlanningScene()
    else:
      self.scene = moveit_msgs.msg.PlanningScene()

  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.scene.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.scene.robot_state.joint_state.header.seq, _x.scene.robot_state.joint_state.header.stamp.secs, _x.scene.robot_state.joint_state.header.stamp.nsecs))
      _x = self.scene.robot_state.joint_state.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))
      length = len(self.scene.robot_state.joint_state.name)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.joint_state.name:
        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.scene.robot_state.joint_state.position)
      buff.write(_struct_I.pack(length))
      pattern = '<%sd'%length
      buff.write(struct.Struct(pattern).pack(*self.scene.robot_state.joint_state.position))
      length = len(self.scene.robot_state.joint_state.velocity)
      buff.write(_struct_I.pack(length))
      pattern = '<%sd'%length
      buff.write(struct.Struct(pattern).pack(*self.scene.robot_state.joint_state.velocity))
      length = len(self.scene.robot_state.joint_state.effort)
      buff.write(_struct_I.pack(length))
      pattern = '<%sd'%length
      buff.write(struct.Struct(pattern).pack(*self.scene.robot_state.joint_state.effort))
      _x = self
      buff.write(_get_struct_3I().pack(_x.scene.robot_state.multi_dof_joint_state.header.seq, _x.scene.robot_state.multi_dof_joint_state.header.stamp.secs, _x.scene.robot_state.multi_dof_joint_state.header.stamp.nsecs))
      _x = self.scene.robot_state.multi_dof_joint_state.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))
      length = len(self.scene.robot_state.multi_dof_joint_state.joint_names)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.joint_names:
        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.scene.robot_state.multi_dof_joint_state.transforms)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.transforms:
        _v1 = val1.translation
        _x = _v1
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v2 = val1.rotation
        _x = _v2
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.scene.robot_state.multi_dof_joint_state.twist)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.twist:
        _v3 = val1.linear
        _x = _v3
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v4 = val1.angular
        _x = _v4
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.scene.robot_state.multi_dof_joint_state.wrench)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.wrench:
        _v5 = val1.force
        _x = _v5
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v6 = val1.torque
        _x = _v6
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.scene.robot_state.attached_collision_objects)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.attached_collision_objects:
        _x = val1.link_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))
        _v7 = val1.object
        _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))
        _x = _v7.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))
        _v10 = _v7.type
        _x = _v10.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 = _v10.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(_v7.primitives)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.primitives:
          _x = val3.type
          buff.write(_get_struct_B().pack(_x))
          length = len(val3.dimensions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(struct.Struct(pattern).pack(*val3.dimensions))
        length = len(_v7.primitive_poses)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.primitive_poses:
          _v11 = val3.position
          _x = _v11
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v12 = val3.orientation
          _x = _v12
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(_v7.meshes)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.meshes:
          length = len(val3.triangles)
          buff.write(_struct_I.pack(length))
          for val4 in val3.triangles:
            buff.write(_get_struct_3I().pack(*val4.vertex_indices))
          length = len(val3.vertices)
          buff.write(_struct_I.pack(length))
          for val4 in val3.vertices:
            _x = val4
            buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        length = len(_v7.mesh_poses)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.mesh_poses:
          _v13 = val3.position
          _x = _v13
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v14 = val3.orientation
          _x = _v14
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(_v7.planes)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.planes:
          buff.write(_get_struct_4d().pack(*val3.coef))
        length = len(_v7.plane_poses)
        buff.write(_struct_I.pack(length))
        for val3 in _v7.plane_poses:
          _v15 = val3.position
          _x = _v15
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v16 = val3.orientation
          _x = _v16
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = _v7.operation
        buff.write(_get_struct_b().pack(_x))
        length = len(val1.touch_links)
        buff.write(_struct_I.pack(length))
        for val2 in val1.touch_links:
          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))
        _v17 = val1.detach_posture
        _v18 = _v17.header
        _x = _v18.seq
        buff.write(_get_struct_I().pack(_x))
        _v19 = _v18.stamp
        _x = _v19
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v18.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(_v17.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v17.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(_v17.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v17.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))
          _v20 = val3.time_from_start
          _x = _v20
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _x = val1.weight
        buff.write(_get_struct_d().pack(_x))
      _x = self.scene.robot_state.is_diff
      buff.write(_get_struct_B().pack(_x))
      _x = self.scene.robot_model_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))
      length = len(self.scene.fixed_frame_transforms)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.fixed_frame_transforms:
        _v21 = val1.header
        _x = _v21.seq
        buff.write(_get_struct_I().pack(_x))
        _v22 = _v21.stamp
        _x = _v22
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v21.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.child_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))
        _v23 = val1.transform
        _v24 = _v23.translation
        _x = _v24
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v25 = _v23.rotation
        _x = _v25
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.scene.allowed_collision_matrix.entry_names)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.allowed_collision_matrix.entry_names:
        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.scene.allowed_collision_matrix.entry_values)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.allowed_collision_matrix.entry_values:
        length = len(val1.enabled)
        buff.write(_struct_I.pack(length))
        pattern = '<%sB'%length
        buff.write(struct.Struct(pattern).pack(*val1.enabled))
      length = len(self.scene.allowed_collision_matrix.default_entry_names)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.allowed_collision_matrix.default_entry_names:
        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.scene.allowed_collision_matrix.default_entry_values)
      buff.write(_struct_I.pack(length))
      pattern = '<%sB'%length
      buff.write(struct.Struct(pattern).pack(*self.scene.allowed_collision_matrix.default_entry_values))
      length = len(self.scene.link_padding)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.link_padding:
        _x = val1.link_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 = val1.padding
        buff.write(_get_struct_d().pack(_x))
      length = len(self.scene.link_scale)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.link_scale:
        _x = val1.link_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 = val1.scale
        buff.write(_get_struct_d().pack(_x))
      length = len(self.scene.object_colors)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.object_colors:
        _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))
        _v26 = val1.color
        _x = _v26
        buff.write(_get_struct_4f().pack(_x.r, _x.g, _x.b, _x.a))
      length = len(self.scene.world.collision_objects)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.world.collision_objects:
        _v27 = val1.header
        _x = _v27.seq
        buff.write(_get_struct_I().pack(_x))
        _v28 = _v27.stamp
        _x = _v28
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v27.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))
        _v29 = val1.type
        _x = _v29.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 = _v29.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:
          _v30 = val2.position
          _x = _v30
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v31 = val2.orientation
          _x = _v31
          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:
          _v32 = val2.position
          _x = _v32
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v33 = val2.orientation
          _x = _v33
          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:
          _v34 = val2.position
          _x = _v34
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v35 = val2.orientation
          _x = _v35
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.operation
        buff.write(_get_struct_b().pack(_x))
      _x = self
      buff.write(_get_struct_3I().pack(_x.scene.world.octomap.header.seq, _x.scene.world.octomap.header.stamp.secs, _x.scene.world.octomap.header.stamp.nsecs))
      _x = self.scene.world.octomap.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
      buff.write(_get_struct_7d3I().pack(_x.scene.world.octomap.origin.position.x, _x.scene.world.octomap.origin.position.y, _x.scene.world.octomap.origin.position.z, _x.scene.world.octomap.origin.orientation.x, _x.scene.world.octomap.origin.orientation.y, _x.scene.world.octomap.origin.orientation.z, _x.scene.world.octomap.origin.orientation.w, _x.scene.world.octomap.octomap.header.seq, _x.scene.world.octomap.octomap.header.stamp.secs, _x.scene.world.octomap.octomap.header.stamp.nsecs))
      _x = self.scene.world.octomap.octomap.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.scene.world.octomap.octomap.binary
      buff.write(_get_struct_B().pack(_x))
      _x = self.scene.world.octomap.octomap.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.scene.world.octomap.octomap.resolution
      buff.write(_get_struct_d().pack(_x))
      length = len(self.scene.world.octomap.octomap.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sb'%length
      buff.write(struct.Struct(pattern).pack(*self.scene.world.octomap.octomap.data))
      _x = self.scene.is_diff
      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.scene is None:
        self.scene = moveit_msgs.msg.PlanningScene()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.name = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.name = str[start:end]
      _x = self
      start = end
      end += 12
      (_x.scene.robot_state.joint_state.header.seq, _x.scene.robot_state.joint_state.header.stamp.secs, _x.scene.robot_state.joint_state.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.scene.robot_state.joint_state.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.robot_state.joint_state.header.frame_id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.joint_state.name = []
      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.scene.robot_state.joint_state.name.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sd'%length
      start = end
      s = struct.Struct(pattern)
      end += s.size
      self.scene.robot_state.joint_state.position = 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
      self.scene.robot_state.joint_state.velocity = 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
      self.scene.robot_state.joint_state.effort = s.unpack(str[start:end])
      _x = self
      start = end
      end += 12
      (_x.scene.robot_state.multi_dof_joint_state.header.seq, _x.scene.robot_state.multi_dof_joint_state.header.stamp.secs, _x.scene.robot_state.multi_dof_joint_state.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.scene.robot_state.multi_dof_joint_state.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.robot_state.multi_dof_joint_state.header.frame_id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.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:
          val1 = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1 = str[start:end]
        self.scene.robot_state.multi_dof_joint_state.joint_names.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.transforms = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Transform()
        _v36 = val1.translation
        _x = _v36
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v37 = val1.rotation
        _x = _v37
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.scene.robot_state.multi_dof_joint_state.transforms.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.twist = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Twist()
        _v38 = val1.linear
        _x = _v38
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v39 = val1.angular
        _x = _v39
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        self.scene.robot_state.multi_dof_joint_state.twist.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.wrench = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Wrench()
        _v40 = val1.force
        _x = _v40
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v41 = val1.torque
        _x = _v41
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        self.scene.robot_state.multi_dof_joint_state.wrench.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.attached_collision_objects = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.AttachedCollisionObject()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.link_name = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.link_name = str[start:end]
        _v42 = val1.object
        _v43 = _v42.header
        start = end
        end += 4
        (_v43.seq,) = _get_struct_I().unpack(str[start:end])
        _v44 = _v43.stamp
        _x = _v44
        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:
          _v43.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v43.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v42.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v42.id = str[start:end]
        _v45 = _v42.type
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v45.key = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v45.key = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v45.db = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v45.db = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v42.primitives = []
        for i in range(0, length):
          val3 = shape_msgs.msg.SolidPrimitive()
          start = end
          end += 1
          (val3.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
          val3.dimensions = s.unpack(str[start:end])
          _v42.primitives.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v42.primitive_poses = []
        for i in range(0, length):
          val3 = geometry_msgs.msg.Pose()
          _v46 = val3.position
          _x = _v46
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v47 = val3.orientation
          _x = _v47
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          _v42.primitive_poses.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v42.meshes = []
        for i in range(0, length):
          val3 = shape_msgs.msg.Mesh()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val3.triangles = []
          for i in range(0, length):
            val4 = shape_msgs.msg.MeshTriangle()
            start = end
            end += 12
            val4.vertex_indices = _get_struct_3I().unpack(str[start:end])
            val3.triangles.append(val4)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val3.vertices = []
          for i in range(0, length):
            val4 = geometry_msgs.msg.Point()
            _x = val4
            start = end
            end += 24
            (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
            val3.vertices.append(val4)
          _v42.meshes.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v42.mesh_poses = []
        for i in range(0, length):
          val3 = geometry_msgs.msg.Pose()
          _v48 = val3.position
          _x = _v48
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v49 = val3.orientation
          _x = _v49
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          _v42.mesh_poses.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v42.planes = []
        for i in range(0, length):
          val3 = shape_msgs.msg.Plane()
          start = end
          end += 32
          val3.coef = _get_struct_4d().unpack(str[start:end])
          _v42.planes.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v42.plane_poses = []
        for i in range(0, length):
          val3 = geometry_msgs.msg.Pose()
          _v50 = val3.position
          _x = _v50
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v51 = val3.orientation
          _x = _v51
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          _v42.plane_poses.append(val3)
        start = end
        end += 1
        (_v42.operation,) = _get_struct_b().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.touch_links = []
        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.touch_links.append(val2)
        _v52 = val1.detach_posture
        _v53 = _v52.header
        start = end
        end += 4
        (_v53.seq,) = _get_struct_I().unpack(str[start:end])
        _v54 = _v53.stamp
        _x = _v54
        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:
          _v53.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v53.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v52.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]
          _v52.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v52.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])
          _v55 = val3.time_from_start
          _x = _v55
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v52.points.append(val3)
        start = end
        end += 8
        (val1.weight,) = _get_struct_d().unpack(str[start:end])
        self.scene.robot_state.attached_collision_objects.append(val1)
      start = end
      end += 1
      (self.scene.robot_state.is_diff,) = _get_struct_B().unpack(str[start:end])
      self.scene.robot_state.is_diff = bool(self.scene.robot_state.is_diff)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.robot_model_name = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.robot_model_name = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.fixed_frame_transforms = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.TransformStamped()
        _v56 = val1.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])
        start = end
        end += length
        if python3:
          val1.child_frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.child_frame_id = str[start:end]
        _v58 = val1.transform
        _v59 = _v58.translation
        _x = _v59
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v60 = _v58.rotation
        _x = _v60
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.scene.fixed_frame_transforms.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.allowed_collision_matrix.entry_names = []
      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.scene.allowed_collision_matrix.entry_names.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.allowed_collision_matrix.entry_values = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.AllowedCollisionEntry()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sB'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.enabled = s.unpack(str[start:end])
        val1.enabled = list(map(bool, val1.enabled))
        self.scene.allowed_collision_matrix.entry_values.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.allowed_collision_matrix.default_entry_names = []
      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.scene.allowed_collision_matrix.default_entry_names.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sB'%length
      start = end
      s = struct.Struct(pattern)
      end += s.size
      self.scene.allowed_collision_matrix.default_entry_values = s.unpack(str[start:end])
      self.scene.allowed_collision_matrix.default_entry_values = list(map(bool, self.scene.allowed_collision_matrix.default_entry_values))
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.link_padding = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.LinkPadding()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.link_name = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.link_name = str[start:end]
        start = end
        end += 8
        (val1.padding,) = _get_struct_d().unpack(str[start:end])
        self.scene.link_padding.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.link_scale = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.LinkScale()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.link_name = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.link_name = str[start:end]
        start = end
        end += 8
        (val1.scale,) = _get_struct_d().unpack(str[start:end])
        self.scene.link_scale.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.object_colors = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.ObjectColor()
        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]
        _v61 = val1.color
        _x = _v61
        start = end
        end += 16
        (_x.r, _x.g, _x.b, _x.a,) = _get_struct_4f().unpack(str[start:end])
        self.scene.object_colors.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.world.collision_objects = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.CollisionObject()
        _v62 = val1.header
        start = end
        end += 4
        (_v62.seq,) = _get_struct_I().unpack(str[start:end])
        _v63 = _v62.stamp
        _x = _v63
        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:
          _v62.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v62.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]
        _v64 = val1.type
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v64.key = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v64.key = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v64.db = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v64.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()
          _v65 = val2.position
          _x = _v65
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v66 = val2.orientation
          _x = _v66
          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()
          _v67 = val2.position
          _x = _v67
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v68 = val2.orientation
          _x = _v68
          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()
          _v69 = val2.position
          _x = _v69
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v70 = val2.orientation
          _x = _v70
          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.scene.world.collision_objects.append(val1)
      _x = self
      start = end
      end += 12
      (_x.scene.world.octomap.header.seq, _x.scene.world.octomap.header.stamp.secs, _x.scene.world.octomap.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.scene.world.octomap.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.world.octomap.header.frame_id = str[start:end]
      _x = self
      start = end
      end += 68
      (_x.scene.world.octomap.origin.position.x, _x.scene.world.octomap.origin.position.y, _x.scene.world.octomap.origin.position.z, _x.scene.world.octomap.origin.orientation.x, _x.scene.world.octomap.origin.orientation.y, _x.scene.world.octomap.origin.orientation.z, _x.scene.world.octomap.origin.orientation.w, _x.scene.world.octomap.octomap.header.seq, _x.scene.world.octomap.octomap.header.stamp.secs, _x.scene.world.octomap.octomap.header.stamp.nsecs,) = _get_struct_7d3I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.world.octomap.octomap.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.world.octomap.octomap.header.frame_id = str[start:end]
      start = end
      end += 1
      (self.scene.world.octomap.octomap.binary,) = _get_struct_B().unpack(str[start:end])
      self.scene.world.octomap.octomap.binary = bool(self.scene.world.octomap.octomap.binary)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.world.octomap.octomap.id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.world.octomap.octomap.id = str[start:end]
      start = end
      end += 8
      (self.scene.world.octomap.octomap.resolution,) = _get_struct_d().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sb'%length
      start = end
      s = struct.Struct(pattern)
      end += s.size
      self.scene.world.octomap.octomap.data = s.unpack(str[start:end])
      start = end
      end += 1
      (self.scene.is_diff,) = _get_struct_B().unpack(str[start:end])
      self.scene.is_diff = bool(self.scene.is_diff)
      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.scene.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.scene.robot_state.joint_state.header.seq, _x.scene.robot_state.joint_state.header.stamp.secs, _x.scene.robot_state.joint_state.header.stamp.nsecs))
      _x = self.scene.robot_state.joint_state.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))
      length = len(self.scene.robot_state.joint_state.name)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.joint_state.name:
        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.scene.robot_state.joint_state.position)
      buff.write(_struct_I.pack(length))
      pattern = '<%sd'%length
      buff.write(self.scene.robot_state.joint_state.position.tostring())
      length = len(self.scene.robot_state.joint_state.velocity)
      buff.write(_struct_I.pack(length))
      pattern = '<%sd'%length
      buff.write(self.scene.robot_state.joint_state.velocity.tostring())
      length = len(self.scene.robot_state.joint_state.effort)
      buff.write(_struct_I.pack(length))
      pattern = '<%sd'%length
      buff.write(self.scene.robot_state.joint_state.effort.tostring())
      _x = self
      buff.write(_get_struct_3I().pack(_x.scene.robot_state.multi_dof_joint_state.header.seq, _x.scene.robot_state.multi_dof_joint_state.header.stamp.secs, _x.scene.robot_state.multi_dof_joint_state.header.stamp.nsecs))
      _x = self.scene.robot_state.multi_dof_joint_state.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))
      length = len(self.scene.robot_state.multi_dof_joint_state.joint_names)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.joint_names:
        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.scene.robot_state.multi_dof_joint_state.transforms)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.transforms:
        _v71 = val1.translation
        _x = _v71
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v72 = val1.rotation
        _x = _v72
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.scene.robot_state.multi_dof_joint_state.twist)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.twist:
        _v73 = val1.linear
        _x = _v73
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v74 = val1.angular
        _x = _v74
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.scene.robot_state.multi_dof_joint_state.wrench)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.multi_dof_joint_state.wrench:
        _v75 = val1.force
        _x = _v75
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v76 = val1.torque
        _x = _v76
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.scene.robot_state.attached_collision_objects)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.robot_state.attached_collision_objects:
        _x = val1.link_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))
        _v77 = val1.object
        _v78 = _v77.header
        _x = _v78.seq
        buff.write(_get_struct_I().pack(_x))
        _v79 = _v78.stamp
        _x = _v79
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v78.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 = _v77.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))
        _v80 = _v77.type
        _x = _v80.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 = _v80.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(_v77.primitives)
        buff.write(_struct_I.pack(length))
        for val3 in _v77.primitives:
          _x = val3.type
          buff.write(_get_struct_B().pack(_x))
          length = len(val3.dimensions)
          buff.write(_struct_I.pack(length))
          pattern = '<%sd'%length
          buff.write(val3.dimensions.tostring())
        length = len(_v77.primitive_poses)
        buff.write(_struct_I.pack(length))
        for val3 in _v77.primitive_poses:
          _v81 = val3.position
          _x = _v81
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v82 = val3.orientation
          _x = _v82
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(_v77.meshes)
        buff.write(_struct_I.pack(length))
        for val3 in _v77.meshes:
          length = len(val3.triangles)
          buff.write(_struct_I.pack(length))
          for val4 in val3.triangles:
            buff.write(val4.vertex_indices.tostring())
          length = len(val3.vertices)
          buff.write(_struct_I.pack(length))
          for val4 in val3.vertices:
            _x = val4
            buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        length = len(_v77.mesh_poses)
        buff.write(_struct_I.pack(length))
        for val3 in _v77.mesh_poses:
          _v83 = val3.position
          _x = _v83
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v84 = val3.orientation
          _x = _v84
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        length = len(_v77.planes)
        buff.write(_struct_I.pack(length))
        for val3 in _v77.planes:
          buff.write(val3.coef.tostring())
        length = len(_v77.plane_poses)
        buff.write(_struct_I.pack(length))
        for val3 in _v77.plane_poses:
          _v85 = val3.position
          _x = _v85
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v86 = val3.orientation
          _x = _v86
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = _v77.operation
        buff.write(_get_struct_b().pack(_x))
        length = len(val1.touch_links)
        buff.write(_struct_I.pack(length))
        for val2 in val1.touch_links:
          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))
        _v87 = val1.detach_posture
        _v88 = _v87.header
        _x = _v88.seq
        buff.write(_get_struct_I().pack(_x))
        _v89 = _v88.stamp
        _x = _v89
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v88.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(_v87.joint_names)
        buff.write(_struct_I.pack(length))
        for val3 in _v87.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(_v87.points)
        buff.write(_struct_I.pack(length))
        for val3 in _v87.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())
          _v90 = val3.time_from_start
          _x = _v90
          buff.write(_get_struct_2i().pack(_x.secs, _x.nsecs))
        _x = val1.weight
        buff.write(_get_struct_d().pack(_x))
      _x = self.scene.robot_state.is_diff
      buff.write(_get_struct_B().pack(_x))
      _x = self.scene.robot_model_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))
      length = len(self.scene.fixed_frame_transforms)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.fixed_frame_transforms:
        _v91 = val1.header
        _x = _v91.seq
        buff.write(_get_struct_I().pack(_x))
        _v92 = _v91.stamp
        _x = _v92
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v91.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.child_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))
        _v93 = val1.transform
        _v94 = _v93.translation
        _x = _v94
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
        _v95 = _v93.rotation
        _x = _v95
        buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
      length = len(self.scene.allowed_collision_matrix.entry_names)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.allowed_collision_matrix.entry_names:
        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.scene.allowed_collision_matrix.entry_values)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.allowed_collision_matrix.entry_values:
        length = len(val1.enabled)
        buff.write(_struct_I.pack(length))
        pattern = '<%sB'%length
        buff.write(val1.enabled.tostring())
      length = len(self.scene.allowed_collision_matrix.default_entry_names)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.allowed_collision_matrix.default_entry_names:
        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.scene.allowed_collision_matrix.default_entry_values)
      buff.write(_struct_I.pack(length))
      pattern = '<%sB'%length
      buff.write(self.scene.allowed_collision_matrix.default_entry_values.tostring())
      length = len(self.scene.link_padding)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.link_padding:
        _x = val1.link_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 = val1.padding
        buff.write(_get_struct_d().pack(_x))
      length = len(self.scene.link_scale)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.link_scale:
        _x = val1.link_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 = val1.scale
        buff.write(_get_struct_d().pack(_x))
      length = len(self.scene.object_colors)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.object_colors:
        _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))
        _v96 = val1.color
        _x = _v96
        buff.write(_get_struct_4f().pack(_x.r, _x.g, _x.b, _x.a))
      length = len(self.scene.world.collision_objects)
      buff.write(_struct_I.pack(length))
      for val1 in self.scene.world.collision_objects:
        _v97 = val1.header
        _x = _v97.seq
        buff.write(_get_struct_I().pack(_x))
        _v98 = _v97.stamp
        _x = _v98
        buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
        _x = _v97.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))
        _v99 = val1.type
        _x = _v99.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 = _v99.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:
          _v100 = val2.position
          _x = _v100
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v101 = val2.orientation
          _x = _v101
          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:
          _v102 = val2.position
          _x = _v102
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v103 = val2.orientation
          _x = _v103
          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:
          _v104 = val2.position
          _x = _v104
          buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
          _v105 = val2.orientation
          _x = _v105
          buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
        _x = val1.operation
        buff.write(_get_struct_b().pack(_x))
      _x = self
      buff.write(_get_struct_3I().pack(_x.scene.world.octomap.header.seq, _x.scene.world.octomap.header.stamp.secs, _x.scene.world.octomap.header.stamp.nsecs))
      _x = self.scene.world.octomap.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
      buff.write(_get_struct_7d3I().pack(_x.scene.world.octomap.origin.position.x, _x.scene.world.octomap.origin.position.y, _x.scene.world.octomap.origin.position.z, _x.scene.world.octomap.origin.orientation.x, _x.scene.world.octomap.origin.orientation.y, _x.scene.world.octomap.origin.orientation.z, _x.scene.world.octomap.origin.orientation.w, _x.scene.world.octomap.octomap.header.seq, _x.scene.world.octomap.octomap.header.stamp.secs, _x.scene.world.octomap.octomap.header.stamp.nsecs))
      _x = self.scene.world.octomap.octomap.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.scene.world.octomap.octomap.binary
      buff.write(_get_struct_B().pack(_x))
      _x = self.scene.world.octomap.octomap.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.scene.world.octomap.octomap.resolution
      buff.write(_get_struct_d().pack(_x))
      length = len(self.scene.world.octomap.octomap.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sb'%length
      buff.write(self.scene.world.octomap.octomap.data.tostring())
      _x = self.scene.is_diff
      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.scene is None:
        self.scene = moveit_msgs.msg.PlanningScene()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.name = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.name = str[start:end]
      _x = self
      start = end
      end += 12
      (_x.scene.robot_state.joint_state.header.seq, _x.scene.robot_state.joint_state.header.stamp.secs, _x.scene.robot_state.joint_state.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.scene.robot_state.joint_state.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.robot_state.joint_state.header.frame_id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.joint_state.name = []
      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.scene.robot_state.joint_state.name.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sd'%length
      start = end
      s = struct.Struct(pattern)
      end += s.size
      self.scene.robot_state.joint_state.position = 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
      self.scene.robot_state.joint_state.velocity = 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
      self.scene.robot_state.joint_state.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
      _x = self
      start = end
      end += 12
      (_x.scene.robot_state.multi_dof_joint_state.header.seq, _x.scene.robot_state.multi_dof_joint_state.header.stamp.secs, _x.scene.robot_state.multi_dof_joint_state.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.scene.robot_state.multi_dof_joint_state.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.robot_state.multi_dof_joint_state.header.frame_id = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.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:
          val1 = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1 = str[start:end]
        self.scene.robot_state.multi_dof_joint_state.joint_names.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.transforms = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Transform()
        _v106 = val1.translation
        _x = _v106
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v107 = val1.rotation
        _x = _v107
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.scene.robot_state.multi_dof_joint_state.transforms.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.twist = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Twist()
        _v108 = val1.linear
        _x = _v108
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v109 = val1.angular
        _x = _v109
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        self.scene.robot_state.multi_dof_joint_state.twist.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.multi_dof_joint_state.wrench = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.Wrench()
        _v110 = val1.force
        _x = _v110
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v111 = val1.torque
        _x = _v111
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        self.scene.robot_state.multi_dof_joint_state.wrench.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.robot_state.attached_collision_objects = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.AttachedCollisionObject()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.link_name = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.link_name = str[start:end]
        _v112 = val1.object
        _v113 = _v112.header
        start = end
        end += 4
        (_v113.seq,) = _get_struct_I().unpack(str[start:end])
        _v114 = _v113.stamp
        _x = _v114
        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:
          _v113.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v113.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v112.id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v112.id = str[start:end]
        _v115 = _v112.type
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v115.key = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v115.key = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v115.db = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v115.db = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v112.primitives = []
        for i in range(0, length):
          val3 = shape_msgs.msg.SolidPrimitive()
          start = end
          end += 1
          (val3.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
          val3.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
          _v112.primitives.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v112.primitive_poses = []
        for i in range(0, length):
          val3 = geometry_msgs.msg.Pose()
          _v116 = val3.position
          _x = _v116
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v117 = val3.orientation
          _x = _v117
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          _v112.primitive_poses.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v112.meshes = []
        for i in range(0, length):
          val3 = shape_msgs.msg.Mesh()
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val3.triangles = []
          for i in range(0, length):
            val4 = shape_msgs.msg.MeshTriangle()
            start = end
            end += 12
            val4.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
            val3.triangles.append(val4)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val3.vertices = []
          for i in range(0, length):
            val4 = geometry_msgs.msg.Point()
            _x = val4
            start = end
            end += 24
            (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
            val3.vertices.append(val4)
          _v112.meshes.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v112.mesh_poses = []
        for i in range(0, length):
          val3 = geometry_msgs.msg.Pose()
          _v118 = val3.position
          _x = _v118
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v119 = val3.orientation
          _x = _v119
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          _v112.mesh_poses.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v112.planes = []
        for i in range(0, length):
          val3 = shape_msgs.msg.Plane()
          start = end
          end += 32
          val3.coef = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=4)
          _v112.planes.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v112.plane_poses = []
        for i in range(0, length):
          val3 = geometry_msgs.msg.Pose()
          _v120 = val3.position
          _x = _v120
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v121 = val3.orientation
          _x = _v121
          start = end
          end += 32
          (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
          _v112.plane_poses.append(val3)
        start = end
        end += 1
        (_v112.operation,) = _get_struct_b().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.touch_links = []
        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.touch_links.append(val2)
        _v122 = val1.detach_posture
        _v123 = _v122.header
        start = end
        end += 4
        (_v123.seq,) = _get_struct_I().unpack(str[start:end])
        _v124 = _v123.stamp
        _x = _v124
        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:
          _v123.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v123.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v122.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]
          _v122.joint_names.append(val3)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        _v122.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)
          _v125 = val3.time_from_start
          _x = _v125
          start = end
          end += 8
          (_x.secs, _x.nsecs,) = _get_struct_2i().unpack(str[start:end])
          _v122.points.append(val3)
        start = end
        end += 8
        (val1.weight,) = _get_struct_d().unpack(str[start:end])
        self.scene.robot_state.attached_collision_objects.append(val1)
      start = end
      end += 1
      (self.scene.robot_state.is_diff,) = _get_struct_B().unpack(str[start:end])
      self.scene.robot_state.is_diff = bool(self.scene.robot_state.is_diff)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.robot_model_name = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.robot_model_name = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.fixed_frame_transforms = []
      for i in range(0, length):
        val1 = geometry_msgs.msg.TransformStamped()
        _v126 = val1.header
        start = end
        end += 4
        (_v126.seq,) = _get_struct_I().unpack(str[start:end])
        _v127 = _v126.stamp
        _x = _v127
        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:
          _v126.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v126.frame_id = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.child_frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.child_frame_id = str[start:end]
        _v128 = val1.transform
        _v129 = _v128.translation
        _x = _v129
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        _v130 = _v128.rotation
        _x = _v130
        start = end
        end += 32
        (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
        self.scene.fixed_frame_transforms.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.allowed_collision_matrix.entry_names = []
      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.scene.allowed_collision_matrix.entry_names.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.allowed_collision_matrix.entry_values = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.AllowedCollisionEntry()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sB'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.enabled = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
        val1.enabled = list(map(bool, val1.enabled))
        self.scene.allowed_collision_matrix.entry_values.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.allowed_collision_matrix.default_entry_names = []
      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.scene.allowed_collision_matrix.default_entry_names.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sB'%length
      start = end
      s = struct.Struct(pattern)
      end += s.size
      self.scene.allowed_collision_matrix.default_entry_values = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
      self.scene.allowed_collision_matrix.default_entry_values = list(map(bool, self.scene.allowed_collision_matrix.default_entry_values))
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.link_padding = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.LinkPadding()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.link_name = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.link_name = str[start:end]
        start = end
        end += 8
        (val1.padding,) = _get_struct_d().unpack(str[start:end])
        self.scene.link_padding.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.link_scale = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.LinkScale()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.link_name = str[start:end].decode('utf-8', 'rosmsg')
        else:
          val1.link_name = str[start:end]
        start = end
        end += 8
        (val1.scale,) = _get_struct_d().unpack(str[start:end])
        self.scene.link_scale.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.object_colors = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.ObjectColor()
        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]
        _v131 = val1.color
        _x = _v131
        start = end
        end += 16
        (_x.r, _x.g, _x.b, _x.a,) = _get_struct_4f().unpack(str[start:end])
        self.scene.object_colors.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.scene.world.collision_objects = []
      for i in range(0, length):
        val1 = moveit_msgs.msg.CollisionObject()
        _v132 = val1.header
        start = end
        end += 4
        (_v132.seq,) = _get_struct_I().unpack(str[start:end])
        _v133 = _v132.stamp
        _x = _v133
        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:
          _v132.frame_id = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v132.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]
        _v134 = val1.type
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v134.key = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v134.key = str[start:end]
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          _v134.db = str[start:end].decode('utf-8', 'rosmsg')
        else:
          _v134.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()
          _v135 = val2.position
          _x = _v135
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v136 = val2.orientation
          _x = _v136
          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()
          _v137 = val2.position
          _x = _v137
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v138 = val2.orientation
          _x = _v138
          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()
          _v139 = val2.position
          _x = _v139
          start = end
          end += 24
          (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
          _v140 = val2.orientation
          _x = _v140
          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.scene.world.collision_objects.append(val1)
      _x = self
      start = end
      end += 12
      (_x.scene.world.octomap.header.seq, _x.scene.world.octomap.header.stamp.secs, _x.scene.world.octomap.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.scene.world.octomap.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.world.octomap.header.frame_id = str[start:end]
      _x = self
      start = end
      end += 68
      (_x.scene.world.octomap.origin.position.x, _x.scene.world.octomap.origin.position.y, _x.scene.world.octomap.origin.position.z, _x.scene.world.octomap.origin.orientation.x, _x.scene.world.octomap.origin.orientation.y, _x.scene.world.octomap.origin.orientation.z, _x.scene.world.octomap.origin.orientation.w, _x.scene.world.octomap.octomap.header.seq, _x.scene.world.octomap.octomap.header.stamp.secs, _x.scene.world.octomap.octomap.header.stamp.nsecs,) = _get_struct_7d3I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.world.octomap.octomap.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.world.octomap.octomap.header.frame_id = str[start:end]
      start = end
      end += 1
      (self.scene.world.octomap.octomap.binary,) = _get_struct_B().unpack(str[start:end])
      self.scene.world.octomap.octomap.binary = bool(self.scene.world.octomap.octomap.binary)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.scene.world.octomap.octomap.id = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.scene.world.octomap.octomap.id = str[start:end]
      start = end
      end += 8
      (self.scene.world.octomap.octomap.resolution,) = _get_struct_d().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sb'%length
      start = end
      s = struct.Struct(pattern)
      end += s.size
      self.scene.world.octomap.octomap.data = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length)
      start = end
      end += 1
      (self.scene.is_diff,) = _get_struct_B().unpack(str[start:end])
      self.scene.is_diff = bool(self.scene.is_diff)
      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_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_4f = None
def _get_struct_4f():
    global _struct_4f
    if _struct_4f is None:
        _struct_4f = struct.Struct("<4f")
    return _struct_4f
_struct_7d3I = None
def _get_struct_7d3I():
    global _struct_7d3I
    if _struct_7d3I is None:
        _struct_7d3I = struct.Struct("<7d3I")
    return _struct_7d3I
_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
class GetPlanningScene(object):
  _type          = 'moveit_msgs/GetPlanningScene'
  _md5sum = '2745cf315b4eb5fb00e5befa8714d64d'
  _request_class  = GetPlanningSceneRequest
  _response_class = GetPlanningSceneResponse
