00001 """autogenerated by genmsg_py from PoseWithPrecision.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006
00007 class PoseWithPrecision(roslib.message.Message):
00008 _md5sum = "9b1119d91c2e24bb52bff672469f18d5"
00009 _type = "graph_mapping_msgs/PoseWithPrecision"
00010 _has_header = False
00011 _full_text = """geometry_msgs/Pose pose
00012 float64[36] precision
00013 ================================================================================
00014 MSG: geometry_msgs/Pose
00015 # A representation of pose in free space, composed of postion and orientation.
00016 Point position
00017 Quaternion orientation
00018
00019 ================================================================================
00020 MSG: geometry_msgs/Point
00021 # This contains the position of a point in free space
00022 float64 x
00023 float64 y
00024 float64 z
00025
00026 ================================================================================
00027 MSG: geometry_msgs/Quaternion
00028 # This represents an orientation in free space in quaternion form.
00029
00030 float64 x
00031 float64 y
00032 float64 z
00033 float64 w
00034
00035 """
00036 __slots__ = ['pose','precision']
00037 _slot_types = ['geometry_msgs/Pose','float64[36]']
00038
00039 def __init__(self, *args, **kwds):
00040 """
00041 Constructor. Any message fields that are implicitly/explicitly
00042 set to None will be assigned a default value. The recommend
00043 use is keyword arguments as this is more robust to future message
00044 changes. You cannot mix in-order arguments and keyword arguments.
00045
00046 The available fields are:
00047 pose,precision
00048
00049 @param args: complete set of field values, in .msg order
00050 @param kwds: use keyword arguments corresponding to message field names
00051 to set specific fields.
00052 """
00053 if args or kwds:
00054 super(PoseWithPrecision, self).__init__(*args, **kwds)
00055
00056 if self.pose is None:
00057 self.pose = geometry_msgs.msg.Pose()
00058 if self.precision is None:
00059 self.precision = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00060 else:
00061 self.pose = geometry_msgs.msg.Pose()
00062 self.precision = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00063
00064 def _get_types(self):
00065 """
00066 internal API method
00067 """
00068 return self._slot_types
00069
00070 def serialize(self, buff):
00071 """
00072 serialize message into buffer
00073 @param buff: buffer
00074 @type buff: StringIO
00075 """
00076 try:
00077 _x = self
00078 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
00079 buff.write(_struct_36d.pack(*self.precision))
00080 except struct.error, se: self._check_types(se)
00081 except TypeError, te: self._check_types(te)
00082
00083 def deserialize(self, str):
00084 """
00085 unpack serialized message in str into this message instance
00086 @param str: byte array of serialized message
00087 @type str: str
00088 """
00089 try:
00090 if self.pose is None:
00091 self.pose = geometry_msgs.msg.Pose()
00092 end = 0
00093 _x = self
00094 start = end
00095 end += 56
00096 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00097 start = end
00098 end += 288
00099 self.precision = _struct_36d.unpack(str[start:end])
00100 return self
00101 except struct.error, e:
00102 raise roslib.message.DeserializationError(e)
00103
00104
00105 def serialize_numpy(self, buff, numpy):
00106 """
00107 serialize message with numpy array types into buffer
00108 @param buff: buffer
00109 @type buff: StringIO
00110 @param numpy: numpy python module
00111 @type numpy module
00112 """
00113 try:
00114 _x = self
00115 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
00116 buff.write(self.precision.tostring())
00117 except struct.error, se: self._check_types(se)
00118 except TypeError, te: self._check_types(te)
00119
00120 def deserialize_numpy(self, str, numpy):
00121 """
00122 unpack serialized message in str into this message instance using numpy for array types
00123 @param str: byte array of serialized message
00124 @type str: str
00125 @param numpy: numpy python module
00126 @type numpy: module
00127 """
00128 try:
00129 if self.pose is None:
00130 self.pose = geometry_msgs.msg.Pose()
00131 end = 0
00132 _x = self
00133 start = end
00134 end += 56
00135 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00136 start = end
00137 end += 288
00138 self.precision = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00139 return self
00140 except struct.error, e:
00141 raise roslib.message.DeserializationError(e)
00142
00143 _struct_I = roslib.message.struct_I
00144 _struct_36d = struct.Struct("<36d")
00145 _struct_7d = struct.Struct("<7d")