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