$search
00001 """autogenerated by genmsg_py from CarveSegmentsGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_dremel_server.msg 00006 import geometry_msgs.msg 00007 00008 class CarveSegmentsGoal(roslib.message.Message): 00009 _md5sum = "c4d38a36de8f8b2fdfc5725bd3f4f01c" 00010 _type = "pr2_dremel_server/CarveSegmentsGoal" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 # Define the goal 00014 pr2_dremel_server/Segment[] segments 00015 00016 ================================================================================ 00017 MSG: pr2_dremel_server/Segment 00018 geometry_msgs/Point[] points 00019 00020 ================================================================================ 00021 MSG: geometry_msgs/Point 00022 # This contains the position of a point in free space 00023 float64 x 00024 float64 y 00025 float64 z 00026 00027 """ 00028 __slots__ = ['segments'] 00029 _slot_types = ['pr2_dremel_server/Segment[]'] 00030 00031 def __init__(self, *args, **kwds): 00032 """ 00033 Constructor. Any message fields that are implicitly/explicitly 00034 set to None will be assigned a default value. The recommend 00035 use is keyword arguments as this is more robust to future message 00036 changes. You cannot mix in-order arguments and keyword arguments. 00037 00038 The available fields are: 00039 segments 00040 00041 @param args: complete set of field values, in .msg order 00042 @param kwds: use keyword arguments corresponding to message field names 00043 to set specific fields. 00044 """ 00045 if args or kwds: 00046 super(CarveSegmentsGoal, self).__init__(*args, **kwds) 00047 #message fields cannot be None, assign default values for those that are 00048 if self.segments is None: 00049 self.segments = [] 00050 else: 00051 self.segments = [] 00052 00053 def _get_types(self): 00054 """ 00055 internal API method 00056 """ 00057 return self._slot_types 00058 00059 def serialize(self, buff): 00060 """ 00061 serialize message into buffer 00062 @param buff: buffer 00063 @type buff: StringIO 00064 """ 00065 try: 00066 length = len(self.segments) 00067 buff.write(_struct_I.pack(length)) 00068 for val1 in self.segments: 00069 length = len(val1.points) 00070 buff.write(_struct_I.pack(length)) 00071 for val2 in val1.points: 00072 _x = val2 00073 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00074 except struct.error as se: self._check_types(se) 00075 except TypeError as te: self._check_types(te) 00076 00077 def deserialize(self, str): 00078 """ 00079 unpack serialized message in str into this message instance 00080 @param str: byte array of serialized message 00081 @type str: str 00082 """ 00083 try: 00084 end = 0 00085 start = end 00086 end += 4 00087 (length,) = _struct_I.unpack(str[start:end]) 00088 self.segments = [] 00089 for i in range(0, length): 00090 val1 = pr2_dremel_server.msg.Segment() 00091 start = end 00092 end += 4 00093 (length,) = _struct_I.unpack(str[start:end]) 00094 val1.points = [] 00095 for i in range(0, length): 00096 val2 = geometry_msgs.msg.Point() 00097 _x = val2 00098 start = end 00099 end += 24 00100 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00101 val1.points.append(val2) 00102 self.segments.append(val1) 00103 return self 00104 except struct.error as e: 00105 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00106 00107 00108 def serialize_numpy(self, buff, numpy): 00109 """ 00110 serialize message with numpy array types into buffer 00111 @param buff: buffer 00112 @type buff: StringIO 00113 @param numpy: numpy python module 00114 @type numpy module 00115 """ 00116 try: 00117 length = len(self.segments) 00118 buff.write(_struct_I.pack(length)) 00119 for val1 in self.segments: 00120 length = len(val1.points) 00121 buff.write(_struct_I.pack(length)) 00122 for val2 in val1.points: 00123 _x = val2 00124 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00125 except struct.error as se: self._check_types(se) 00126 except TypeError as te: self._check_types(te) 00127 00128 def deserialize_numpy(self, str, numpy): 00129 """ 00130 unpack serialized message in str into this message instance using numpy for array types 00131 @param str: byte array of serialized message 00132 @type str: str 00133 @param numpy: numpy python module 00134 @type numpy: module 00135 """ 00136 try: 00137 end = 0 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 self.segments = [] 00142 for i in range(0, length): 00143 val1 = pr2_dremel_server.msg.Segment() 00144 start = end 00145 end += 4 00146 (length,) = _struct_I.unpack(str[start:end]) 00147 val1.points = [] 00148 for i in range(0, length): 00149 val2 = geometry_msgs.msg.Point() 00150 _x = val2 00151 start = end 00152 end += 24 00153 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00154 val1.points.append(val2) 00155 self.segments.append(val1) 00156 return self 00157 except struct.error as e: 00158 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00159 00160 _struct_I = roslib.message.struct_I 00161 _struct_3d = struct.Struct("<3d")