00001 """autogenerated by genmsg_py from QueryTrajectoryStateRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006
00007 class QueryTrajectoryStateRequest(roslib.message.Message):
00008 _md5sum = "556a4fb76023a469987922359d08a844"
00009 _type = "pr2_controllers_msgs/QueryTrajectoryStateRequest"
00010 _has_header = False
00011 _full_text = """time time
00012
00013 """
00014 __slots__ = ['time']
00015 _slot_types = ['time']
00016
00017 def __init__(self, *args, **kwds):
00018 """
00019 Constructor. Any message fields that are implicitly/explicitly
00020 set to None will be assigned a default value. The recommend
00021 use is keyword arguments as this is more robust to future message
00022 changes. You cannot mix in-order arguments and keyword arguments.
00023
00024 The available fields are:
00025 time
00026
00027 @param args: complete set of field values, in .msg order
00028 @param kwds: use keyword arguments corresponding to message field names
00029 to set specific fields.
00030 """
00031 if args or kwds:
00032 super(QueryTrajectoryStateRequest, self).__init__(*args, **kwds)
00033
00034 if self.time is None:
00035 self.time = roslib.rostime.Time()
00036 else:
00037 self.time = roslib.rostime.Time()
00038
00039 def _get_types(self):
00040 """
00041 internal API method
00042 """
00043 return self._slot_types
00044
00045 def serialize(self, buff):
00046 """
00047 serialize message into buffer
00048 @param buff: buffer
00049 @type buff: StringIO
00050 """
00051 try:
00052 _x = self
00053 buff.write(_struct_2I.pack(_x.time.secs, _x.time.nsecs))
00054 except struct.error, se: self._check_types(se)
00055 except TypeError, te: self._check_types(te)
00056
00057 def deserialize(self, str):
00058 """
00059 unpack serialized message in str into this message instance
00060 @param str: byte array of serialized message
00061 @type str: str
00062 """
00063 try:
00064 if self.time is None:
00065 self.time = roslib.rostime.Time()
00066 end = 0
00067 _x = self
00068 start = end
00069 end += 8
00070 (_x.time.secs, _x.time.nsecs,) = _struct_2I.unpack(str[start:end])
00071 self.time.canon()
00072 return self
00073 except struct.error, e:
00074 raise roslib.message.DeserializationError(e)
00075
00076
00077 def serialize_numpy(self, buff, numpy):
00078 """
00079 serialize message with numpy array types into buffer
00080 @param buff: buffer
00081 @type buff: StringIO
00082 @param numpy: numpy python module
00083 @type numpy module
00084 """
00085 try:
00086 _x = self
00087 buff.write(_struct_2I.pack(_x.time.secs, _x.time.nsecs))
00088 except struct.error, se: self._check_types(se)
00089 except TypeError, te: self._check_types(te)
00090
00091 def deserialize_numpy(self, str, numpy):
00092 """
00093 unpack serialized message in str into this message instance using numpy for array types
00094 @param str: byte array of serialized message
00095 @type str: str
00096 @param numpy: numpy python module
00097 @type numpy: module
00098 """
00099 try:
00100 if self.time is None:
00101 self.time = roslib.rostime.Time()
00102 end = 0
00103 _x = self
00104 start = end
00105 end += 8
00106 (_x.time.secs, _x.time.nsecs,) = _struct_2I.unpack(str[start:end])
00107 self.time.canon()
00108 return self
00109 except struct.error, e:
00110 raise roslib.message.DeserializationError(e)
00111
00112 _struct_I = roslib.message.struct_I
00113 _struct_2I = struct.Struct("<2I")
00114 """autogenerated by genmsg_py from QueryTrajectoryStateResponse.msg. Do not edit."""
00115 import roslib.message
00116 import struct
00117
00118
00119 class QueryTrajectoryStateResponse(roslib.message.Message):
00120 _md5sum = "1f1a6554ad060f44d013e71868403c1a"
00121 _type = "pr2_controllers_msgs/QueryTrajectoryStateResponse"
00122 _has_header = False
00123 _full_text = """string[] name
00124 float64[] position
00125 float64[] velocity
00126 float64[] acceleration
00127
00128
00129 """
00130 __slots__ = ['name','position','velocity','acceleration']
00131 _slot_types = ['string[]','float64[]','float64[]','float64[]']
00132
00133 def __init__(self, *args, **kwds):
00134 """
00135 Constructor. Any message fields that are implicitly/explicitly
00136 set to None will be assigned a default value. The recommend
00137 use is keyword arguments as this is more robust to future message
00138 changes. You cannot mix in-order arguments and keyword arguments.
00139
00140 The available fields are:
00141 name,position,velocity,acceleration
00142
00143 @param args: complete set of field values, in .msg order
00144 @param kwds: use keyword arguments corresponding to message field names
00145 to set specific fields.
00146 """
00147 if args or kwds:
00148 super(QueryTrajectoryStateResponse, self).__init__(*args, **kwds)
00149
00150 if self.name is None:
00151 self.name = []
00152 if self.position is None:
00153 self.position = []
00154 if self.velocity is None:
00155 self.velocity = []
00156 if self.acceleration is None:
00157 self.acceleration = []
00158 else:
00159 self.name = []
00160 self.position = []
00161 self.velocity = []
00162 self.acceleration = []
00163
00164 def _get_types(self):
00165 """
00166 internal API method
00167 """
00168 return self._slot_types
00169
00170 def serialize(self, buff):
00171 """
00172 serialize message into buffer
00173 @param buff: buffer
00174 @type buff: StringIO
00175 """
00176 try:
00177 length = len(self.name)
00178 buff.write(_struct_I.pack(length))
00179 for val1 in self.name:
00180 length = len(val1)
00181 buff.write(struct.pack('<I%ss'%length, length, val1))
00182 length = len(self.position)
00183 buff.write(_struct_I.pack(length))
00184 pattern = '<%sd'%length
00185 buff.write(struct.pack(pattern, *self.position))
00186 length = len(self.velocity)
00187 buff.write(_struct_I.pack(length))
00188 pattern = '<%sd'%length
00189 buff.write(struct.pack(pattern, *self.velocity))
00190 length = len(self.acceleration)
00191 buff.write(_struct_I.pack(length))
00192 pattern = '<%sd'%length
00193 buff.write(struct.pack(pattern, *self.acceleration))
00194 except struct.error, se: self._check_types(se)
00195 except TypeError, te: self._check_types(te)
00196
00197 def deserialize(self, str):
00198 """
00199 unpack serialized message in str into this message instance
00200 @param str: byte array of serialized message
00201 @type str: str
00202 """
00203 try:
00204 end = 0
00205 start = end
00206 end += 4
00207 (length,) = _struct_I.unpack(str[start:end])
00208 self.name = []
00209 for i in xrange(0, length):
00210 start = end
00211 end += 4
00212 (length,) = _struct_I.unpack(str[start:end])
00213 start = end
00214 end += length
00215 val1 = str[start:end]
00216 self.name.append(val1)
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 pattern = '<%sd'%length
00221 start = end
00222 end += struct.calcsize(pattern)
00223 self.position = struct.unpack(pattern, str[start:end])
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 pattern = '<%sd'%length
00228 start = end
00229 end += struct.calcsize(pattern)
00230 self.velocity = struct.unpack(pattern, str[start:end])
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 pattern = '<%sd'%length
00235 start = end
00236 end += struct.calcsize(pattern)
00237 self.acceleration = struct.unpack(pattern, str[start:end])
00238 return self
00239 except struct.error, e:
00240 raise roslib.message.DeserializationError(e)
00241
00242
00243 def serialize_numpy(self, buff, numpy):
00244 """
00245 serialize message with numpy array types into buffer
00246 @param buff: buffer
00247 @type buff: StringIO
00248 @param numpy: numpy python module
00249 @type numpy module
00250 """
00251 try:
00252 length = len(self.name)
00253 buff.write(_struct_I.pack(length))
00254 for val1 in self.name:
00255 length = len(val1)
00256 buff.write(struct.pack('<I%ss'%length, length, val1))
00257 length = len(self.position)
00258 buff.write(_struct_I.pack(length))
00259 pattern = '<%sd'%length
00260 buff.write(self.position.tostring())
00261 length = len(self.velocity)
00262 buff.write(_struct_I.pack(length))
00263 pattern = '<%sd'%length
00264 buff.write(self.velocity.tostring())
00265 length = len(self.acceleration)
00266 buff.write(_struct_I.pack(length))
00267 pattern = '<%sd'%length
00268 buff.write(self.acceleration.tostring())
00269 except struct.error, se: self._check_types(se)
00270 except TypeError, te: self._check_types(te)
00271
00272 def deserialize_numpy(self, str, numpy):
00273 """
00274 unpack serialized message in str into this message instance using numpy for array types
00275 @param str: byte array of serialized message
00276 @type str: str
00277 @param numpy: numpy python module
00278 @type numpy: module
00279 """
00280 try:
00281 end = 0
00282 start = end
00283 end += 4
00284 (length,) = _struct_I.unpack(str[start:end])
00285 self.name = []
00286 for i in xrange(0, length):
00287 start = end
00288 end += 4
00289 (length,) = _struct_I.unpack(str[start:end])
00290 start = end
00291 end += length
00292 val1 = str[start:end]
00293 self.name.append(val1)
00294 start = end
00295 end += 4
00296 (length,) = _struct_I.unpack(str[start:end])
00297 pattern = '<%sd'%length
00298 start = end
00299 end += struct.calcsize(pattern)
00300 self.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00301 start = end
00302 end += 4
00303 (length,) = _struct_I.unpack(str[start:end])
00304 pattern = '<%sd'%length
00305 start = end
00306 end += struct.calcsize(pattern)
00307 self.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00308 start = end
00309 end += 4
00310 (length,) = _struct_I.unpack(str[start:end])
00311 pattern = '<%sd'%length
00312 start = end
00313 end += struct.calcsize(pattern)
00314 self.acceleration = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00315 return self
00316 except struct.error, e:
00317 raise roslib.message.DeserializationError(e)
00318
00319 _struct_I = roslib.message.struct_I
00320 class QueryTrajectoryState(roslib.message.ServiceDefinition):
00321 _type = 'pr2_controllers_msgs/QueryTrajectoryState'
00322 _md5sum = 'ec93cdecbd8062d761aa52b7c90cd44b'
00323 _request_class = QueryTrajectoryStateRequest
00324 _response_class = QueryTrajectoryStateResponse