00001 """autogenerated by genmsg_py from ImageSnapshotGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class ImageSnapshotGoal(roslib.message.Message):
00007 _md5sum = "13e4842bc6386877d90e53523f6d94ba"
00008 _type = "pr2_image_snapshot_recorder/ImageSnapshotGoal"
00009 _has_header = False
00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00011 string topic_name # Topic name, must be of sensor_msgs/Image
00012 int32 num_images # Set <0 to record until prempted
00013 string output_file_name # Default: /hwlog/TOPIC_NAME_DATE_TIME.bag
00014
00015 """
00016 __slots__ = ['topic_name','num_images','output_file_name']
00017 _slot_types = ['string','int32','string']
00018
00019 def __init__(self, *args, **kwds):
00020 """
00021 Constructor. Any message fields that are implicitly/explicitly
00022 set to None will be assigned a default value. The recommend
00023 use is keyword arguments as this is more robust to future message
00024 changes. You cannot mix in-order arguments and keyword arguments.
00025
00026 The available fields are:
00027 topic_name,num_images,output_file_name
00028
00029 @param args: complete set of field values, in .msg order
00030 @param kwds: use keyword arguments corresponding to message field names
00031 to set specific fields.
00032 """
00033 if args or kwds:
00034 super(ImageSnapshotGoal, self).__init__(*args, **kwds)
00035
00036 if self.topic_name is None:
00037 self.topic_name = ''
00038 if self.num_images is None:
00039 self.num_images = 0
00040 if self.output_file_name is None:
00041 self.output_file_name = ''
00042 else:
00043 self.topic_name = ''
00044 self.num_images = 0
00045 self.output_file_name = ''
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 @param buff: buffer
00057 @type buff: StringIO
00058 """
00059 try:
00060 _x = self.topic_name
00061 length = len(_x)
00062 buff.write(struct.pack('<I%ss'%length, length, _x))
00063 buff.write(_struct_i.pack(self.num_images))
00064 _x = self.output_file_name
00065 length = len(_x)
00066 buff.write(struct.pack('<I%ss'%length, length, _x))
00067 except struct.error, se: self._check_types(se)
00068 except TypeError, te: self._check_types(te)
00069
00070 def deserialize(self, str):
00071 """
00072 unpack serialized message in str into this message instance
00073 @param str: byte array of serialized message
00074 @type str: str
00075 """
00076 try:
00077 end = 0
00078 start = end
00079 end += 4
00080 (length,) = _struct_I.unpack(str[start:end])
00081 start = end
00082 end += length
00083 self.topic_name = str[start:end]
00084 start = end
00085 end += 4
00086 (self.num_images,) = _struct_i.unpack(str[start:end])
00087 start = end
00088 end += 4
00089 (length,) = _struct_I.unpack(str[start:end])
00090 start = end
00091 end += length
00092 self.output_file_name = str[start:end]
00093 return self
00094 except struct.error, e:
00095 raise roslib.message.DeserializationError(e)
00096
00097
00098 def serialize_numpy(self, buff, numpy):
00099 """
00100 serialize message with numpy array types into buffer
00101 @param buff: buffer
00102 @type buff: StringIO
00103 @param numpy: numpy python module
00104 @type numpy module
00105 """
00106 try:
00107 _x = self.topic_name
00108 length = len(_x)
00109 buff.write(struct.pack('<I%ss'%length, length, _x))
00110 buff.write(_struct_i.pack(self.num_images))
00111 _x = self.output_file_name
00112 length = len(_x)
00113 buff.write(struct.pack('<I%ss'%length, length, _x))
00114 except struct.error, se: self._check_types(se)
00115 except TypeError, te: self._check_types(te)
00116
00117 def deserialize_numpy(self, str, numpy):
00118 """
00119 unpack serialized message in str into this message instance using numpy for array types
00120 @param str: byte array of serialized message
00121 @type str: str
00122 @param numpy: numpy python module
00123 @type numpy: module
00124 """
00125 try:
00126 end = 0
00127 start = end
00128 end += 4
00129 (length,) = _struct_I.unpack(str[start:end])
00130 start = end
00131 end += length
00132 self.topic_name = str[start:end]
00133 start = end
00134 end += 4
00135 (self.num_images,) = _struct_i.unpack(str[start:end])
00136 start = end
00137 end += 4
00138 (length,) = _struct_I.unpack(str[start:end])
00139 start = end
00140 end += length
00141 self.output_file_name = str[start:end]
00142 return self
00143 except struct.error, e:
00144 raise roslib.message.DeserializationError(e)
00145
00146 _struct_I = roslib.message.struct_I
00147 _struct_i = struct.Struct("<i")