$search
00001 """autogenerated by genmsg_py from SetPeriodicCmdRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_msgs.msg 00006 import std_msgs.msg 00007 00008 class SetPeriodicCmdRequest(roslib.message.Message): 00009 _md5sum = "d4deedcc194c4a77110f7228904ee733" 00010 _type = "pr2_msgs/SetPeriodicCmdRequest" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """pr2_msgs/PeriodicCmd command 00013 00014 ================================================================================ 00015 MSG: pr2_msgs/PeriodicCmd 00016 # This message is used to set the parameters of a profile executed by the 00017 # laser tilt controller. 00018 Header header 00019 string profile 00020 float64 period 00021 float64 amplitude 00022 float64 offset 00023 00024 ================================================================================ 00025 MSG: std_msgs/Header 00026 # Standard metadata for higher-level stamped data types. 00027 # This is generally used to communicate timestamped data 00028 # in a particular coordinate frame. 00029 # 00030 # sequence ID: consecutively increasing ID 00031 uint32 seq 00032 #Two-integer timestamp that is expressed as: 00033 # * stamp.secs: seconds (stamp_secs) since epoch 00034 # * stamp.nsecs: nanoseconds since stamp_secs 00035 # time-handling sugar is provided by the client library 00036 time stamp 00037 #Frame this data is associated with 00038 # 0: no frame 00039 # 1: global frame 00040 string frame_id 00041 00042 """ 00043 __slots__ = ['command'] 00044 _slot_types = ['pr2_msgs/PeriodicCmd'] 00045 00046 def __init__(self, *args, **kwds): 00047 """ 00048 Constructor. Any message fields that are implicitly/explicitly 00049 set to None will be assigned a default value. The recommend 00050 use is keyword arguments as this is more robust to future message 00051 changes. You cannot mix in-order arguments and keyword arguments. 00052 00053 The available fields are: 00054 command 00055 00056 @param args: complete set of field values, in .msg order 00057 @param kwds: use keyword arguments corresponding to message field names 00058 to set specific fields. 00059 """ 00060 if args or kwds: 00061 super(SetPeriodicCmdRequest, self).__init__(*args, **kwds) 00062 #message fields cannot be None, assign default values for those that are 00063 if self.command is None: 00064 self.command = pr2_msgs.msg.PeriodicCmd() 00065 else: 00066 self.command = pr2_msgs.msg.PeriodicCmd() 00067 00068 def _get_types(self): 00069 """ 00070 internal API method 00071 """ 00072 return self._slot_types 00073 00074 def serialize(self, buff): 00075 """ 00076 serialize message into buffer 00077 @param buff: buffer 00078 @type buff: StringIO 00079 """ 00080 try: 00081 _x = self 00082 buff.write(_struct_3I.pack(_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs)) 00083 _x = self.command.header.frame_id 00084 length = len(_x) 00085 buff.write(struct.pack('<I%ss'%length, length, _x)) 00086 _x = self.command.profile 00087 length = len(_x) 00088 buff.write(struct.pack('<I%ss'%length, length, _x)) 00089 _x = self 00090 buff.write(_struct_3d.pack(_x.command.period, _x.command.amplitude, _x.command.offset)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as 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.command is None: 00102 self.command = pr2_msgs.msg.PeriodicCmd() 00103 end = 0 00104 _x = self 00105 start = end 00106 end += 12 00107 (_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 start = end 00112 end += length 00113 self.command.header.frame_id = str[start:end] 00114 start = end 00115 end += 4 00116 (length,) = _struct_I.unpack(str[start:end]) 00117 start = end 00118 end += length 00119 self.command.profile = str[start:end] 00120 _x = self 00121 start = end 00122 end += 24 00123 (_x.command.period, _x.command.amplitude, _x.command.offset,) = _struct_3d.unpack(str[start:end]) 00124 return self 00125 except struct.error as e: 00126 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00127 00128 00129 def serialize_numpy(self, buff, numpy): 00130 """ 00131 serialize message with numpy array types into buffer 00132 @param buff: buffer 00133 @type buff: StringIO 00134 @param numpy: numpy python module 00135 @type numpy module 00136 """ 00137 try: 00138 _x = self 00139 buff.write(_struct_3I.pack(_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs)) 00140 _x = self.command.header.frame_id 00141 length = len(_x) 00142 buff.write(struct.pack('<I%ss'%length, length, _x)) 00143 _x = self.command.profile 00144 length = len(_x) 00145 buff.write(struct.pack('<I%ss'%length, length, _x)) 00146 _x = self 00147 buff.write(_struct_3d.pack(_x.command.period, _x.command.amplitude, _x.command.offset)) 00148 except struct.error as se: self._check_types(se) 00149 except TypeError as te: self._check_types(te) 00150 00151 def deserialize_numpy(self, str, numpy): 00152 """ 00153 unpack serialized message in str into this message instance using numpy for array types 00154 @param str: byte array of serialized message 00155 @type str: str 00156 @param numpy: numpy python module 00157 @type numpy: module 00158 """ 00159 try: 00160 if self.command is None: 00161 self.command = pr2_msgs.msg.PeriodicCmd() 00162 end = 0 00163 _x = self 00164 start = end 00165 end += 12 00166 (_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00167 start = end 00168 end += 4 00169 (length,) = _struct_I.unpack(str[start:end]) 00170 start = end 00171 end += length 00172 self.command.header.frame_id = str[start:end] 00173 start = end 00174 end += 4 00175 (length,) = _struct_I.unpack(str[start:end]) 00176 start = end 00177 end += length 00178 self.command.profile = str[start:end] 00179 _x = self 00180 start = end 00181 end += 24 00182 (_x.command.period, _x.command.amplitude, _x.command.offset,) = _struct_3d.unpack(str[start:end]) 00183 return self 00184 except struct.error as e: 00185 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00186 00187 _struct_I = roslib.message.struct_I 00188 _struct_3I = struct.Struct("<3I") 00189 _struct_3d = struct.Struct("<3d") 00190 """autogenerated by genmsg_py from SetPeriodicCmdResponse.msg. Do not edit.""" 00191 import roslib.message 00192 import struct 00193 00194 import roslib.rostime 00195 00196 class SetPeriodicCmdResponse(roslib.message.Message): 00197 _md5sum = "3888666920054f1ef39d2df7a5d94b02" 00198 _type = "pr2_msgs/SetPeriodicCmdResponse" 00199 _has_header = False #flag to mark the presence of a Header object 00200 _full_text = """time start_time 00201 00202 """ 00203 __slots__ = ['start_time'] 00204 _slot_types = ['time'] 00205 00206 def __init__(self, *args, **kwds): 00207 """ 00208 Constructor. Any message fields that are implicitly/explicitly 00209 set to None will be assigned a default value. The recommend 00210 use is keyword arguments as this is more robust to future message 00211 changes. You cannot mix in-order arguments and keyword arguments. 00212 00213 The available fields are: 00214 start_time 00215 00216 @param args: complete set of field values, in .msg order 00217 @param kwds: use keyword arguments corresponding to message field names 00218 to set specific fields. 00219 """ 00220 if args or kwds: 00221 super(SetPeriodicCmdResponse, self).__init__(*args, **kwds) 00222 #message fields cannot be None, assign default values for those that are 00223 if self.start_time is None: 00224 self.start_time = roslib.rostime.Time() 00225 else: 00226 self.start_time = roslib.rostime.Time() 00227 00228 def _get_types(self): 00229 """ 00230 internal API method 00231 """ 00232 return self._slot_types 00233 00234 def serialize(self, buff): 00235 """ 00236 serialize message into buffer 00237 @param buff: buffer 00238 @type buff: StringIO 00239 """ 00240 try: 00241 _x = self 00242 buff.write(_struct_2I.pack(_x.start_time.secs, _x.start_time.nsecs)) 00243 except struct.error as se: self._check_types(se) 00244 except TypeError as te: self._check_types(te) 00245 00246 def deserialize(self, str): 00247 """ 00248 unpack serialized message in str into this message instance 00249 @param str: byte array of serialized message 00250 @type str: str 00251 """ 00252 try: 00253 if self.start_time is None: 00254 self.start_time = roslib.rostime.Time() 00255 end = 0 00256 _x = self 00257 start = end 00258 end += 8 00259 (_x.start_time.secs, _x.start_time.nsecs,) = _struct_2I.unpack(str[start:end]) 00260 self.start_time.canon() 00261 return self 00262 except struct.error as e: 00263 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00264 00265 00266 def serialize_numpy(self, buff, numpy): 00267 """ 00268 serialize message with numpy array types into buffer 00269 @param buff: buffer 00270 @type buff: StringIO 00271 @param numpy: numpy python module 00272 @type numpy module 00273 """ 00274 try: 00275 _x = self 00276 buff.write(_struct_2I.pack(_x.start_time.secs, _x.start_time.nsecs)) 00277 except struct.error as se: self._check_types(se) 00278 except TypeError as te: self._check_types(te) 00279 00280 def deserialize_numpy(self, str, numpy): 00281 """ 00282 unpack serialized message in str into this message instance using numpy for array types 00283 @param str: byte array of serialized message 00284 @type str: str 00285 @param numpy: numpy python module 00286 @type numpy: module 00287 """ 00288 try: 00289 if self.start_time is None: 00290 self.start_time = roslib.rostime.Time() 00291 end = 0 00292 _x = self 00293 start = end 00294 end += 8 00295 (_x.start_time.secs, _x.start_time.nsecs,) = _struct_2I.unpack(str[start:end]) 00296 self.start_time.canon() 00297 return self 00298 except struct.error as e: 00299 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00300 00301 _struct_I = roslib.message.struct_I 00302 _struct_2I = struct.Struct("<2I") 00303 class SetPeriodicCmd(roslib.message.ServiceDefinition): 00304 _type = 'pr2_msgs/SetPeriodicCmd' 00305 _md5sum = 'daeb6e862b732192bc82a7ea52bb7975' 00306 _request_class = SetPeriodicCmdRequest 00307 _response_class = SetPeriodicCmdResponse