_SetParameterResponse.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/SetParameterResponse.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import nasa_r2_common_msgs.msg
00008 import std_msgs.msg
00009 
00010 class SetParameterResponse(genpy.Message):
00011   _md5sum = "71d8d3ef535abb6951a4e8228fc751e1"
00012   _type = "nasa_r2_common_msgs/SetParameterResponse"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 string name
00016 CommandStatus command
00017 
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data 
00022 # in a particular coordinate frame.
00023 # 
00024 # sequence ID: consecutively increasing ID 
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035 
00036 ================================================================================
00037 MSG: nasa_r2_common_msgs/CommandStatus
00038 bool success
00039 string status
00040 
00041 """
00042   __slots__ = ['header','name','command']
00043   _slot_types = ['std_msgs/Header','string','nasa_r2_common_msgs/CommandStatus']
00044 
00045   def __init__(self, *args, **kwds):
00046     """
00047     Constructor. Any message fields that are implicitly/explicitly
00048     set to None will be assigned a default value. The recommend
00049     use is keyword arguments as this is more robust to future message
00050     changes.  You cannot mix in-order arguments and keyword arguments.
00051 
00052     The available fields are:
00053        header,name,command
00054 
00055     :param args: complete set of field values, in .msg order
00056     :param kwds: use keyword arguments corresponding to message field names
00057     to set specific fields.
00058     """
00059     if args or kwds:
00060       super(SetParameterResponse, self).__init__(*args, **kwds)
00061       #message fields cannot be None, assign default values for those that are
00062       if self.header is None:
00063         self.header = std_msgs.msg.Header()
00064       if self.name is None:
00065         self.name = ''
00066       if self.command is None:
00067         self.command = nasa_r2_common_msgs.msg.CommandStatus()
00068     else:
00069       self.header = std_msgs.msg.Header()
00070       self.name = ''
00071       self.command = nasa_r2_common_msgs.msg.CommandStatus()
00072 
00073   def _get_types(self):
00074     """
00075     internal API method
00076     """
00077     return self._slot_types
00078 
00079   def serialize(self, buff):
00080     """
00081     serialize message into buffer
00082     :param buff: buffer, ``StringIO``
00083     """
00084     try:
00085       _x = self
00086       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00087       _x = self.header.frame_id
00088       length = len(_x)
00089       if python3 or type(_x) == unicode:
00090         _x = _x.encode('utf-8')
00091         length = len(_x)
00092       buff.write(struct.pack('<I%ss'%length, length, _x))
00093       _x = self.name
00094       length = len(_x)
00095       if python3 or type(_x) == unicode:
00096         _x = _x.encode('utf-8')
00097         length = len(_x)
00098       buff.write(struct.pack('<I%ss'%length, length, _x))
00099       buff.write(_struct_B.pack(self.command.success))
00100       _x = self.command.status
00101       length = len(_x)
00102       if python3 or type(_x) == unicode:
00103         _x = _x.encode('utf-8')
00104         length = len(_x)
00105       buff.write(struct.pack('<I%ss'%length, length, _x))
00106     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00107     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00108 
00109   def deserialize(self, str):
00110     """
00111     unpack serialized message in str into this message instance
00112     :param str: byte array of serialized message, ``str``
00113     """
00114     try:
00115       if self.header is None:
00116         self.header = std_msgs.msg.Header()
00117       if self.command is None:
00118         self.command = nasa_r2_common_msgs.msg.CommandStatus()
00119       end = 0
00120       _x = self
00121       start = end
00122       end += 12
00123       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00124       start = end
00125       end += 4
00126       (length,) = _struct_I.unpack(str[start:end])
00127       start = end
00128       end += length
00129       if python3:
00130         self.header.frame_id = str[start:end].decode('utf-8')
00131       else:
00132         self.header.frame_id = str[start:end]
00133       start = end
00134       end += 4
00135       (length,) = _struct_I.unpack(str[start:end])
00136       start = end
00137       end += length
00138       if python3:
00139         self.name = str[start:end].decode('utf-8')
00140       else:
00141         self.name = str[start:end]
00142       start = end
00143       end += 1
00144       (self.command.success,) = _struct_B.unpack(str[start:end])
00145       self.command.success = bool(self.command.success)
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       start = end
00150       end += length
00151       if python3:
00152         self.command.status = str[start:end].decode('utf-8')
00153       else:
00154         self.command.status = str[start:end]
00155       return self
00156     except struct.error as e:
00157       raise genpy.DeserializationError(e) #most likely buffer underfill
00158 
00159 
00160   def serialize_numpy(self, buff, numpy):
00161     """
00162     serialize message with numpy array types into buffer
00163     :param buff: buffer, ``StringIO``
00164     :param numpy: numpy python module
00165     """
00166     try:
00167       _x = self
00168       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00169       _x = self.header.frame_id
00170       length = len(_x)
00171       if python3 or type(_x) == unicode:
00172         _x = _x.encode('utf-8')
00173         length = len(_x)
00174       buff.write(struct.pack('<I%ss'%length, length, _x))
00175       _x = self.name
00176       length = len(_x)
00177       if python3 or type(_x) == unicode:
00178         _x = _x.encode('utf-8')
00179         length = len(_x)
00180       buff.write(struct.pack('<I%ss'%length, length, _x))
00181       buff.write(_struct_B.pack(self.command.success))
00182       _x = self.command.status
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00189     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00190 
00191   def deserialize_numpy(self, str, numpy):
00192     """
00193     unpack serialized message in str into this message instance using numpy for array types
00194     :param str: byte array of serialized message, ``str``
00195     :param numpy: numpy python module
00196     """
00197     try:
00198       if self.header is None:
00199         self.header = std_msgs.msg.Header()
00200       if self.command is None:
00201         self.command = nasa_r2_common_msgs.msg.CommandStatus()
00202       end = 0
00203       _x = self
00204       start = end
00205       end += 12
00206       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00207       start = end
00208       end += 4
00209       (length,) = _struct_I.unpack(str[start:end])
00210       start = end
00211       end += length
00212       if python3:
00213         self.header.frame_id = str[start:end].decode('utf-8')
00214       else:
00215         self.header.frame_id = str[start:end]
00216       start = end
00217       end += 4
00218       (length,) = _struct_I.unpack(str[start:end])
00219       start = end
00220       end += length
00221       if python3:
00222         self.name = str[start:end].decode('utf-8')
00223       else:
00224         self.name = str[start:end]
00225       start = end
00226       end += 1
00227       (self.command.success,) = _struct_B.unpack(str[start:end])
00228       self.command.success = bool(self.command.success)
00229       start = end
00230       end += 4
00231       (length,) = _struct_I.unpack(str[start:end])
00232       start = end
00233       end += length
00234       if python3:
00235         self.command.status = str[start:end].decode('utf-8')
00236       else:
00237         self.command.status = str[start:end]
00238       return self
00239     except struct.error as e:
00240       raise genpy.DeserializationError(e) #most likely buffer underfill
00241 
00242 _struct_I = genpy.struct_I
00243 _struct_3I = struct.Struct("<3I")
00244 _struct_B = struct.Struct("<B")


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34