00001 """autogenerated by genmsg_py from AlignModelSrvRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import sensor_msgs.msg
00006 import geometry_msgs.msg
00007 import articulation_msgs.msg
00008 import std_msgs.msg
00009
00010 class AlignModelSrvRequest(roslib.message.Message):
00011 _md5sum = "41219d340df4fefcab2da62ad6d15697"
00012 _type = "articulation_msgs/AlignModelSrvRequest"
00013 _has_header = False
00014 _full_text = """
00015
00016
00017
00018
00019
00020
00021 articulation_msgs/ModelMsg model
00022 articulation_msgs/ModelMsg data
00023
00024 ================================================================================
00025 MSG: articulation_msgs/ModelMsg
00026 # Single kinematic model
00027 #
00028 # A kinematic model is defined by its model class name, and a set of parameters.
00029 # The client may additionally specify a model id, that can be used to colorize the
00030 # model when visualized using the RVIZ model display.
00031 #
00032 # For a list of currently implemented models, see the documetation at
00033 # http://www.ros.org/wiki/articulation_models
00034 #
00035 #
00036
00037 Header header # frame and timestamp
00038
00039 int32 id # user specified model id
00040 string name # name of the model family (e.g. "rotational",
00041 # "prismatic", "pca-gp", "rigid")
00042 articulation_msgs/ParamMsg[] params # model parameters
00043 articulation_msgs/TrackMsg track # trajectory from which the model is estimated, or
00044 # that is evaluated using the model
00045
00046 ================================================================================
00047 MSG: std_msgs/Header
00048 # Standard metadata for higher-level stamped data types.
00049 # This is generally used to communicate timestamped data
00050 # in a particular coordinate frame.
00051 #
00052 # sequence ID: consecutively increasing ID
00053 uint32 seq
00054 #Two-integer timestamp that is expressed as:
00055 # * stamp.secs: seconds (stamp_secs) since epoch
00056 # * stamp.nsecs: nanoseconds since stamp_secs
00057 # time-handling sugar is provided by the client library
00058 time stamp
00059 #Frame this data is associated with
00060 # 0: no frame
00061 # 1: global frame
00062 string frame_id
00063
00064 ================================================================================
00065 MSG: articulation_msgs/ParamMsg
00066 # Single parameter passed to or from model fitting
00067 #
00068 # This mechanism allows to flexibly pass parameters to
00069 # model fitting (and vice versa). Note that these parameters
00070 # are model-specific: A client may supply additional
00071 # parameters to the model estimator, and, similarly, a estimator
00072 # may add the estimated model parameters to the model message.
00073 # When the model is then evaluated, for example to make predictions
00074 # or to compute the likelihood, the model class can then use
00075 # these parameters.
00076 #
00077 # A parameter has a name, a value, and a type. The type globally
00078 # indicates whether it is a prior parameter (prior to model fitting),
00079 # or a model parameter (found during model fitting, using a maximum-
00080 # likelihood estimator), or a cached evaluation (e.g., the likelihood
00081 # or the BIC are a typical "side"-product of model estimation, and
00082 # can therefore already be cached).
00083 #
00084 # For a list of currently used parameters, see the documentation at
00085 # http://www.ros.org/wiki/articulation_models
00086 #
00087
00088 uint8 PRIOR=0 # indicates a prior model parameter
00089 # (e.g., "sigma_position")
00090 uint8 PARAM=1 # indicates a estimated model parameter
00091 # (e.g., "rot_radius", the estimated radius)
00092 uint8 EVAL=2 # indicates a cached evaluation of the model, given
00093 # the current trajectory
00094 # (e.g., "loglikelihood", the log likelihood of the
00095 # data, given the model and its parameters)
00096
00097 string name # name of the parameter
00098 float64 value # value of the parameter
00099 uint8 type # type of the parameter (PRIOR, PARAM, EVAL)
00100
00101
00102 ================================================================================
00103 MSG: articulation_msgs/TrackMsg
00104 # Single kinematic trajectory
00105 #
00106 # This message contains a kinematic trajectory. The trajectory is specified
00107 # as a vector of 6D poses. An additional flag, track_type, indicates whether
00108 # the track is valid, and whether it includes orientation. The track id
00109 # can be used for automatic coloring in the RVIZ track plugin, and can be
00110 # freely chosen by the client.
00111 #
00112 # A model is fitting only from the trajectory stored in the pose[]-vector.
00113 # Additional information may be associated to each pose using the channels
00114 # vector, with arbitrary # fields (e.g., to include applied/measured forces).
00115 #
00116 # After model evaluation,
00117 # also the associated configurations of the object are stored in the channels,
00118 # named "q[0]".."q[DOF-1]", where DOF is the number of degrees of freedom.
00119 # Model evaluation also projects the poses in the pose vector onto the model,
00120 # and stores these ideal poses in the vector pose_projected. Further, during model
00121 # evaluation, a new set of (uniform) configurations over the valid configuration
00122 # range is sampled, and the result is stored in pose_resampled.
00123 # The vector pose_flags contains additional display flags for the poses in the
00124 # pose vector, for example, whether a pose is visible and/or
00125 # the end of a trajectory segment. At the moment, this is only used by the
00126 # prior_model_learner.
00127 #
00128
00129 Header header # Timestamp and frame
00130 int32 id # used-specified track id
00131
00132 geometry_msgs/Pose[] pose # sequence of poses, defining the observed trajectory
00133 geometry_msgs/Pose[] pose_projected # sequence of poses, projected to the model
00134 # (after model evaluation)
00135 geometry_msgs/Pose[] pose_resampled # sequence of poses, re-sampled from the model in
00136 # the valid configuration range
00137 uint32[] pose_flags # bit-wise combination of POSE_VISIBLE and POSE_END_OF_SEGMENT
00138
00139 uint32 POSE_VISIBLE=1
00140 uint32 POSE_END_OF_SEGMENT=2
00141
00142 # Each channel should have the same number of elements as pose array,
00143 # and the data in each channel should correspond 1:1 with each pose
00144 # possible channels: "width", "height", "rgb", ...
00145 sensor_msgs/ChannelFloat32[] channels
00146
00147
00148
00149 ================================================================================
00150 MSG: geometry_msgs/Pose
00151 # A representation of pose in free space, composed of postion and orientation.
00152 Point position
00153 Quaternion orientation
00154
00155 ================================================================================
00156 MSG: geometry_msgs/Point
00157 # This contains the position of a point in free space
00158 float64 x
00159 float64 y
00160 float64 z
00161
00162 ================================================================================
00163 MSG: geometry_msgs/Quaternion
00164 # This represents an orientation in free space in quaternion form.
00165
00166 float64 x
00167 float64 y
00168 float64 z
00169 float64 w
00170
00171 ================================================================================
00172 MSG: sensor_msgs/ChannelFloat32
00173 # This message is used by the PointCloud message to hold optional data
00174 # associated with each point in the cloud. The length of the values
00175 # array should be the same as the length of the points array in the
00176 # PointCloud, and each value should be associated with the corresponding
00177 # point.
00178
00179 # Channel names in existing practice include:
00180 # "u", "v" - row and column (respectively) in the left stereo image.
00181 # This is opposite to usual conventions but remains for
00182 # historical reasons. The newer PointCloud2 message has no
00183 # such problem.
00184 # "rgb" - For point clouds produced by color stereo cameras. uint8
00185 # (R,G,B) values packed into the least significant 24 bits,
00186 # in order.
00187 # "intensity" - laser or pixel intensity.
00188 # "distance"
00189
00190 # The channel name should give semantics of the channel (e.g.
00191 # "intensity" instead of "value").
00192 string name
00193
00194 # The values array should be 1-1 with the elements of the associated
00195 # PointCloud.
00196 float32[] values
00197
00198 """
00199 __slots__ = ['model','data']
00200 _slot_types = ['articulation_msgs/ModelMsg','articulation_msgs/ModelMsg']
00201
00202 def __init__(self, *args, **kwds):
00203 """
00204 Constructor. Any message fields that are implicitly/explicitly
00205 set to None will be assigned a default value. The recommend
00206 use is keyword arguments as this is more robust to future message
00207 changes. You cannot mix in-order arguments and keyword arguments.
00208
00209 The available fields are:
00210 model,data
00211
00212 @param args: complete set of field values, in .msg order
00213 @param kwds: use keyword arguments corresponding to message field names
00214 to set specific fields.
00215 """
00216 if args or kwds:
00217 super(AlignModelSrvRequest, self).__init__(*args, **kwds)
00218 #message fields cannot be None, assign default values for those that are
00219 if self.model is None:
00220 self.model = articulation_msgs.msg.ModelMsg()
00221 if self.data is None:
00222 self.data = articulation_msgs.msg.ModelMsg()
00223 else:
00224 self.model = articulation_msgs.msg.ModelMsg()
00225 self.data = articulation_msgs.msg.ModelMsg()
00226
00227 def _get_types(self):
00228 """
00229 internal API method
00230 """
00231 return self._slot_types
00232
00233 def serialize(self, buff):
00234 """
00235 serialize message into buffer
00236 @param buff: buffer
00237 @type buff: StringIO
00238 """
00239 try:
00240 _x = self
00241 buff.write(_struct_3I.pack(_x.model.header.seq, _x.model.header.stamp.secs, _x.model.header.stamp.nsecs))
00242 _x = self.model.header.frame_id
00243 length = len(_x)
00244 buff.write(struct.pack('<I%ss'%length, length, _x))
00245 buff.write(_struct_i.pack(self.model.id))
00246 _x = self.model.name
00247 length = len(_x)
00248 buff.write(struct.pack('<I%ss'%length, length, _x))
00249 length = len(self.model.params)
00250 buff.write(_struct_I.pack(length))
00251 for val1 in self.model.params:
00252 _x = val1.name
00253 length = len(_x)
00254 buff.write(struct.pack('<I%ss'%length, length, _x))
00255 _x = val1
00256 buff.write(_struct_dB.pack(_x.value, _x.type))
00257 _x = self
00258 buff.write(_struct_3I.pack(_x.model.track.header.seq, _x.model.track.header.stamp.secs, _x.model.track.header.stamp.nsecs))
00259 _x = self.model.track.header.frame_id
00260 length = len(_x)
00261 buff.write(struct.pack('<I%ss'%length, length, _x))
00262 buff.write(_struct_i.pack(self.model.track.id))
00263 length = len(self.model.track.pose)
00264 buff.write(_struct_I.pack(length))
00265 for val1 in self.model.track.pose:
00266 _v1 = val1.position
00267 _x = _v1
00268 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00269 _v2 = val1.orientation
00270 _x = _v2
00271 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00272 length = len(self.model.track.pose_projected)
00273 buff.write(_struct_I.pack(length))
00274 for val1 in self.model.track.pose_projected:
00275 _v3 = val1.position
00276 _x = _v3
00277 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00278 _v4 = val1.orientation
00279 _x = _v4
00280 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00281 length = len(self.model.track.pose_resampled)
00282 buff.write(_struct_I.pack(length))
00283 for val1 in self.model.track.pose_resampled:
00284 _v5 = val1.position
00285 _x = _v5
00286 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00287 _v6 = val1.orientation
00288 _x = _v6
00289 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00290 length = len(self.model.track.pose_flags)
00291 buff.write(_struct_I.pack(length))
00292 pattern = '<%sI'%length
00293 buff.write(struct.pack(pattern, *self.model.track.pose_flags))
00294 length = len(self.model.track.channels)
00295 buff.write(_struct_I.pack(length))
00296 for val1 in self.model.track.channels:
00297 _x = val1.name
00298 length = len(_x)
00299 buff.write(struct.pack('<I%ss'%length, length, _x))
00300 length = len(val1.values)
00301 buff.write(_struct_I.pack(length))
00302 pattern = '<%sf'%length
00303 buff.write(struct.pack(pattern, *val1.values))
00304 _x = self
00305 buff.write(_struct_3I.pack(_x.data.header.seq, _x.data.header.stamp.secs, _x.data.header.stamp.nsecs))
00306 _x = self.data.header.frame_id
00307 length = len(_x)
00308 buff.write(struct.pack('<I%ss'%length, length, _x))
00309 buff.write(_struct_i.pack(self.data.id))
00310 _x = self.data.name
00311 length = len(_x)
00312 buff.write(struct.pack('<I%ss'%length, length, _x))
00313 length = len(self.data.params)
00314 buff.write(_struct_I.pack(length))
00315 for val1 in self.data.params:
00316 _x = val1.name
00317 length = len(_x)
00318 buff.write(struct.pack('<I%ss'%length, length, _x))
00319 _x = val1
00320 buff.write(_struct_dB.pack(_x.value, _x.type))
00321 _x = self
00322 buff.write(_struct_3I.pack(_x.data.track.header.seq, _x.data.track.header.stamp.secs, _x.data.track.header.stamp.nsecs))
00323 _x = self.data.track.header.frame_id
00324 length = len(_x)
00325 buff.write(struct.pack('<I%ss'%length, length, _x))
00326 buff.write(_struct_i.pack(self.data.track.id))
00327 length = len(self.data.track.pose)
00328 buff.write(_struct_I.pack(length))
00329 for val1 in self.data.track.pose:
00330 _v7 = val1.position
00331 _x = _v7
00332 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00333 _v8 = val1.orientation
00334 _x = _v8
00335 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00336 length = len(self.data.track.pose_projected)
00337 buff.write(_struct_I.pack(length))
00338 for val1 in self.data.track.pose_projected:
00339 _v9 = val1.position
00340 _x = _v9
00341 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00342 _v10 = val1.orientation
00343 _x = _v10
00344 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00345 length = len(self.data.track.pose_resampled)
00346 buff.write(_struct_I.pack(length))
00347 for val1 in self.data.track.pose_resampled:
00348 _v11 = val1.position
00349 _x = _v11
00350 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00351 _v12 = val1.orientation
00352 _x = _v12
00353 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00354 length = len(self.data.track.pose_flags)
00355 buff.write(_struct_I.pack(length))
00356 pattern = '<%sI'%length
00357 buff.write(struct.pack(pattern, *self.data.track.pose_flags))
00358 length = len(self.data.track.channels)
00359 buff.write(_struct_I.pack(length))
00360 for val1 in self.data.track.channels:
00361 _x = val1.name
00362 length = len(_x)
00363 buff.write(struct.pack('<I%ss'%length, length, _x))
00364 length = len(val1.values)
00365 buff.write(_struct_I.pack(length))
00366 pattern = '<%sf'%length
00367 buff.write(struct.pack(pattern, *val1.values))
00368 except struct.error, se: self._check_types(se)
00369 except TypeError, te: self._check_types(te)
00370
00371 def deserialize(self, str):
00372 """
00373 unpack serialized message in str into this message instance
00374 @param str: byte array of serialized message
00375 @type str: str
00376 """
00377 try:
00378 if self.model is None:
00379 self.model = articulation_msgs.msg.ModelMsg()
00380 if self.data is None:
00381 self.data = articulation_msgs.msg.ModelMsg()
00382 end = 0
00383 _x = self
00384 start = end
00385 end += 12
00386 (_x.model.header.seq, _x.model.header.stamp.secs, _x.model.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00387 start = end
00388 end += 4
00389 (length,) = _struct_I.unpack(str[start:end])
00390 start = end
00391 end += length
00392 self.model.header.frame_id = str[start:end]
00393 start = end
00394 end += 4
00395 (self.model.id,) = _struct_i.unpack(str[start:end])
00396 start = end
00397 end += 4
00398 (length,) = _struct_I.unpack(str[start:end])
00399 start = end
00400 end += length
00401 self.model.name = str[start:end]
00402 start = end
00403 end += 4
00404 (length,) = _struct_I.unpack(str[start:end])
00405 self.model.params = []
00406 for i in xrange(0, length):
00407 val1 = articulation_msgs.msg.ParamMsg()
00408 start = end
00409 end += 4
00410 (length,) = _struct_I.unpack(str[start:end])
00411 start = end
00412 end += length
00413 val1.name = str[start:end]
00414 _x = val1
00415 start = end
00416 end += 9
00417 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
00418 self.model.params.append(val1)
00419 _x = self
00420 start = end
00421 end += 12
00422 (_x.model.track.header.seq, _x.model.track.header.stamp.secs, _x.model.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00423 start = end
00424 end += 4
00425 (length,) = _struct_I.unpack(str[start:end])
00426 start = end
00427 end += length
00428 self.model.track.header.frame_id = str[start:end]
00429 start = end
00430 end += 4
00431 (self.model.track.id,) = _struct_i.unpack(str[start:end])
00432 start = end
00433 end += 4
00434 (length,) = _struct_I.unpack(str[start:end])
00435 self.model.track.pose = []
00436 for i in xrange(0, length):
00437 val1 = geometry_msgs.msg.Pose()
00438 _v13 = val1.position
00439 _x = _v13
00440 start = end
00441 end += 24
00442 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00443 _v14 = val1.orientation
00444 _x = _v14
00445 start = end
00446 end += 32
00447 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00448 self.model.track.pose.append(val1)
00449 start = end
00450 end += 4
00451 (length,) = _struct_I.unpack(str[start:end])
00452 self.model.track.pose_projected = []
00453 for i in xrange(0, length):
00454 val1 = geometry_msgs.msg.Pose()
00455 _v15 = val1.position
00456 _x = _v15
00457 start = end
00458 end += 24
00459 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00460 _v16 = val1.orientation
00461 _x = _v16
00462 start = end
00463 end += 32
00464 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00465 self.model.track.pose_projected.append(val1)
00466 start = end
00467 end += 4
00468 (length,) = _struct_I.unpack(str[start:end])
00469 self.model.track.pose_resampled = []
00470 for i in xrange(0, length):
00471 val1 = geometry_msgs.msg.Pose()
00472 _v17 = val1.position
00473 _x = _v17
00474 start = end
00475 end += 24
00476 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00477 _v18 = val1.orientation
00478 _x = _v18
00479 start = end
00480 end += 32
00481 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00482 self.model.track.pose_resampled.append(val1)
00483 start = end
00484 end += 4
00485 (length,) = _struct_I.unpack(str[start:end])
00486 pattern = '<%sI'%length
00487 start = end
00488 end += struct.calcsize(pattern)
00489 self.model.track.pose_flags = struct.unpack(pattern, str[start:end])
00490 start = end
00491 end += 4
00492 (length,) = _struct_I.unpack(str[start:end])
00493 self.model.track.channels = []
00494 for i in xrange(0, length):
00495 val1 = sensor_msgs.msg.ChannelFloat32()
00496 start = end
00497 end += 4
00498 (length,) = _struct_I.unpack(str[start:end])
00499 start = end
00500 end += length
00501 val1.name = str[start:end]
00502 start = end
00503 end += 4
00504 (length,) = _struct_I.unpack(str[start:end])
00505 pattern = '<%sf'%length
00506 start = end
00507 end += struct.calcsize(pattern)
00508 val1.values = struct.unpack(pattern, str[start:end])
00509 self.model.track.channels.append(val1)
00510 _x = self
00511 start = end
00512 end += 12
00513 (_x.data.header.seq, _x.data.header.stamp.secs, _x.data.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00514 start = end
00515 end += 4
00516 (length,) = _struct_I.unpack(str[start:end])
00517 start = end
00518 end += length
00519 self.data.header.frame_id = str[start:end]
00520 start = end
00521 end += 4
00522 (self.data.id,) = _struct_i.unpack(str[start:end])
00523 start = end
00524 end += 4
00525 (length,) = _struct_I.unpack(str[start:end])
00526 start = end
00527 end += length
00528 self.data.name = str[start:end]
00529 start = end
00530 end += 4
00531 (length,) = _struct_I.unpack(str[start:end])
00532 self.data.params = []
00533 for i in xrange(0, length):
00534 val1 = articulation_msgs.msg.ParamMsg()
00535 start = end
00536 end += 4
00537 (length,) = _struct_I.unpack(str[start:end])
00538 start = end
00539 end += length
00540 val1.name = str[start:end]
00541 _x = val1
00542 start = end
00543 end += 9
00544 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
00545 self.data.params.append(val1)
00546 _x = self
00547 start = end
00548 end += 12
00549 (_x.data.track.header.seq, _x.data.track.header.stamp.secs, _x.data.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00550 start = end
00551 end += 4
00552 (length,) = _struct_I.unpack(str[start:end])
00553 start = end
00554 end += length
00555 self.data.track.header.frame_id = str[start:end]
00556 start = end
00557 end += 4
00558 (self.data.track.id,) = _struct_i.unpack(str[start:end])
00559 start = end
00560 end += 4
00561 (length,) = _struct_I.unpack(str[start:end])
00562 self.data.track.pose = []
00563 for i in xrange(0, length):
00564 val1 = geometry_msgs.msg.Pose()
00565 _v19 = val1.position
00566 _x = _v19
00567 start = end
00568 end += 24
00569 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00570 _v20 = val1.orientation
00571 _x = _v20
00572 start = end
00573 end += 32
00574 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00575 self.data.track.pose.append(val1)
00576 start = end
00577 end += 4
00578 (length,) = _struct_I.unpack(str[start:end])
00579 self.data.track.pose_projected = []
00580 for i in xrange(0, length):
00581 val1 = geometry_msgs.msg.Pose()
00582 _v21 = val1.position
00583 _x = _v21
00584 start = end
00585 end += 24
00586 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00587 _v22 = val1.orientation
00588 _x = _v22
00589 start = end
00590 end += 32
00591 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00592 self.data.track.pose_projected.append(val1)
00593 start = end
00594 end += 4
00595 (length,) = _struct_I.unpack(str[start:end])
00596 self.data.track.pose_resampled = []
00597 for i in xrange(0, length):
00598 val1 = geometry_msgs.msg.Pose()
00599 _v23 = val1.position
00600 _x = _v23
00601 start = end
00602 end += 24
00603 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00604 _v24 = val1.orientation
00605 _x = _v24
00606 start = end
00607 end += 32
00608 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00609 self.data.track.pose_resampled.append(val1)
00610 start = end
00611 end += 4
00612 (length,) = _struct_I.unpack(str[start:end])
00613 pattern = '<%sI'%length
00614 start = end
00615 end += struct.calcsize(pattern)
00616 self.data.track.pose_flags = struct.unpack(pattern, str[start:end])
00617 start = end
00618 end += 4
00619 (length,) = _struct_I.unpack(str[start:end])
00620 self.data.track.channels = []
00621 for i in xrange(0, length):
00622 val1 = sensor_msgs.msg.ChannelFloat32()
00623 start = end
00624 end += 4
00625 (length,) = _struct_I.unpack(str[start:end])
00626 start = end
00627 end += length
00628 val1.name = str[start:end]
00629 start = end
00630 end += 4
00631 (length,) = _struct_I.unpack(str[start:end])
00632 pattern = '<%sf'%length
00633 start = end
00634 end += struct.calcsize(pattern)
00635 val1.values = struct.unpack(pattern, str[start:end])
00636 self.data.track.channels.append(val1)
00637 return self
00638 except struct.error, e:
00639 raise roslib.message.DeserializationError(e) #most likely buffer underfill
00640
00641
00642 def serialize_numpy(self, buff, numpy):
00643 """
00644 serialize message with numpy array types into buffer
00645 @param buff: buffer
00646 @type buff: StringIO
00647 @param numpy: numpy python module
00648 @type numpy module
00649 """
00650 try:
00651 _x = self
00652 buff.write(_struct_3I.pack(_x.model.header.seq, _x.model.header.stamp.secs, _x.model.header.stamp.nsecs))
00653 _x = self.model.header.frame_id
00654 length = len(_x)
00655 buff.write(struct.pack('<I%ss'%length, length, _x))
00656 buff.write(_struct_i.pack(self.model.id))
00657 _x = self.model.name
00658 length = len(_x)
00659 buff.write(struct.pack('<I%ss'%length, length, _x))
00660 length = len(self.model.params)
00661 buff.write(_struct_I.pack(length))
00662 for val1 in self.model.params:
00663 _x = val1.name
00664 length = len(_x)
00665 buff.write(struct.pack('<I%ss'%length, length, _x))
00666 _x = val1
00667 buff.write(_struct_dB.pack(_x.value, _x.type))
00668 _x = self
00669 buff.write(_struct_3I.pack(_x.model.track.header.seq, _x.model.track.header.stamp.secs, _x.model.track.header.stamp.nsecs))
00670 _x = self.model.track.header.frame_id
00671 length = len(_x)
00672 buff.write(struct.pack('<I%ss'%length, length, _x))
00673 buff.write(_struct_i.pack(self.model.track.id))
00674 length = len(self.model.track.pose)
00675 buff.write(_struct_I.pack(length))
00676 for val1 in self.model.track.pose:
00677 _v25 = val1.position
00678 _x = _v25
00679 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00680 _v26 = val1.orientation
00681 _x = _v26
00682 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00683 length = len(self.model.track.pose_projected)
00684 buff.write(_struct_I.pack(length))
00685 for val1 in self.model.track.pose_projected:
00686 _v27 = val1.position
00687 _x = _v27
00688 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00689 _v28 = val1.orientation
00690 _x = _v28
00691 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00692 length = len(self.model.track.pose_resampled)
00693 buff.write(_struct_I.pack(length))
00694 for val1 in self.model.track.pose_resampled:
00695 _v29 = val1.position
00696 _x = _v29
00697 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00698 _v30 = val1.orientation
00699 _x = _v30
00700 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00701 length = len(self.model.track.pose_flags)
00702 buff.write(_struct_I.pack(length))
00703 pattern = '<%sI'%length
00704 buff.write(self.model.track.pose_flags.tostring())
00705 length = len(self.model.track.channels)
00706 buff.write(_struct_I.pack(length))
00707 for val1 in self.model.track.channels:
00708 _x = val1.name
00709 length = len(_x)
00710 buff.write(struct.pack('<I%ss'%length, length, _x))
00711 length = len(val1.values)
00712 buff.write(_struct_I.pack(length))
00713 pattern = '<%sf'%length
00714 buff.write(val1.values.tostring())
00715 _x = self
00716 buff.write(_struct_3I.pack(_x.data.header.seq, _x.data.header.stamp.secs, _x.data.header.stamp.nsecs))
00717 _x = self.data.header.frame_id
00718 length = len(_x)
00719 buff.write(struct.pack('<I%ss'%length, length, _x))
00720 buff.write(_struct_i.pack(self.data.id))
00721 _x = self.data.name
00722 length = len(_x)
00723 buff.write(struct.pack('<I%ss'%length, length, _x))
00724 length = len(self.data.params)
00725 buff.write(_struct_I.pack(length))
00726 for val1 in self.data.params:
00727 _x = val1.name
00728 length = len(_x)
00729 buff.write(struct.pack('<I%ss'%length, length, _x))
00730 _x = val1
00731 buff.write(_struct_dB.pack(_x.value, _x.type))
00732 _x = self
00733 buff.write(_struct_3I.pack(_x.data.track.header.seq, _x.data.track.header.stamp.secs, _x.data.track.header.stamp.nsecs))
00734 _x = self.data.track.header.frame_id
00735 length = len(_x)
00736 buff.write(struct.pack('<I%ss'%length, length, _x))
00737 buff.write(_struct_i.pack(self.data.track.id))
00738 length = len(self.data.track.pose)
00739 buff.write(_struct_I.pack(length))
00740 for val1 in self.data.track.pose:
00741 _v31 = val1.position
00742 _x = _v31
00743 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00744 _v32 = val1.orientation
00745 _x = _v32
00746 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00747 length = len(self.data.track.pose_projected)
00748 buff.write(_struct_I.pack(length))
00749 for val1 in self.data.track.pose_projected:
00750 _v33 = val1.position
00751 _x = _v33
00752 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00753 _v34 = val1.orientation
00754 _x = _v34
00755 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00756 length = len(self.data.track.pose_resampled)
00757 buff.write(_struct_I.pack(length))
00758 for val1 in self.data.track.pose_resampled:
00759 _v35 = val1.position
00760 _x = _v35
00761 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00762 _v36 = val1.orientation
00763 _x = _v36
00764 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00765 length = len(self.data.track.pose_flags)
00766 buff.write(_struct_I.pack(length))
00767 pattern = '<%sI'%length
00768 buff.write(self.data.track.pose_flags.tostring())
00769 length = len(self.data.track.channels)
00770 buff.write(_struct_I.pack(length))
00771 for val1 in self.data.track.channels:
00772 _x = val1.name
00773 length = len(_x)
00774 buff.write(struct.pack('<I%ss'%length, length, _x))
00775 length = len(val1.values)
00776 buff.write(_struct_I.pack(length))
00777 pattern = '<%sf'%length
00778 buff.write(val1.values.tostring())
00779 except struct.error, se: self._check_types(se)
00780 except TypeError, te: self._check_types(te)
00781
00782 def deserialize_numpy(self, str, numpy):
00783 """
00784 unpack serialized message in str into this message instance using numpy for array types
00785 @param str: byte array of serialized message
00786 @type str: str
00787 @param numpy: numpy python module
00788 @type numpy: module
00789 """
00790 try:
00791 if self.model is None:
00792 self.model = articulation_msgs.msg.ModelMsg()
00793 if self.data is None:
00794 self.data = articulation_msgs.msg.ModelMsg()
00795 end = 0
00796 _x = self
00797 start = end
00798 end += 12
00799 (_x.model.header.seq, _x.model.header.stamp.secs, _x.model.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00800 start = end
00801 end += 4
00802 (length,) = _struct_I.unpack(str[start:end])
00803 start = end
00804 end += length
00805 self.model.header.frame_id = str[start:end]
00806 start = end
00807 end += 4
00808 (self.model.id,) = _struct_i.unpack(str[start:end])
00809 start = end
00810 end += 4
00811 (length,) = _struct_I.unpack(str[start:end])
00812 start = end
00813 end += length
00814 self.model.name = str[start:end]
00815 start = end
00816 end += 4
00817 (length,) = _struct_I.unpack(str[start:end])
00818 self.model.params = []
00819 for i in xrange(0, length):
00820 val1 = articulation_msgs.msg.ParamMsg()
00821 start = end
00822 end += 4
00823 (length,) = _struct_I.unpack(str[start:end])
00824 start = end
00825 end += length
00826 val1.name = str[start:end]
00827 _x = val1
00828 start = end
00829 end += 9
00830 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
00831 self.model.params.append(val1)
00832 _x = self
00833 start = end
00834 end += 12
00835 (_x.model.track.header.seq, _x.model.track.header.stamp.secs, _x.model.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00836 start = end
00837 end += 4
00838 (length,) = _struct_I.unpack(str[start:end])
00839 start = end
00840 end += length
00841 self.model.track.header.frame_id = str[start:end]
00842 start = end
00843 end += 4
00844 (self.model.track.id,) = _struct_i.unpack(str[start:end])
00845 start = end
00846 end += 4
00847 (length,) = _struct_I.unpack(str[start:end])
00848 self.model.track.pose = []
00849 for i in xrange(0, length):
00850 val1 = geometry_msgs.msg.Pose()
00851 _v37 = val1.position
00852 _x = _v37
00853 start = end
00854 end += 24
00855 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00856 _v38 = val1.orientation
00857 _x = _v38
00858 start = end
00859 end += 32
00860 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00861 self.model.track.pose.append(val1)
00862 start = end
00863 end += 4
00864 (length,) = _struct_I.unpack(str[start:end])
00865 self.model.track.pose_projected = []
00866 for i in xrange(0, length):
00867 val1 = geometry_msgs.msg.Pose()
00868 _v39 = val1.position
00869 _x = _v39
00870 start = end
00871 end += 24
00872 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00873 _v40 = val1.orientation
00874 _x = _v40
00875 start = end
00876 end += 32
00877 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00878 self.model.track.pose_projected.append(val1)
00879 start = end
00880 end += 4
00881 (length,) = _struct_I.unpack(str[start:end])
00882 self.model.track.pose_resampled = []
00883 for i in xrange(0, length):
00884 val1 = geometry_msgs.msg.Pose()
00885 _v41 = val1.position
00886 _x = _v41
00887 start = end
00888 end += 24
00889 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00890 _v42 = val1.orientation
00891 _x = _v42
00892 start = end
00893 end += 32
00894 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00895 self.model.track.pose_resampled.append(val1)
00896 start = end
00897 end += 4
00898 (length,) = _struct_I.unpack(str[start:end])
00899 pattern = '<%sI'%length
00900 start = end
00901 end += struct.calcsize(pattern)
00902 self.model.track.pose_flags = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00903 start = end
00904 end += 4
00905 (length,) = _struct_I.unpack(str[start:end])
00906 self.model.track.channels = []
00907 for i in xrange(0, length):
00908 val1 = sensor_msgs.msg.ChannelFloat32()
00909 start = end
00910 end += 4
00911 (length,) = _struct_I.unpack(str[start:end])
00912 start = end
00913 end += length
00914 val1.name = str[start:end]
00915 start = end
00916 end += 4
00917 (length,) = _struct_I.unpack(str[start:end])
00918 pattern = '<%sf'%length
00919 start = end
00920 end += struct.calcsize(pattern)
00921 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00922 self.model.track.channels.append(val1)
00923 _x = self
00924 start = end
00925 end += 12
00926 (_x.data.header.seq, _x.data.header.stamp.secs, _x.data.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00927 start = end
00928 end += 4
00929 (length,) = _struct_I.unpack(str[start:end])
00930 start = end
00931 end += length
00932 self.data.header.frame_id = str[start:end]
00933 start = end
00934 end += 4
00935 (self.data.id,) = _struct_i.unpack(str[start:end])
00936 start = end
00937 end += 4
00938 (length,) = _struct_I.unpack(str[start:end])
00939 start = end
00940 end += length
00941 self.data.name = str[start:end]
00942 start = end
00943 end += 4
00944 (length,) = _struct_I.unpack(str[start:end])
00945 self.data.params = []
00946 for i in xrange(0, length):
00947 val1 = articulation_msgs.msg.ParamMsg()
00948 start = end
00949 end += 4
00950 (length,) = _struct_I.unpack(str[start:end])
00951 start = end
00952 end += length
00953 val1.name = str[start:end]
00954 _x = val1
00955 start = end
00956 end += 9
00957 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
00958 self.data.params.append(val1)
00959 _x = self
00960 start = end
00961 end += 12
00962 (_x.data.track.header.seq, _x.data.track.header.stamp.secs, _x.data.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00963 start = end
00964 end += 4
00965 (length,) = _struct_I.unpack(str[start:end])
00966 start = end
00967 end += length
00968 self.data.track.header.frame_id = str[start:end]
00969 start = end
00970 end += 4
00971 (self.data.track.id,) = _struct_i.unpack(str[start:end])
00972 start = end
00973 end += 4
00974 (length,) = _struct_I.unpack(str[start:end])
00975 self.data.track.pose = []
00976 for i in xrange(0, length):
00977 val1 = geometry_msgs.msg.Pose()
00978 _v43 = val1.position
00979 _x = _v43
00980 start = end
00981 end += 24
00982 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00983 _v44 = val1.orientation
00984 _x = _v44
00985 start = end
00986 end += 32
00987 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00988 self.data.track.pose.append(val1)
00989 start = end
00990 end += 4
00991 (length,) = _struct_I.unpack(str[start:end])
00992 self.data.track.pose_projected = []
00993 for i in xrange(0, length):
00994 val1 = geometry_msgs.msg.Pose()
00995 _v45 = val1.position
00996 _x = _v45
00997 start = end
00998 end += 24
00999 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01000 _v46 = val1.orientation
01001 _x = _v46
01002 start = end
01003 end += 32
01004 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01005 self.data.track.pose_projected.append(val1)
01006 start = end
01007 end += 4
01008 (length,) = _struct_I.unpack(str[start:end])
01009 self.data.track.pose_resampled = []
01010 for i in xrange(0, length):
01011 val1 = geometry_msgs.msg.Pose()
01012 _v47 = val1.position
01013 _x = _v47
01014 start = end
01015 end += 24
01016 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01017 _v48 = val1.orientation
01018 _x = _v48
01019 start = end
01020 end += 32
01021 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01022 self.data.track.pose_resampled.append(val1)
01023 start = end
01024 end += 4
01025 (length,) = _struct_I.unpack(str[start:end])
01026 pattern = '<%sI'%length
01027 start = end
01028 end += struct.calcsize(pattern)
01029 self.data.track.pose_flags = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
01030 start = end
01031 end += 4
01032 (length,) = _struct_I.unpack(str[start:end])
01033 self.data.track.channels = []
01034 for i in xrange(0, length):
01035 val1 = sensor_msgs.msg.ChannelFloat32()
01036 start = end
01037 end += 4
01038 (length,) = _struct_I.unpack(str[start:end])
01039 start = end
01040 end += length
01041 val1.name = str[start:end]
01042 start = end
01043 end += 4
01044 (length,) = _struct_I.unpack(str[start:end])
01045 pattern = '<%sf'%length
01046 start = end
01047 end += struct.calcsize(pattern)
01048 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
01049 self.data.track.channels.append(val1)
01050 return self
01051 except struct.error, e:
01052 raise roslib.message.DeserializationError(e) #most likely buffer underfill
01053
01054 _struct_I = roslib.message.struct_I
01055 _struct_i = struct.Struct("<i")
01056 _struct_3I = struct.Struct("<3I")
01057 _struct_dB = struct.Struct("<dB")
01058 _struct_4d = struct.Struct("<4d")
01059 _struct_3d = struct.Struct("<3d")
01060 """autogenerated by genmsg_py from AlignModelSrvResponse.msg. Do not edit."""
01061 import roslib.message
01062 import struct
01063
01064 import sensor_msgs.msg
01065 import geometry_msgs.msg
01066 import articulation_msgs.msg
01067 import std_msgs.msg
01068
01069 class AlignModelSrvResponse(roslib.message.Message):
01070 _md5sum = "bf4815f3efa4d7f5c033d2485524a4e6"
01071 _type = "articulation_msgs/AlignModelSrvResponse"
01072 _has_header = False #flag to mark the presence of a Header object
01073 _full_text = """articulation_msgs/ModelMsg model_aligned
01074
01075
01076 articulation_msgs/ModelMsg data_aligned
01077
01078
01079 float64[9] R
01080 float64[3] T
01081 float64 dist_rot
01082 float32 dist_trans
01083
01084
01085
01086 ================================================================================
01087 MSG: articulation_msgs/ModelMsg
01088 # Single kinematic model
01089 #
01090 # A kinematic model is defined by its model class name, and a set of parameters.
01091 # The client may additionally specify a model id, that can be used to colorize the
01092 # model when visualized using the RVIZ model display.
01093 #
01094 # For a list of currently implemented models, see the documetation at
01095 # http://www.ros.org/wiki/articulation_models
01096 #
01097 #
01098
01099 Header header # frame and timestamp
01100
01101 int32 id # user specified model id
01102 string name # name of the model family (e.g. "rotational",
01103 # "prismatic", "pca-gp", "rigid")
01104 articulation_msgs/ParamMsg[] params # model parameters
01105 articulation_msgs/TrackMsg track # trajectory from which the model is estimated, or
01106 # that is evaluated using the model
01107
01108 ================================================================================
01109 MSG: std_msgs/Header
01110 # Standard metadata for higher-level stamped data types.
01111 # This is generally used to communicate timestamped data
01112 # in a particular coordinate frame.
01113 #
01114 # sequence ID: consecutively increasing ID
01115 uint32 seq
01116 #Two-integer timestamp that is expressed as:
01117 # * stamp.secs: seconds (stamp_secs) since epoch
01118 # * stamp.nsecs: nanoseconds since stamp_secs
01119 # time-handling sugar is provided by the client library
01120 time stamp
01121 #Frame this data is associated with
01122 # 0: no frame
01123 # 1: global frame
01124 string frame_id
01125
01126 ================================================================================
01127 MSG: articulation_msgs/ParamMsg
01128 # Single parameter passed to or from model fitting
01129 #
01130 # This mechanism allows to flexibly pass parameters to
01131 # model fitting (and vice versa). Note that these parameters
01132 # are model-specific: A client may supply additional
01133 # parameters to the model estimator, and, similarly, a estimator
01134 # may add the estimated model parameters to the model message.
01135 # When the model is then evaluated, for example to make predictions
01136 # or to compute the likelihood, the model class can then use
01137 # these parameters.
01138 #
01139 # A parameter has a name, a value, and a type. The type globally
01140 # indicates whether it is a prior parameter (prior to model fitting),
01141 # or a model parameter (found during model fitting, using a maximum-
01142 # likelihood estimator), or a cached evaluation (e.g., the likelihood
01143 # or the BIC are a typical "side"-product of model estimation, and
01144 # can therefore already be cached).
01145 #
01146 # For a list of currently used parameters, see the documentation at
01147 # http://www.ros.org/wiki/articulation_models
01148 #
01149
01150 uint8 PRIOR=0 # indicates a prior model parameter
01151 # (e.g., "sigma_position")
01152 uint8 PARAM=1 # indicates a estimated model parameter
01153 # (e.g., "rot_radius", the estimated radius)
01154 uint8 EVAL=2 # indicates a cached evaluation of the model, given
01155 # the current trajectory
01156 # (e.g., "loglikelihood", the log likelihood of the
01157 # data, given the model and its parameters)
01158
01159 string name # name of the parameter
01160 float64 value # value of the parameter
01161 uint8 type # type of the parameter (PRIOR, PARAM, EVAL)
01162
01163
01164 ================================================================================
01165 MSG: articulation_msgs/TrackMsg
01166 # Single kinematic trajectory
01167 #
01168 # This message contains a kinematic trajectory. The trajectory is specified
01169 # as a vector of 6D poses. An additional flag, track_type, indicates whether
01170 # the track is valid, and whether it includes orientation. The track id
01171 # can be used for automatic coloring in the RVIZ track plugin, and can be
01172 # freely chosen by the client.
01173 #
01174 # A model is fitting only from the trajectory stored in the pose[]-vector.
01175 # Additional information may be associated to each pose using the channels
01176 # vector, with arbitrary # fields (e.g., to include applied/measured forces).
01177 #
01178 # After model evaluation,
01179 # also the associated configurations of the object are stored in the channels,
01180 # named "q[0]".."q[DOF-1]", where DOF is the number of degrees of freedom.
01181 # Model evaluation also projects the poses in the pose vector onto the model,
01182 # and stores these ideal poses in the vector pose_projected. Further, during model
01183 # evaluation, a new set of (uniform) configurations over the valid configuration
01184 # range is sampled, and the result is stored in pose_resampled.
01185 # The vector pose_flags contains additional display flags for the poses in the
01186 # pose vector, for example, whether a pose is visible and/or
01187 # the end of a trajectory segment. At the moment, this is only used by the
01188 # prior_model_learner.
01189 #
01190
01191 Header header # Timestamp and frame
01192 int32 id # used-specified track id
01193
01194 geometry_msgs/Pose[] pose # sequence of poses, defining the observed trajectory
01195 geometry_msgs/Pose[] pose_projected # sequence of poses, projected to the model
01196 # (after model evaluation)
01197 geometry_msgs/Pose[] pose_resampled # sequence of poses, re-sampled from the model in
01198 # the valid configuration range
01199 uint32[] pose_flags # bit-wise combination of POSE_VISIBLE and POSE_END_OF_SEGMENT
01200
01201 uint32 POSE_VISIBLE=1
01202 uint32 POSE_END_OF_SEGMENT=2
01203
01204 # Each channel should have the same number of elements as pose array,
01205 # and the data in each channel should correspond 1:1 with each pose
01206 # possible channels: "width", "height", "rgb", ...
01207 sensor_msgs/ChannelFloat32[] channels
01208
01209
01210
01211 ================================================================================
01212 MSG: geometry_msgs/Pose
01213 # A representation of pose in free space, composed of postion and orientation.
01214 Point position
01215 Quaternion orientation
01216
01217 ================================================================================
01218 MSG: geometry_msgs/Point
01219 # This contains the position of a point in free space
01220 float64 x
01221 float64 y
01222 float64 z
01223
01224 ================================================================================
01225 MSG: geometry_msgs/Quaternion
01226 # This represents an orientation in free space in quaternion form.
01227
01228 float64 x
01229 float64 y
01230 float64 z
01231 float64 w
01232
01233 ================================================================================
01234 MSG: sensor_msgs/ChannelFloat32
01235 # This message is used by the PointCloud message to hold optional data
01236 # associated with each point in the cloud. The length of the values
01237 # array should be the same as the length of the points array in the
01238 # PointCloud, and each value should be associated with the corresponding
01239 # point.
01240
01241 # Channel names in existing practice include:
01242 # "u", "v" - row and column (respectively) in the left stereo image.
01243 # This is opposite to usual conventions but remains for
01244 # historical reasons. The newer PointCloud2 message has no
01245 # such problem.
01246 # "rgb" - For point clouds produced by color stereo cameras. uint8
01247 # (R,G,B) values packed into the least significant 24 bits,
01248 # in order.
01249 # "intensity" - laser or pixel intensity.
01250 # "distance"
01251
01252 # The channel name should give semantics of the channel (e.g.
01253 # "intensity" instead of "value").
01254 string name
01255
01256 # The values array should be 1-1 with the elements of the associated
01257 # PointCloud.
01258 float32[] values
01259
01260 """
01261 __slots__ = ['model_aligned','data_aligned','R','T','dist_rot','dist_trans']
01262 _slot_types = ['articulation_msgs/ModelMsg','articulation_msgs/ModelMsg','float64[9]','float64[3]','float64','float32']
01263
01264 def __init__(self, *args, **kwds):
01265 """
01266 Constructor. Any message fields that are implicitly/explicitly
01267 set to None will be assigned a default value. The recommend
01268 use is keyword arguments as this is more robust to future message
01269 changes. You cannot mix in-order arguments and keyword arguments.
01270
01271 The available fields are:
01272 model_aligned,data_aligned,R,T,dist_rot,dist_trans
01273
01274 @param args: complete set of field values, in .msg order
01275 @param kwds: use keyword arguments corresponding to message field names
01276 to set specific fields.
01277 """
01278 if args or kwds:
01279 super(AlignModelSrvResponse, self).__init__(*args, **kwds)
01280 #message fields cannot be None, assign default values for those that are
01281 if self.model_aligned is None:
01282 self.model_aligned = articulation_msgs.msg.ModelMsg()
01283 if self.data_aligned is None:
01284 self.data_aligned = articulation_msgs.msg.ModelMsg()
01285 if self.R is None:
01286 self.R = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
01287 if self.T is None:
01288 self.T = [0.,0.,0.]
01289 if self.dist_rot is None:
01290 self.dist_rot = 0.
01291 if self.dist_trans is None:
01292 self.dist_trans = 0.
01293 else:
01294 self.model_aligned = articulation_msgs.msg.ModelMsg()
01295 self.data_aligned = articulation_msgs.msg.ModelMsg()
01296 self.R = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
01297 self.T = [0.,0.,0.]
01298 self.dist_rot = 0.
01299 self.dist_trans = 0.
01300
01301 def _get_types(self):
01302 """
01303 internal API method
01304 """
01305 return self._slot_types
01306
01307 def serialize(self, buff):
01308 """
01309 serialize message into buffer
01310 @param buff: buffer
01311 @type buff: StringIO
01312 """
01313 try:
01314 _x = self
01315 buff.write(_struct_3I.pack(_x.model_aligned.header.seq, _x.model_aligned.header.stamp.secs, _x.model_aligned.header.stamp.nsecs))
01316 _x = self.model_aligned.header.frame_id
01317 length = len(_x)
01318 buff.write(struct.pack('<I%ss'%length, length, _x))
01319 buff.write(_struct_i.pack(self.model_aligned.id))
01320 _x = self.model_aligned.name
01321 length = len(_x)
01322 buff.write(struct.pack('<I%ss'%length, length, _x))
01323 length = len(self.model_aligned.params)
01324 buff.write(_struct_I.pack(length))
01325 for val1 in self.model_aligned.params:
01326 _x = val1.name
01327 length = len(_x)
01328 buff.write(struct.pack('<I%ss'%length, length, _x))
01329 _x = val1
01330 buff.write(_struct_dB.pack(_x.value, _x.type))
01331 _x = self
01332 buff.write(_struct_3I.pack(_x.model_aligned.track.header.seq, _x.model_aligned.track.header.stamp.secs, _x.model_aligned.track.header.stamp.nsecs))
01333 _x = self.model_aligned.track.header.frame_id
01334 length = len(_x)
01335 buff.write(struct.pack('<I%ss'%length, length, _x))
01336 buff.write(_struct_i.pack(self.model_aligned.track.id))
01337 length = len(self.model_aligned.track.pose)
01338 buff.write(_struct_I.pack(length))
01339 for val1 in self.model_aligned.track.pose:
01340 _v49 = val1.position
01341 _x = _v49
01342 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01343 _v50 = val1.orientation
01344 _x = _v50
01345 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01346 length = len(self.model_aligned.track.pose_projected)
01347 buff.write(_struct_I.pack(length))
01348 for val1 in self.model_aligned.track.pose_projected:
01349 _v51 = val1.position
01350 _x = _v51
01351 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01352 _v52 = val1.orientation
01353 _x = _v52
01354 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01355 length = len(self.model_aligned.track.pose_resampled)
01356 buff.write(_struct_I.pack(length))
01357 for val1 in self.model_aligned.track.pose_resampled:
01358 _v53 = val1.position
01359 _x = _v53
01360 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01361 _v54 = val1.orientation
01362 _x = _v54
01363 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01364 length = len(self.model_aligned.track.pose_flags)
01365 buff.write(_struct_I.pack(length))
01366 pattern = '<%sI'%length
01367 buff.write(struct.pack(pattern, *self.model_aligned.track.pose_flags))
01368 length = len(self.model_aligned.track.channels)
01369 buff.write(_struct_I.pack(length))
01370 for val1 in self.model_aligned.track.channels:
01371 _x = val1.name
01372 length = len(_x)
01373 buff.write(struct.pack('<I%ss'%length, length, _x))
01374 length = len(val1.values)
01375 buff.write(_struct_I.pack(length))
01376 pattern = '<%sf'%length
01377 buff.write(struct.pack(pattern, *val1.values))
01378 _x = self
01379 buff.write(_struct_3I.pack(_x.data_aligned.header.seq, _x.data_aligned.header.stamp.secs, _x.data_aligned.header.stamp.nsecs))
01380 _x = self.data_aligned.header.frame_id
01381 length = len(_x)
01382 buff.write(struct.pack('<I%ss'%length, length, _x))
01383 buff.write(_struct_i.pack(self.data_aligned.id))
01384 _x = self.data_aligned.name
01385 length = len(_x)
01386 buff.write(struct.pack('<I%ss'%length, length, _x))
01387 length = len(self.data_aligned.params)
01388 buff.write(_struct_I.pack(length))
01389 for val1 in self.data_aligned.params:
01390 _x = val1.name
01391 length = len(_x)
01392 buff.write(struct.pack('<I%ss'%length, length, _x))
01393 _x = val1
01394 buff.write(_struct_dB.pack(_x.value, _x.type))
01395 _x = self
01396 buff.write(_struct_3I.pack(_x.data_aligned.track.header.seq, _x.data_aligned.track.header.stamp.secs, _x.data_aligned.track.header.stamp.nsecs))
01397 _x = self.data_aligned.track.header.frame_id
01398 length = len(_x)
01399 buff.write(struct.pack('<I%ss'%length, length, _x))
01400 buff.write(_struct_i.pack(self.data_aligned.track.id))
01401 length = len(self.data_aligned.track.pose)
01402 buff.write(_struct_I.pack(length))
01403 for val1 in self.data_aligned.track.pose:
01404 _v55 = val1.position
01405 _x = _v55
01406 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01407 _v56 = val1.orientation
01408 _x = _v56
01409 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01410 length = len(self.data_aligned.track.pose_projected)
01411 buff.write(_struct_I.pack(length))
01412 for val1 in self.data_aligned.track.pose_projected:
01413 _v57 = val1.position
01414 _x = _v57
01415 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01416 _v58 = val1.orientation
01417 _x = _v58
01418 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01419 length = len(self.data_aligned.track.pose_resampled)
01420 buff.write(_struct_I.pack(length))
01421 for val1 in self.data_aligned.track.pose_resampled:
01422 _v59 = val1.position
01423 _x = _v59
01424 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01425 _v60 = val1.orientation
01426 _x = _v60
01427 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01428 length = len(self.data_aligned.track.pose_flags)
01429 buff.write(_struct_I.pack(length))
01430 pattern = '<%sI'%length
01431 buff.write(struct.pack(pattern, *self.data_aligned.track.pose_flags))
01432 length = len(self.data_aligned.track.channels)
01433 buff.write(_struct_I.pack(length))
01434 for val1 in self.data_aligned.track.channels:
01435 _x = val1.name
01436 length = len(_x)
01437 buff.write(struct.pack('<I%ss'%length, length, _x))
01438 length = len(val1.values)
01439 buff.write(_struct_I.pack(length))
01440 pattern = '<%sf'%length
01441 buff.write(struct.pack(pattern, *val1.values))
01442 buff.write(_struct_9d.pack(*self.R))
01443 buff.write(_struct_3d.pack(*self.T))
01444 _x = self
01445 buff.write(_struct_df.pack(_x.dist_rot, _x.dist_trans))
01446 except struct.error, se: self._check_types(se)
01447 except TypeError, te: self._check_types(te)
01448
01449 def deserialize(self, str):
01450 """
01451 unpack serialized message in str into this message instance
01452 @param str: byte array of serialized message
01453 @type str: str
01454 """
01455 try:
01456 if self.model_aligned is None:
01457 self.model_aligned = articulation_msgs.msg.ModelMsg()
01458 if self.data_aligned is None:
01459 self.data_aligned = articulation_msgs.msg.ModelMsg()
01460 end = 0
01461 _x = self
01462 start = end
01463 end += 12
01464 (_x.model_aligned.header.seq, _x.model_aligned.header.stamp.secs, _x.model_aligned.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01465 start = end
01466 end += 4
01467 (length,) = _struct_I.unpack(str[start:end])
01468 start = end
01469 end += length
01470 self.model_aligned.header.frame_id = str[start:end]
01471 start = end
01472 end += 4
01473 (self.model_aligned.id,) = _struct_i.unpack(str[start:end])
01474 start = end
01475 end += 4
01476 (length,) = _struct_I.unpack(str[start:end])
01477 start = end
01478 end += length
01479 self.model_aligned.name = str[start:end]
01480 start = end
01481 end += 4
01482 (length,) = _struct_I.unpack(str[start:end])
01483 self.model_aligned.params = []
01484 for i in xrange(0, length):
01485 val1 = articulation_msgs.msg.ParamMsg()
01486 start = end
01487 end += 4
01488 (length,) = _struct_I.unpack(str[start:end])
01489 start = end
01490 end += length
01491 val1.name = str[start:end]
01492 _x = val1
01493 start = end
01494 end += 9
01495 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
01496 self.model_aligned.params.append(val1)
01497 _x = self
01498 start = end
01499 end += 12
01500 (_x.model_aligned.track.header.seq, _x.model_aligned.track.header.stamp.secs, _x.model_aligned.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01501 start = end
01502 end += 4
01503 (length,) = _struct_I.unpack(str[start:end])
01504 start = end
01505 end += length
01506 self.model_aligned.track.header.frame_id = str[start:end]
01507 start = end
01508 end += 4
01509 (self.model_aligned.track.id,) = _struct_i.unpack(str[start:end])
01510 start = end
01511 end += 4
01512 (length,) = _struct_I.unpack(str[start:end])
01513 self.model_aligned.track.pose = []
01514 for i in xrange(0, length):
01515 val1 = geometry_msgs.msg.Pose()
01516 _v61 = val1.position
01517 _x = _v61
01518 start = end
01519 end += 24
01520 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01521 _v62 = val1.orientation
01522 _x = _v62
01523 start = end
01524 end += 32
01525 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01526 self.model_aligned.track.pose.append(val1)
01527 start = end
01528 end += 4
01529 (length,) = _struct_I.unpack(str[start:end])
01530 self.model_aligned.track.pose_projected = []
01531 for i in xrange(0, length):
01532 val1 = geometry_msgs.msg.Pose()
01533 _v63 = val1.position
01534 _x = _v63
01535 start = end
01536 end += 24
01537 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01538 _v64 = val1.orientation
01539 _x = _v64
01540 start = end
01541 end += 32
01542 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01543 self.model_aligned.track.pose_projected.append(val1)
01544 start = end
01545 end += 4
01546 (length,) = _struct_I.unpack(str[start:end])
01547 self.model_aligned.track.pose_resampled = []
01548 for i in xrange(0, length):
01549 val1 = geometry_msgs.msg.Pose()
01550 _v65 = val1.position
01551 _x = _v65
01552 start = end
01553 end += 24
01554 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01555 _v66 = val1.orientation
01556 _x = _v66
01557 start = end
01558 end += 32
01559 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01560 self.model_aligned.track.pose_resampled.append(val1)
01561 start = end
01562 end += 4
01563 (length,) = _struct_I.unpack(str[start:end])
01564 pattern = '<%sI'%length
01565 start = end
01566 end += struct.calcsize(pattern)
01567 self.model_aligned.track.pose_flags = struct.unpack(pattern, str[start:end])
01568 start = end
01569 end += 4
01570 (length,) = _struct_I.unpack(str[start:end])
01571 self.model_aligned.track.channels = []
01572 for i in xrange(0, length):
01573 val1 = sensor_msgs.msg.ChannelFloat32()
01574 start = end
01575 end += 4
01576 (length,) = _struct_I.unpack(str[start:end])
01577 start = end
01578 end += length
01579 val1.name = str[start:end]
01580 start = end
01581 end += 4
01582 (length,) = _struct_I.unpack(str[start:end])
01583 pattern = '<%sf'%length
01584 start = end
01585 end += struct.calcsize(pattern)
01586 val1.values = struct.unpack(pattern, str[start:end])
01587 self.model_aligned.track.channels.append(val1)
01588 _x = self
01589 start = end
01590 end += 12
01591 (_x.data_aligned.header.seq, _x.data_aligned.header.stamp.secs, _x.data_aligned.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01592 start = end
01593 end += 4
01594 (length,) = _struct_I.unpack(str[start:end])
01595 start = end
01596 end += length
01597 self.data_aligned.header.frame_id = str[start:end]
01598 start = end
01599 end += 4
01600 (self.data_aligned.id,) = _struct_i.unpack(str[start:end])
01601 start = end
01602 end += 4
01603 (length,) = _struct_I.unpack(str[start:end])
01604 start = end
01605 end += length
01606 self.data_aligned.name = str[start:end]
01607 start = end
01608 end += 4
01609 (length,) = _struct_I.unpack(str[start:end])
01610 self.data_aligned.params = []
01611 for i in xrange(0, length):
01612 val1 = articulation_msgs.msg.ParamMsg()
01613 start = end
01614 end += 4
01615 (length,) = _struct_I.unpack(str[start:end])
01616 start = end
01617 end += length
01618 val1.name = str[start:end]
01619 _x = val1
01620 start = end
01621 end += 9
01622 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
01623 self.data_aligned.params.append(val1)
01624 _x = self
01625 start = end
01626 end += 12
01627 (_x.data_aligned.track.header.seq, _x.data_aligned.track.header.stamp.secs, _x.data_aligned.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01628 start = end
01629 end += 4
01630 (length,) = _struct_I.unpack(str[start:end])
01631 start = end
01632 end += length
01633 self.data_aligned.track.header.frame_id = str[start:end]
01634 start = end
01635 end += 4
01636 (self.data_aligned.track.id,) = _struct_i.unpack(str[start:end])
01637 start = end
01638 end += 4
01639 (length,) = _struct_I.unpack(str[start:end])
01640 self.data_aligned.track.pose = []
01641 for i in xrange(0, length):
01642 val1 = geometry_msgs.msg.Pose()
01643 _v67 = val1.position
01644 _x = _v67
01645 start = end
01646 end += 24
01647 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01648 _v68 = val1.orientation
01649 _x = _v68
01650 start = end
01651 end += 32
01652 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01653 self.data_aligned.track.pose.append(val1)
01654 start = end
01655 end += 4
01656 (length,) = _struct_I.unpack(str[start:end])
01657 self.data_aligned.track.pose_projected = []
01658 for i in xrange(0, length):
01659 val1 = geometry_msgs.msg.Pose()
01660 _v69 = val1.position
01661 _x = _v69
01662 start = end
01663 end += 24
01664 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01665 _v70 = val1.orientation
01666 _x = _v70
01667 start = end
01668 end += 32
01669 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01670 self.data_aligned.track.pose_projected.append(val1)
01671 start = end
01672 end += 4
01673 (length,) = _struct_I.unpack(str[start:end])
01674 self.data_aligned.track.pose_resampled = []
01675 for i in xrange(0, length):
01676 val1 = geometry_msgs.msg.Pose()
01677 _v71 = val1.position
01678 _x = _v71
01679 start = end
01680 end += 24
01681 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01682 _v72 = val1.orientation
01683 _x = _v72
01684 start = end
01685 end += 32
01686 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01687 self.data_aligned.track.pose_resampled.append(val1)
01688 start = end
01689 end += 4
01690 (length,) = _struct_I.unpack(str[start:end])
01691 pattern = '<%sI'%length
01692 start = end
01693 end += struct.calcsize(pattern)
01694 self.data_aligned.track.pose_flags = struct.unpack(pattern, str[start:end])
01695 start = end
01696 end += 4
01697 (length,) = _struct_I.unpack(str[start:end])
01698 self.data_aligned.track.channels = []
01699 for i in xrange(0, length):
01700 val1 = sensor_msgs.msg.ChannelFloat32()
01701 start = end
01702 end += 4
01703 (length,) = _struct_I.unpack(str[start:end])
01704 start = end
01705 end += length
01706 val1.name = str[start:end]
01707 start = end
01708 end += 4
01709 (length,) = _struct_I.unpack(str[start:end])
01710 pattern = '<%sf'%length
01711 start = end
01712 end += struct.calcsize(pattern)
01713 val1.values = struct.unpack(pattern, str[start:end])
01714 self.data_aligned.track.channels.append(val1)
01715 start = end
01716 end += 72
01717 self.R = _struct_9d.unpack(str[start:end])
01718 start = end
01719 end += 24
01720 self.T = _struct_3d.unpack(str[start:end])
01721 _x = self
01722 start = end
01723 end += 12
01724 (_x.dist_rot, _x.dist_trans,) = _struct_df.unpack(str[start:end])
01725 return self
01726 except struct.error, e:
01727 raise roslib.message.DeserializationError(e) #most likely buffer underfill
01728
01729
01730 def serialize_numpy(self, buff, numpy):
01731 """
01732 serialize message with numpy array types into buffer
01733 @param buff: buffer
01734 @type buff: StringIO
01735 @param numpy: numpy python module
01736 @type numpy module
01737 """
01738 try:
01739 _x = self
01740 buff.write(_struct_3I.pack(_x.model_aligned.header.seq, _x.model_aligned.header.stamp.secs, _x.model_aligned.header.stamp.nsecs))
01741 _x = self.model_aligned.header.frame_id
01742 length = len(_x)
01743 buff.write(struct.pack('<I%ss'%length, length, _x))
01744 buff.write(_struct_i.pack(self.model_aligned.id))
01745 _x = self.model_aligned.name
01746 length = len(_x)
01747 buff.write(struct.pack('<I%ss'%length, length, _x))
01748 length = len(self.model_aligned.params)
01749 buff.write(_struct_I.pack(length))
01750 for val1 in self.model_aligned.params:
01751 _x = val1.name
01752 length = len(_x)
01753 buff.write(struct.pack('<I%ss'%length, length, _x))
01754 _x = val1
01755 buff.write(_struct_dB.pack(_x.value, _x.type))
01756 _x = self
01757 buff.write(_struct_3I.pack(_x.model_aligned.track.header.seq, _x.model_aligned.track.header.stamp.secs, _x.model_aligned.track.header.stamp.nsecs))
01758 _x = self.model_aligned.track.header.frame_id
01759 length = len(_x)
01760 buff.write(struct.pack('<I%ss'%length, length, _x))
01761 buff.write(_struct_i.pack(self.model_aligned.track.id))
01762 length = len(self.model_aligned.track.pose)
01763 buff.write(_struct_I.pack(length))
01764 for val1 in self.model_aligned.track.pose:
01765 _v73 = val1.position
01766 _x = _v73
01767 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01768 _v74 = val1.orientation
01769 _x = _v74
01770 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01771 length = len(self.model_aligned.track.pose_projected)
01772 buff.write(_struct_I.pack(length))
01773 for val1 in self.model_aligned.track.pose_projected:
01774 _v75 = val1.position
01775 _x = _v75
01776 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01777 _v76 = val1.orientation
01778 _x = _v76
01779 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01780 length = len(self.model_aligned.track.pose_resampled)
01781 buff.write(_struct_I.pack(length))
01782 for val1 in self.model_aligned.track.pose_resampled:
01783 _v77 = val1.position
01784 _x = _v77
01785 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01786 _v78 = val1.orientation
01787 _x = _v78
01788 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01789 length = len(self.model_aligned.track.pose_flags)
01790 buff.write(_struct_I.pack(length))
01791 pattern = '<%sI'%length
01792 buff.write(self.model_aligned.track.pose_flags.tostring())
01793 length = len(self.model_aligned.track.channels)
01794 buff.write(_struct_I.pack(length))
01795 for val1 in self.model_aligned.track.channels:
01796 _x = val1.name
01797 length = len(_x)
01798 buff.write(struct.pack('<I%ss'%length, length, _x))
01799 length = len(val1.values)
01800 buff.write(_struct_I.pack(length))
01801 pattern = '<%sf'%length
01802 buff.write(val1.values.tostring())
01803 _x = self
01804 buff.write(_struct_3I.pack(_x.data_aligned.header.seq, _x.data_aligned.header.stamp.secs, _x.data_aligned.header.stamp.nsecs))
01805 _x = self.data_aligned.header.frame_id
01806 length = len(_x)
01807 buff.write(struct.pack('<I%ss'%length, length, _x))
01808 buff.write(_struct_i.pack(self.data_aligned.id))
01809 _x = self.data_aligned.name
01810 length = len(_x)
01811 buff.write(struct.pack('<I%ss'%length, length, _x))
01812 length = len(self.data_aligned.params)
01813 buff.write(_struct_I.pack(length))
01814 for val1 in self.data_aligned.params:
01815 _x = val1.name
01816 length = len(_x)
01817 buff.write(struct.pack('<I%ss'%length, length, _x))
01818 _x = val1
01819 buff.write(_struct_dB.pack(_x.value, _x.type))
01820 _x = self
01821 buff.write(_struct_3I.pack(_x.data_aligned.track.header.seq, _x.data_aligned.track.header.stamp.secs, _x.data_aligned.track.header.stamp.nsecs))
01822 _x = self.data_aligned.track.header.frame_id
01823 length = len(_x)
01824 buff.write(struct.pack('<I%ss'%length, length, _x))
01825 buff.write(_struct_i.pack(self.data_aligned.track.id))
01826 length = len(self.data_aligned.track.pose)
01827 buff.write(_struct_I.pack(length))
01828 for val1 in self.data_aligned.track.pose:
01829 _v79 = val1.position
01830 _x = _v79
01831 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01832 _v80 = val1.orientation
01833 _x = _v80
01834 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01835 length = len(self.data_aligned.track.pose_projected)
01836 buff.write(_struct_I.pack(length))
01837 for val1 in self.data_aligned.track.pose_projected:
01838 _v81 = val1.position
01839 _x = _v81
01840 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01841 _v82 = val1.orientation
01842 _x = _v82
01843 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01844 length = len(self.data_aligned.track.pose_resampled)
01845 buff.write(_struct_I.pack(length))
01846 for val1 in self.data_aligned.track.pose_resampled:
01847 _v83 = val1.position
01848 _x = _v83
01849 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01850 _v84 = val1.orientation
01851 _x = _v84
01852 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01853 length = len(self.data_aligned.track.pose_flags)
01854 buff.write(_struct_I.pack(length))
01855 pattern = '<%sI'%length
01856 buff.write(self.data_aligned.track.pose_flags.tostring())
01857 length = len(self.data_aligned.track.channels)
01858 buff.write(_struct_I.pack(length))
01859 for val1 in self.data_aligned.track.channels:
01860 _x = val1.name
01861 length = len(_x)
01862 buff.write(struct.pack('<I%ss'%length, length, _x))
01863 length = len(val1.values)
01864 buff.write(_struct_I.pack(length))
01865 pattern = '<%sf'%length
01866 buff.write(val1.values.tostring())
01867 buff.write(self.R.tostring())
01868 buff.write(self.T.tostring())
01869 _x = self
01870 buff.write(_struct_df.pack(_x.dist_rot, _x.dist_trans))
01871 except struct.error, se: self._check_types(se)
01872 except TypeError, te: self._check_types(te)
01873
01874 def deserialize_numpy(self, str, numpy):
01875 """
01876 unpack serialized message in str into this message instance using numpy for array types
01877 @param str: byte array of serialized message
01878 @type str: str
01879 @param numpy: numpy python module
01880 @type numpy: module
01881 """
01882 try:
01883 if self.model_aligned is None:
01884 self.model_aligned = articulation_msgs.msg.ModelMsg()
01885 if self.data_aligned is None:
01886 self.data_aligned = articulation_msgs.msg.ModelMsg()
01887 end = 0
01888 _x = self
01889 start = end
01890 end += 12
01891 (_x.model_aligned.header.seq, _x.model_aligned.header.stamp.secs, _x.model_aligned.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01892 start = end
01893 end += 4
01894 (length,) = _struct_I.unpack(str[start:end])
01895 start = end
01896 end += length
01897 self.model_aligned.header.frame_id = str[start:end]
01898 start = end
01899 end += 4
01900 (self.model_aligned.id,) = _struct_i.unpack(str[start:end])
01901 start = end
01902 end += 4
01903 (length,) = _struct_I.unpack(str[start:end])
01904 start = end
01905 end += length
01906 self.model_aligned.name = str[start:end]
01907 start = end
01908 end += 4
01909 (length,) = _struct_I.unpack(str[start:end])
01910 self.model_aligned.params = []
01911 for i in xrange(0, length):
01912 val1 = articulation_msgs.msg.ParamMsg()
01913 start = end
01914 end += 4
01915 (length,) = _struct_I.unpack(str[start:end])
01916 start = end
01917 end += length
01918 val1.name = str[start:end]
01919 _x = val1
01920 start = end
01921 end += 9
01922 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
01923 self.model_aligned.params.append(val1)
01924 _x = self
01925 start = end
01926 end += 12
01927 (_x.model_aligned.track.header.seq, _x.model_aligned.track.header.stamp.secs, _x.model_aligned.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01928 start = end
01929 end += 4
01930 (length,) = _struct_I.unpack(str[start:end])
01931 start = end
01932 end += length
01933 self.model_aligned.track.header.frame_id = str[start:end]
01934 start = end
01935 end += 4
01936 (self.model_aligned.track.id,) = _struct_i.unpack(str[start:end])
01937 start = end
01938 end += 4
01939 (length,) = _struct_I.unpack(str[start:end])
01940 self.model_aligned.track.pose = []
01941 for i in xrange(0, length):
01942 val1 = geometry_msgs.msg.Pose()
01943 _v85 = val1.position
01944 _x = _v85
01945 start = end
01946 end += 24
01947 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01948 _v86 = val1.orientation
01949 _x = _v86
01950 start = end
01951 end += 32
01952 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01953 self.model_aligned.track.pose.append(val1)
01954 start = end
01955 end += 4
01956 (length,) = _struct_I.unpack(str[start:end])
01957 self.model_aligned.track.pose_projected = []
01958 for i in xrange(0, length):
01959 val1 = geometry_msgs.msg.Pose()
01960 _v87 = val1.position
01961 _x = _v87
01962 start = end
01963 end += 24
01964 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01965 _v88 = val1.orientation
01966 _x = _v88
01967 start = end
01968 end += 32
01969 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01970 self.model_aligned.track.pose_projected.append(val1)
01971 start = end
01972 end += 4
01973 (length,) = _struct_I.unpack(str[start:end])
01974 self.model_aligned.track.pose_resampled = []
01975 for i in xrange(0, length):
01976 val1 = geometry_msgs.msg.Pose()
01977 _v89 = val1.position
01978 _x = _v89
01979 start = end
01980 end += 24
01981 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01982 _v90 = val1.orientation
01983 _x = _v90
01984 start = end
01985 end += 32
01986 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01987 self.model_aligned.track.pose_resampled.append(val1)
01988 start = end
01989 end += 4
01990 (length,) = _struct_I.unpack(str[start:end])
01991 pattern = '<%sI'%length
01992 start = end
01993 end += struct.calcsize(pattern)
01994 self.model_aligned.track.pose_flags = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
01995 start = end
01996 end += 4
01997 (length,) = _struct_I.unpack(str[start:end])
01998 self.model_aligned.track.channels = []
01999 for i in xrange(0, length):
02000 val1 = sensor_msgs.msg.ChannelFloat32()
02001 start = end
02002 end += 4
02003 (length,) = _struct_I.unpack(str[start:end])
02004 start = end
02005 end += length
02006 val1.name = str[start:end]
02007 start = end
02008 end += 4
02009 (length,) = _struct_I.unpack(str[start:end])
02010 pattern = '<%sf'%length
02011 start = end
02012 end += struct.calcsize(pattern)
02013 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
02014 self.model_aligned.track.channels.append(val1)
02015 _x = self
02016 start = end
02017 end += 12
02018 (_x.data_aligned.header.seq, _x.data_aligned.header.stamp.secs, _x.data_aligned.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
02019 start = end
02020 end += 4
02021 (length,) = _struct_I.unpack(str[start:end])
02022 start = end
02023 end += length
02024 self.data_aligned.header.frame_id = str[start:end]
02025 start = end
02026 end += 4
02027 (self.data_aligned.id,) = _struct_i.unpack(str[start:end])
02028 start = end
02029 end += 4
02030 (length,) = _struct_I.unpack(str[start:end])
02031 start = end
02032 end += length
02033 self.data_aligned.name = str[start:end]
02034 start = end
02035 end += 4
02036 (length,) = _struct_I.unpack(str[start:end])
02037 self.data_aligned.params = []
02038 for i in xrange(0, length):
02039 val1 = articulation_msgs.msg.ParamMsg()
02040 start = end
02041 end += 4
02042 (length,) = _struct_I.unpack(str[start:end])
02043 start = end
02044 end += length
02045 val1.name = str[start:end]
02046 _x = val1
02047 start = end
02048 end += 9
02049 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
02050 self.data_aligned.params.append(val1)
02051 _x = self
02052 start = end
02053 end += 12
02054 (_x.data_aligned.track.header.seq, _x.data_aligned.track.header.stamp.secs, _x.data_aligned.track.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
02055 start = end
02056 end += 4
02057 (length,) = _struct_I.unpack(str[start:end])
02058 start = end
02059 end += length
02060 self.data_aligned.track.header.frame_id = str[start:end]
02061 start = end
02062 end += 4
02063 (self.data_aligned.track.id,) = _struct_i.unpack(str[start:end])
02064 start = end
02065 end += 4
02066 (length,) = _struct_I.unpack(str[start:end])
02067 self.data_aligned.track.pose = []
02068 for i in xrange(0, length):
02069 val1 = geometry_msgs.msg.Pose()
02070 _v91 = val1.position
02071 _x = _v91
02072 start = end
02073 end += 24
02074 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
02075 _v92 = val1.orientation
02076 _x = _v92
02077 start = end
02078 end += 32
02079 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
02080 self.data_aligned.track.pose.append(val1)
02081 start = end
02082 end += 4
02083 (length,) = _struct_I.unpack(str[start:end])
02084 self.data_aligned.track.pose_projected = []
02085 for i in xrange(0, length):
02086 val1 = geometry_msgs.msg.Pose()
02087 _v93 = val1.position
02088 _x = _v93
02089 start = end
02090 end += 24
02091 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
02092 _v94 = val1.orientation
02093 _x = _v94
02094 start = end
02095 end += 32
02096 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
02097 self.data_aligned.track.pose_projected.append(val1)
02098 start = end
02099 end += 4
02100 (length,) = _struct_I.unpack(str[start:end])
02101 self.data_aligned.track.pose_resampled = []
02102 for i in xrange(0, length):
02103 val1 = geometry_msgs.msg.Pose()
02104 _v95 = val1.position
02105 _x = _v95
02106 start = end
02107 end += 24
02108 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
02109 _v96 = val1.orientation
02110 _x = _v96
02111 start = end
02112 end += 32
02113 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
02114 self.data_aligned.track.pose_resampled.append(val1)
02115 start = end
02116 end += 4
02117 (length,) = _struct_I.unpack(str[start:end])
02118 pattern = '<%sI'%length
02119 start = end
02120 end += struct.calcsize(pattern)
02121 self.data_aligned.track.pose_flags = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
02122 start = end
02123 end += 4
02124 (length,) = _struct_I.unpack(str[start:end])
02125 self.data_aligned.track.channels = []
02126 for i in xrange(0, length):
02127 val1 = sensor_msgs.msg.ChannelFloat32()
02128 start = end
02129 end += 4
02130 (length,) = _struct_I.unpack(str[start:end])
02131 start = end
02132 end += length
02133 val1.name = str[start:end]
02134 start = end
02135 end += 4
02136 (length,) = _struct_I.unpack(str[start:end])
02137 pattern = '<%sf'%length
02138 start = end
02139 end += struct.calcsize(pattern)
02140 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
02141 self.data_aligned.track.channels.append(val1)
02142 start = end
02143 end += 72
02144 self.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
02145 start = end
02146 end += 24
02147 self.T = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
02148 _x = self
02149 start = end
02150 end += 12
02151 (_x.dist_rot, _x.dist_trans,) = _struct_df.unpack(str[start:end])
02152 return self
02153 except struct.error, e:
02154 raise roslib.message.DeserializationError(e) #most likely buffer underfill
02155
02156 _struct_I = roslib.message.struct_I
02157 _struct_i = struct.Struct("<i")
02158 _struct_dB = struct.Struct("<dB")
02159 _struct_9d = struct.Struct("<9d")
02160 _struct_df = struct.Struct("<df")
02161 _struct_3I = struct.Struct("<3I")
02162 _struct_4d = struct.Struct("<4d")
02163 _struct_3d = struct.Struct("<3d")
02164 class AlignModelSrv(roslib.message.ServiceDefinition):
02165 _type = 'articulation_msgs/AlignModelSrv'
02166 _md5sum = '24f8639d9e5b811cbb8a46156e9ac900'
02167 _request_class = AlignModelSrvRequest
02168 _response_class = AlignModelSrvResponse