00001 """autogenerated by genmsg_py from PeriodicCmd.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class PeriodicCmd(roslib.message.Message):
00008 _md5sum = "95ab7e548e3d4274f83393129dd96c2e"
00009 _type = "pr2_msgs/PeriodicCmd"
00010 _has_header = True
00011 _full_text = """# This message is used to set the parameters of a profile executed by the
00012 # laser tilt controller.
00013 Header header
00014 string profile
00015 float64 period
00016 float64 amplitude
00017 float64 offset
00018
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data
00023 # in a particular coordinate frame.
00024 #
00025 # sequence ID: consecutively increasing ID
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036
00037 """
00038 __slots__ = ['header','profile','period','amplitude','offset']
00039 _slot_types = ['Header','string','float64','float64','float64']
00040
00041 def __init__(self, *args, **kwds):
00042 """
00043 Constructor. Any message fields that are implicitly/explicitly
00044 set to None will be assigned a default value. The recommend
00045 use is keyword arguments as this is more robust to future message
00046 changes. You cannot mix in-order arguments and keyword arguments.
00047
00048 The available fields are:
00049 header,profile,period,amplitude,offset
00050
00051 @param args: complete set of field values, in .msg order
00052 @param kwds: use keyword arguments corresponding to message field names
00053 to set specific fields.
00054 """
00055 if args or kwds:
00056 super(PeriodicCmd, self).__init__(*args, **kwds)
00057
00058 if self.header is None:
00059 self.header = std_msgs.msg._Header.Header()
00060 if self.profile is None:
00061 self.profile = ''
00062 if self.period is None:
00063 self.period = 0.
00064 if self.amplitude is None:
00065 self.amplitude = 0.
00066 if self.offset is None:
00067 self.offset = 0.
00068 else:
00069 self.header = std_msgs.msg._Header.Header()
00070 self.profile = ''
00071 self.period = 0.
00072 self.amplitude = 0.
00073 self.offset = 0.
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_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00090 _x = self.header.frame_id
00091 length = len(_x)
00092 buff.write(struct.pack('<I%ss'%length, length, _x))
00093 _x = self.profile
00094 length = len(_x)
00095 buff.write(struct.pack('<I%ss'%length, length, _x))
00096 _x = self
00097 buff.write(_struct_3d.pack(_x.period, _x.amplitude, _x.offset))
00098 except struct.error, se: self._check_types(se)
00099 except TypeError, te: self._check_types(te)
00100
00101 def deserialize(self, str):
00102 """
00103 unpack serialized message in str into this message instance
00104 @param str: byte array of serialized message
00105 @type str: str
00106 """
00107 try:
00108 if self.header is None:
00109 self.header = std_msgs.msg._Header.Header()
00110 end = 0
00111 _x = self
00112 start = end
00113 end += 12
00114 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 self.header.frame_id = str[start:end]
00121 start = end
00122 end += 4
00123 (length,) = _struct_I.unpack(str[start:end])
00124 start = end
00125 end += length
00126 self.profile = str[start:end]
00127 _x = self
00128 start = end
00129 end += 24
00130 (_x.period, _x.amplitude, _x.offset,) = _struct_3d.unpack(str[start:end])
00131 return self
00132 except struct.error, e:
00133 raise roslib.message.DeserializationError(e)
00134
00135
00136 def serialize_numpy(self, buff, numpy):
00137 """
00138 serialize message with numpy array types into buffer
00139 @param buff: buffer
00140 @type buff: StringIO
00141 @param numpy: numpy python module
00142 @type numpy module
00143 """
00144 try:
00145 _x = self
00146 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00147 _x = self.header.frame_id
00148 length = len(_x)
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 _x = self.profile
00151 length = len(_x)
00152 buff.write(struct.pack('<I%ss'%length, length, _x))
00153 _x = self
00154 buff.write(_struct_3d.pack(_x.period, _x.amplitude, _x.offset))
00155 except struct.error, se: self._check_types(se)
00156 except TypeError, te: self._check_types(te)
00157
00158 def deserialize_numpy(self, str, numpy):
00159 """
00160 unpack serialized message in str into this message instance using numpy for array types
00161 @param str: byte array of serialized message
00162 @type str: str
00163 @param numpy: numpy python module
00164 @type numpy: module
00165 """
00166 try:
00167 if self.header is None:
00168 self.header = std_msgs.msg._Header.Header()
00169 end = 0
00170 _x = self
00171 start = end
00172 end += 12
00173 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00174 start = end
00175 end += 4
00176 (length,) = _struct_I.unpack(str[start:end])
00177 start = end
00178 end += length
00179 self.header.frame_id = str[start:end]
00180 start = end
00181 end += 4
00182 (length,) = _struct_I.unpack(str[start:end])
00183 start = end
00184 end += length
00185 self.profile = str[start:end]
00186 _x = self
00187 start = end
00188 end += 24
00189 (_x.period, _x.amplitude, _x.offset,) = _struct_3d.unpack(str[start:end])
00190 return self
00191 except struct.error, e:
00192 raise roslib.message.DeserializationError(e)
00193
00194 _struct_I = roslib.message.struct_I
00195 _struct_3I = struct.Struct("<3I")
00196 _struct_3d = struct.Struct("<3d")