00001 """autogenerated by genpy from openraveros/robot_sensorgetdataRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class robot_sensorgetdataRequest(genpy.Message):
00009 _md5sum = "16c6c6e588b27fa8e6f4aced22a05d49"
00010 _type = "openraveros/robot_sensorgetdataRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014 int32 robotid
00015 uint32 sensorindex
00016
00017 """
00018 __slots__ = ['robotid','sensorindex']
00019 _slot_types = ['int32','uint32']
00020
00021 def __init__(self, *args, **kwds):
00022 """
00023 Constructor. Any message fields that are implicitly/explicitly
00024 set to None will be assigned a default value. The recommend
00025 use is keyword arguments as this is more robust to future message
00026 changes. You cannot mix in-order arguments and keyword arguments.
00027
00028 The available fields are:
00029 robotid,sensorindex
00030
00031 :param args: complete set of field values, in .msg order
00032 :param kwds: use keyword arguments corresponding to message field names
00033 to set specific fields.
00034 """
00035 if args or kwds:
00036 super(robot_sensorgetdataRequest, self).__init__(*args, **kwds)
00037
00038 if self.robotid is None:
00039 self.robotid = 0
00040 if self.sensorindex is None:
00041 self.sensorindex = 0
00042 else:
00043 self.robotid = 0
00044 self.sensorindex = 0
00045
00046 def _get_types(self):
00047 """
00048 internal API method
00049 """
00050 return self._slot_types
00051
00052 def serialize(self, buff):
00053 """
00054 serialize message into buffer
00055 :param buff: buffer, ``StringIO``
00056 """
00057 try:
00058 _x = self
00059 buff.write(_struct_iI.pack(_x.robotid, _x.sensorindex))
00060 except struct.error as se: self._check_types(se)
00061 except TypeError as te: self._check_types(te)
00062
00063 def deserialize(self, str):
00064 """
00065 unpack serialized message in str into this message instance
00066 :param str: byte array of serialized message, ``str``
00067 """
00068 try:
00069 end = 0
00070 _x = self
00071 start = end
00072 end += 8
00073 (_x.robotid, _x.sensorindex,) = _struct_iI.unpack(str[start:end])
00074 return self
00075 except struct.error as e:
00076 raise genpy.DeserializationError(e)
00077
00078
00079 def serialize_numpy(self, buff, numpy):
00080 """
00081 serialize message with numpy array types into buffer
00082 :param buff: buffer, ``StringIO``
00083 :param numpy: numpy python module
00084 """
00085 try:
00086 _x = self
00087 buff.write(_struct_iI.pack(_x.robotid, _x.sensorindex))
00088 except struct.error as se: self._check_types(se)
00089 except TypeError as 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, ``str``
00095 :param numpy: numpy python module
00096 """
00097 try:
00098 end = 0
00099 _x = self
00100 start = end
00101 end += 8
00102 (_x.robotid, _x.sensorindex,) = _struct_iI.unpack(str[start:end])
00103 return self
00104 except struct.error as e:
00105 raise genpy.DeserializationError(e)
00106
00107 _struct_I = genpy.struct_I
00108 _struct_iI = struct.Struct("<iI")
00109 """autogenerated by genpy from openraveros/robot_sensorgetdataResponse.msg. Do not edit."""
00110 import sys
00111 python3 = True if sys.hexversion > 0x03000000 else False
00112 import genpy
00113 import struct
00114
00115 import std_msgs.msg
00116 import sensor_msgs.msg
00117
00118 class robot_sensorgetdataResponse(genpy.Message):
00119 _md5sum = "64f6b8c9c89198aeabcca9b38d5e881a"
00120 _type = "openraveros/robot_sensorgetdataResponse"
00121 _has_header = False
00122 _full_text = """
00123
00124 string type
00125
00126
00127
00128
00129 float32[] laserrange
00130
00131
00132 float32[] laserpos
00133
00134
00135 float32[] laserint
00136
00137
00138 sensor_msgs/CameraInfo caminfo
00139 sensor_msgs/Image camimage
00140
00141
00142 ================================================================================
00143 MSG: sensor_msgs/CameraInfo
00144 # This message defines meta information for a camera. It should be in a
00145 # camera namespace on topic "camera_info" and accompanied by up to five
00146 # image topics named:
00147 #
00148 # image_raw - raw data from the camera driver, possibly Bayer encoded
00149 # image - monochrome, distorted
00150 # image_color - color, distorted
00151 # image_rect - monochrome, rectified
00152 # image_rect_color - color, rectified
00153 #
00154 # The image_pipeline contains packages (image_proc, stereo_image_proc)
00155 # for producing the four processed image topics from image_raw and
00156 # camera_info. The meaning of the camera parameters are described in
00157 # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
00158 #
00159 # The image_geometry package provides a user-friendly interface to
00160 # common operations using this meta information. If you want to, e.g.,
00161 # project a 3d point into image coordinates, we strongly recommend
00162 # using image_geometry.
00163 #
00164 # If the camera is uncalibrated, the matrices D, K, R, P should be left
00165 # zeroed out. In particular, clients may assume that K[0] == 0.0
00166 # indicates an uncalibrated camera.
00167
00168 #######################################################################
00169 # Image acquisition info #
00170 #######################################################################
00171
00172 # Time of image acquisition, camera coordinate frame ID
00173 Header header # Header timestamp should be acquisition time of image
00174 # Header frame_id should be optical frame of camera
00175 # origin of frame should be optical center of camera
00176 # +x should point to the right in the image
00177 # +y should point down in the image
00178 # +z should point into the plane of the image
00179
00180
00181 #######################################################################
00182 # Calibration Parameters #
00183 #######################################################################
00184 # These are fixed during camera calibration. Their values will be the #
00185 # same in all messages until the camera is recalibrated. Note that #
00186 # self-calibrating systems may "recalibrate" frequently. #
00187 # #
00188 # The internal parameters can be used to warp a raw (distorted) image #
00189 # to: #
00190 # 1. An undistorted image (requires D and K) #
00191 # 2. A rectified image (requires D, K, R) #
00192 # The projection matrix P projects 3D points into the rectified image.#
00193 #######################################################################
00194
00195 # The image dimensions with which the camera was calibrated. Normally
00196 # this will be the full camera resolution in pixels.
00197 uint32 height
00198 uint32 width
00199
00200 # The distortion model used. Supported models are listed in
00201 # sensor_msgs/distortion_models.h. For most cameras, "plumb_bob" - a
00202 # simple model of radial and tangential distortion - is sufficent.
00203 string distortion_model
00204
00205 # The distortion parameters, size depending on the distortion model.
00206 # For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3).
00207 float64[] D
00208
00209 # Intrinsic camera matrix for the raw (distorted) images.
00210 # [fx 0 cx]
00211 # K = [ 0 fy cy]
00212 # [ 0 0 1]
00213 # Projects 3D points in the camera coordinate frame to 2D pixel
00214 # coordinates using the focal lengths (fx, fy) and principal point
00215 # (cx, cy).
00216 float64[9] K # 3x3 row-major matrix
00217
00218 # Rectification matrix (stereo cameras only)
00219 # A rotation matrix aligning the camera coordinate system to the ideal
00220 # stereo image plane so that epipolar lines in both stereo images are
00221 # parallel.
00222 float64[9] R # 3x3 row-major matrix
00223
00224 # Projection/camera matrix
00225 # [fx' 0 cx' Tx]
00226 # P = [ 0 fy' cy' Ty]
00227 # [ 0 0 1 0]
00228 # By convention, this matrix specifies the intrinsic (camera) matrix
00229 # of the processed (rectified) image. That is, the left 3x3 portion
00230 # is the normal camera intrinsic matrix for the rectified image.
00231 # It projects 3D points in the camera coordinate frame to 2D pixel
00232 # coordinates using the focal lengths (fx', fy') and principal point
00233 # (cx', cy') - these may differ from the values in K.
00234 # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
00235 # also have R = the identity and P[1:3,1:3] = K.
00236 # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
00237 # position of the optical center of the second camera in the first
00238 # camera's frame. We assume Tz = 0 so both cameras are in the same
00239 # stereo image plane. The first camera always has Tx = Ty = 0. For
00240 # the right (second) camera of a horizontal stereo pair, Ty = 0 and
00241 # Tx = -fx' * B, where B is the baseline between the cameras.
00242 # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
00243 # the rectified image is given by:
00244 # [u v w]' = P * [X Y Z 1]'
00245 # x = u / w
00246 # y = v / w
00247 # This holds for both images of a stereo pair.
00248 float64[12] P # 3x4 row-major matrix
00249
00250
00251 #######################################################################
00252 # Operational Parameters #
00253 #######################################################################
00254 # These define the image region actually captured by the camera #
00255 # driver. Although they affect the geometry of the output image, they #
00256 # may be changed freely without recalibrating the camera. #
00257 #######################################################################
00258
00259 # Binning refers here to any camera setting which combines rectangular
00260 # neighborhoods of pixels into larger "super-pixels." It reduces the
00261 # resolution of the output image to
00262 # (width / binning_x) x (height / binning_y).
00263 # The default values binning_x = binning_y = 0 is considered the same
00264 # as binning_x = binning_y = 1 (no subsampling).
00265 uint32 binning_x
00266 uint32 binning_y
00267
00268 # Region of interest (subwindow of full camera resolution), given in
00269 # full resolution (unbinned) image coordinates. A particular ROI
00270 # always denotes the same window of pixels on the camera sensor,
00271 # regardless of binning settings.
00272 # The default setting of roi (all values 0) is considered the same as
00273 # full resolution (roi.width = width, roi.height = height).
00274 RegionOfInterest roi
00275
00276 ================================================================================
00277 MSG: std_msgs/Header
00278 # Standard metadata for higher-level stamped data types.
00279 # This is generally used to communicate timestamped data
00280 # in a particular coordinate frame.
00281 #
00282 # sequence ID: consecutively increasing ID
00283 uint32 seq
00284 #Two-integer timestamp that is expressed as:
00285 # * stamp.secs: seconds (stamp_secs) since epoch
00286 # * stamp.nsecs: nanoseconds since stamp_secs
00287 # time-handling sugar is provided by the client library
00288 time stamp
00289 #Frame this data is associated with
00290 # 0: no frame
00291 # 1: global frame
00292 string frame_id
00293
00294 ================================================================================
00295 MSG: sensor_msgs/RegionOfInterest
00296 # This message is used to specify a region of interest within an image.
00297 #
00298 # When used to specify the ROI setting of the camera when the image was
00299 # taken, the height and width fields should either match the height and
00300 # width fields for the associated image; or height = width = 0
00301 # indicates that the full resolution image was captured.
00302
00303 uint32 x_offset # Leftmost pixel of the ROI
00304 # (0 if the ROI includes the left edge of the image)
00305 uint32 y_offset # Topmost pixel of the ROI
00306 # (0 if the ROI includes the top edge of the image)
00307 uint32 height # Height of ROI
00308 uint32 width # Width of ROI
00309
00310 # True if a distinct rectified ROI should be calculated from the "raw"
00311 # ROI in this message. Typically this should be False if the full image
00312 # is captured (ROI not used), and True if a subwindow is captured (ROI
00313 # used).
00314 bool do_rectify
00315
00316 ================================================================================
00317 MSG: sensor_msgs/Image
00318 # This message contains an uncompressed image
00319 # (0, 0) is at top-left corner of image
00320 #
00321
00322 Header header # Header timestamp should be acquisition time of image
00323 # Header frame_id should be optical frame of camera
00324 # origin of frame should be optical center of cameara
00325 # +x should point to the right in the image
00326 # +y should point down in the image
00327 # +z should point into to plane of the image
00328 # If the frame_id here and the frame_id of the CameraInfo
00329 # message associated with the image conflict
00330 # the behavior is undefined
00331
00332 uint32 height # image height, that is, number of rows
00333 uint32 width # image width, that is, number of columns
00334
00335 # The legal values for encoding are in file src/image_encodings.cpp
00336 # If you want to standardize a new string format, join
00337 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00338
00339 string encoding # Encoding of pixels -- channel meaning, ordering, size
00340 # taken from the list of strings in src/image_encodings.cpp
00341
00342 uint8 is_bigendian # is this data bigendian?
00343 uint32 step # Full row length in bytes
00344 uint8[] data # actual matrix data, size is (step * rows)
00345
00346 """
00347 __slots__ = ['type','laserrange','laserpos','laserint','caminfo','camimage']
00348 _slot_types = ['string','float32[]','float32[]','float32[]','sensor_msgs/CameraInfo','sensor_msgs/Image']
00349
00350 def __init__(self, *args, **kwds):
00351 """
00352 Constructor. Any message fields that are implicitly/explicitly
00353 set to None will be assigned a default value. The recommend
00354 use is keyword arguments as this is more robust to future message
00355 changes. You cannot mix in-order arguments and keyword arguments.
00356
00357 The available fields are:
00358 type,laserrange,laserpos,laserint,caminfo,camimage
00359
00360 :param args: complete set of field values, in .msg order
00361 :param kwds: use keyword arguments corresponding to message field names
00362 to set specific fields.
00363 """
00364 if args or kwds:
00365 super(robot_sensorgetdataResponse, self).__init__(*args, **kwds)
00366
00367 if self.type is None:
00368 self.type = ''
00369 if self.laserrange is None:
00370 self.laserrange = []
00371 if self.laserpos is None:
00372 self.laserpos = []
00373 if self.laserint is None:
00374 self.laserint = []
00375 if self.caminfo is None:
00376 self.caminfo = sensor_msgs.msg.CameraInfo()
00377 if self.camimage is None:
00378 self.camimage = sensor_msgs.msg.Image()
00379 else:
00380 self.type = ''
00381 self.laserrange = []
00382 self.laserpos = []
00383 self.laserint = []
00384 self.caminfo = sensor_msgs.msg.CameraInfo()
00385 self.camimage = sensor_msgs.msg.Image()
00386
00387 def _get_types(self):
00388 """
00389 internal API method
00390 """
00391 return self._slot_types
00392
00393 def serialize(self, buff):
00394 """
00395 serialize message into buffer
00396 :param buff: buffer, ``StringIO``
00397 """
00398 try:
00399 _x = self.type
00400 length = len(_x)
00401 if python3 or type(_x) == unicode:
00402 _x = _x.encode('utf-8')
00403 length = len(_x)
00404 buff.write(struct.pack('<I%ss'%length, length, _x))
00405 length = len(self.laserrange)
00406 buff.write(_struct_I.pack(length))
00407 pattern = '<%sf'%length
00408 buff.write(struct.pack(pattern, *self.laserrange))
00409 length = len(self.laserpos)
00410 buff.write(_struct_I.pack(length))
00411 pattern = '<%sf'%length
00412 buff.write(struct.pack(pattern, *self.laserpos))
00413 length = len(self.laserint)
00414 buff.write(_struct_I.pack(length))
00415 pattern = '<%sf'%length
00416 buff.write(struct.pack(pattern, *self.laserint))
00417 _x = self
00418 buff.write(_struct_3I.pack(_x.caminfo.header.seq, _x.caminfo.header.stamp.secs, _x.caminfo.header.stamp.nsecs))
00419 _x = self.caminfo.header.frame_id
00420 length = len(_x)
00421 if python3 or type(_x) == unicode:
00422 _x = _x.encode('utf-8')
00423 length = len(_x)
00424 buff.write(struct.pack('<I%ss'%length, length, _x))
00425 _x = self
00426 buff.write(_struct_2I.pack(_x.caminfo.height, _x.caminfo.width))
00427 _x = self.caminfo.distortion_model
00428 length = len(_x)
00429 if python3 or type(_x) == unicode:
00430 _x = _x.encode('utf-8')
00431 length = len(_x)
00432 buff.write(struct.pack('<I%ss'%length, length, _x))
00433 length = len(self.caminfo.D)
00434 buff.write(_struct_I.pack(length))
00435 pattern = '<%sd'%length
00436 buff.write(struct.pack(pattern, *self.caminfo.D))
00437 buff.write(_struct_9d.pack(*self.caminfo.K))
00438 buff.write(_struct_9d.pack(*self.caminfo.R))
00439 buff.write(_struct_12d.pack(*self.caminfo.P))
00440 _x = self
00441 buff.write(_struct_6IB3I.pack(_x.caminfo.binning_x, _x.caminfo.binning_y, _x.caminfo.roi.x_offset, _x.caminfo.roi.y_offset, _x.caminfo.roi.height, _x.caminfo.roi.width, _x.caminfo.roi.do_rectify, _x.camimage.header.seq, _x.camimage.header.stamp.secs, _x.camimage.header.stamp.nsecs))
00442 _x = self.camimage.header.frame_id
00443 length = len(_x)
00444 if python3 or type(_x) == unicode:
00445 _x = _x.encode('utf-8')
00446 length = len(_x)
00447 buff.write(struct.pack('<I%ss'%length, length, _x))
00448 _x = self
00449 buff.write(_struct_2I.pack(_x.camimage.height, _x.camimage.width))
00450 _x = self.camimage.encoding
00451 length = len(_x)
00452 if python3 or type(_x) == unicode:
00453 _x = _x.encode('utf-8')
00454 length = len(_x)
00455 buff.write(struct.pack('<I%ss'%length, length, _x))
00456 _x = self
00457 buff.write(_struct_BI.pack(_x.camimage.is_bigendian, _x.camimage.step))
00458 _x = self.camimage.data
00459 length = len(_x)
00460
00461 if type(_x) in [list, tuple]:
00462 buff.write(struct.pack('<I%sB'%length, length, *_x))
00463 else:
00464 buff.write(struct.pack('<I%ss'%length, length, _x))
00465 except struct.error as se: self._check_types(se)
00466 except TypeError as te: self._check_types(te)
00467
00468 def deserialize(self, str):
00469 """
00470 unpack serialized message in str into this message instance
00471 :param str: byte array of serialized message, ``str``
00472 """
00473 try:
00474 if self.caminfo is None:
00475 self.caminfo = sensor_msgs.msg.CameraInfo()
00476 if self.camimage is None:
00477 self.camimage = sensor_msgs.msg.Image()
00478 end = 0
00479 start = end
00480 end += 4
00481 (length,) = _struct_I.unpack(str[start:end])
00482 start = end
00483 end += length
00484 if python3:
00485 self.type = str[start:end].decode('utf-8')
00486 else:
00487 self.type = str[start:end]
00488 start = end
00489 end += 4
00490 (length,) = _struct_I.unpack(str[start:end])
00491 pattern = '<%sf'%length
00492 start = end
00493 end += struct.calcsize(pattern)
00494 self.laserrange = struct.unpack(pattern, str[start:end])
00495 start = end
00496 end += 4
00497 (length,) = _struct_I.unpack(str[start:end])
00498 pattern = '<%sf'%length
00499 start = end
00500 end += struct.calcsize(pattern)
00501 self.laserpos = struct.unpack(pattern, 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 self.laserint = struct.unpack(pattern, str[start:end])
00509 _x = self
00510 start = end
00511 end += 12
00512 (_x.caminfo.header.seq, _x.caminfo.header.stamp.secs, _x.caminfo.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00513 start = end
00514 end += 4
00515 (length,) = _struct_I.unpack(str[start:end])
00516 start = end
00517 end += length
00518 if python3:
00519 self.caminfo.header.frame_id = str[start:end].decode('utf-8')
00520 else:
00521 self.caminfo.header.frame_id = str[start:end]
00522 _x = self
00523 start = end
00524 end += 8
00525 (_x.caminfo.height, _x.caminfo.width,) = _struct_2I.unpack(str[start:end])
00526 start = end
00527 end += 4
00528 (length,) = _struct_I.unpack(str[start:end])
00529 start = end
00530 end += length
00531 if python3:
00532 self.caminfo.distortion_model = str[start:end].decode('utf-8')
00533 else:
00534 self.caminfo.distortion_model = str[start:end]
00535 start = end
00536 end += 4
00537 (length,) = _struct_I.unpack(str[start:end])
00538 pattern = '<%sd'%length
00539 start = end
00540 end += struct.calcsize(pattern)
00541 self.caminfo.D = struct.unpack(pattern, str[start:end])
00542 start = end
00543 end += 72
00544 self.caminfo.K = _struct_9d.unpack(str[start:end])
00545 start = end
00546 end += 72
00547 self.caminfo.R = _struct_9d.unpack(str[start:end])
00548 start = end
00549 end += 96
00550 self.caminfo.P = _struct_12d.unpack(str[start:end])
00551 _x = self
00552 start = end
00553 end += 37
00554 (_x.caminfo.binning_x, _x.caminfo.binning_y, _x.caminfo.roi.x_offset, _x.caminfo.roi.y_offset, _x.caminfo.roi.height, _x.caminfo.roi.width, _x.caminfo.roi.do_rectify, _x.camimage.header.seq, _x.camimage.header.stamp.secs, _x.camimage.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
00555 self.caminfo.roi.do_rectify = bool(self.caminfo.roi.do_rectify)
00556 start = end
00557 end += 4
00558 (length,) = _struct_I.unpack(str[start:end])
00559 start = end
00560 end += length
00561 if python3:
00562 self.camimage.header.frame_id = str[start:end].decode('utf-8')
00563 else:
00564 self.camimage.header.frame_id = str[start:end]
00565 _x = self
00566 start = end
00567 end += 8
00568 (_x.camimage.height, _x.camimage.width,) = _struct_2I.unpack(str[start:end])
00569 start = end
00570 end += 4
00571 (length,) = _struct_I.unpack(str[start:end])
00572 start = end
00573 end += length
00574 if python3:
00575 self.camimage.encoding = str[start:end].decode('utf-8')
00576 else:
00577 self.camimage.encoding = str[start:end]
00578 _x = self
00579 start = end
00580 end += 5
00581 (_x.camimage.is_bigendian, _x.camimage.step,) = _struct_BI.unpack(str[start:end])
00582 start = end
00583 end += 4
00584 (length,) = _struct_I.unpack(str[start:end])
00585 start = end
00586 end += length
00587 if python3:
00588 self.camimage.data = str[start:end].decode('utf-8')
00589 else:
00590 self.camimage.data = str[start:end]
00591 return self
00592 except struct.error as e:
00593 raise genpy.DeserializationError(e)
00594
00595
00596 def serialize_numpy(self, buff, numpy):
00597 """
00598 serialize message with numpy array types into buffer
00599 :param buff: buffer, ``StringIO``
00600 :param numpy: numpy python module
00601 """
00602 try:
00603 _x = self.type
00604 length = len(_x)
00605 if python3 or type(_x) == unicode:
00606 _x = _x.encode('utf-8')
00607 length = len(_x)
00608 buff.write(struct.pack('<I%ss'%length, length, _x))
00609 length = len(self.laserrange)
00610 buff.write(_struct_I.pack(length))
00611 pattern = '<%sf'%length
00612 buff.write(self.laserrange.tostring())
00613 length = len(self.laserpos)
00614 buff.write(_struct_I.pack(length))
00615 pattern = '<%sf'%length
00616 buff.write(self.laserpos.tostring())
00617 length = len(self.laserint)
00618 buff.write(_struct_I.pack(length))
00619 pattern = '<%sf'%length
00620 buff.write(self.laserint.tostring())
00621 _x = self
00622 buff.write(_struct_3I.pack(_x.caminfo.header.seq, _x.caminfo.header.stamp.secs, _x.caminfo.header.stamp.nsecs))
00623 _x = self.caminfo.header.frame_id
00624 length = len(_x)
00625 if python3 or type(_x) == unicode:
00626 _x = _x.encode('utf-8')
00627 length = len(_x)
00628 buff.write(struct.pack('<I%ss'%length, length, _x))
00629 _x = self
00630 buff.write(_struct_2I.pack(_x.caminfo.height, _x.caminfo.width))
00631 _x = self.caminfo.distortion_model
00632 length = len(_x)
00633 if python3 or type(_x) == unicode:
00634 _x = _x.encode('utf-8')
00635 length = len(_x)
00636 buff.write(struct.pack('<I%ss'%length, length, _x))
00637 length = len(self.caminfo.D)
00638 buff.write(_struct_I.pack(length))
00639 pattern = '<%sd'%length
00640 buff.write(self.caminfo.D.tostring())
00641 buff.write(self.caminfo.K.tostring())
00642 buff.write(self.caminfo.R.tostring())
00643 buff.write(self.caminfo.P.tostring())
00644 _x = self
00645 buff.write(_struct_6IB3I.pack(_x.caminfo.binning_x, _x.caminfo.binning_y, _x.caminfo.roi.x_offset, _x.caminfo.roi.y_offset, _x.caminfo.roi.height, _x.caminfo.roi.width, _x.caminfo.roi.do_rectify, _x.camimage.header.seq, _x.camimage.header.stamp.secs, _x.camimage.header.stamp.nsecs))
00646 _x = self.camimage.header.frame_id
00647 length = len(_x)
00648 if python3 or type(_x) == unicode:
00649 _x = _x.encode('utf-8')
00650 length = len(_x)
00651 buff.write(struct.pack('<I%ss'%length, length, _x))
00652 _x = self
00653 buff.write(_struct_2I.pack(_x.camimage.height, _x.camimage.width))
00654 _x = self.camimage.encoding
00655 length = len(_x)
00656 if python3 or type(_x) == unicode:
00657 _x = _x.encode('utf-8')
00658 length = len(_x)
00659 buff.write(struct.pack('<I%ss'%length, length, _x))
00660 _x = self
00661 buff.write(_struct_BI.pack(_x.camimage.is_bigendian, _x.camimage.step))
00662 _x = self.camimage.data
00663 length = len(_x)
00664
00665 if type(_x) in [list, tuple]:
00666 buff.write(struct.pack('<I%sB'%length, length, *_x))
00667 else:
00668 buff.write(struct.pack('<I%ss'%length, length, _x))
00669 except struct.error as se: self._check_types(se)
00670 except TypeError as te: self._check_types(te)
00671
00672 def deserialize_numpy(self, str, numpy):
00673 """
00674 unpack serialized message in str into this message instance using numpy for array types
00675 :param str: byte array of serialized message, ``str``
00676 :param numpy: numpy python module
00677 """
00678 try:
00679 if self.caminfo is None:
00680 self.caminfo = sensor_msgs.msg.CameraInfo()
00681 if self.camimage is None:
00682 self.camimage = sensor_msgs.msg.Image()
00683 end = 0
00684 start = end
00685 end += 4
00686 (length,) = _struct_I.unpack(str[start:end])
00687 start = end
00688 end += length
00689 if python3:
00690 self.type = str[start:end].decode('utf-8')
00691 else:
00692 self.type = str[start:end]
00693 start = end
00694 end += 4
00695 (length,) = _struct_I.unpack(str[start:end])
00696 pattern = '<%sf'%length
00697 start = end
00698 end += struct.calcsize(pattern)
00699 self.laserrange = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00700 start = end
00701 end += 4
00702 (length,) = _struct_I.unpack(str[start:end])
00703 pattern = '<%sf'%length
00704 start = end
00705 end += struct.calcsize(pattern)
00706 self.laserpos = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00707 start = end
00708 end += 4
00709 (length,) = _struct_I.unpack(str[start:end])
00710 pattern = '<%sf'%length
00711 start = end
00712 end += struct.calcsize(pattern)
00713 self.laserint = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00714 _x = self
00715 start = end
00716 end += 12
00717 (_x.caminfo.header.seq, _x.caminfo.header.stamp.secs, _x.caminfo.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00718 start = end
00719 end += 4
00720 (length,) = _struct_I.unpack(str[start:end])
00721 start = end
00722 end += length
00723 if python3:
00724 self.caminfo.header.frame_id = str[start:end].decode('utf-8')
00725 else:
00726 self.caminfo.header.frame_id = str[start:end]
00727 _x = self
00728 start = end
00729 end += 8
00730 (_x.caminfo.height, _x.caminfo.width,) = _struct_2I.unpack(str[start:end])
00731 start = end
00732 end += 4
00733 (length,) = _struct_I.unpack(str[start:end])
00734 start = end
00735 end += length
00736 if python3:
00737 self.caminfo.distortion_model = str[start:end].decode('utf-8')
00738 else:
00739 self.caminfo.distortion_model = str[start:end]
00740 start = end
00741 end += 4
00742 (length,) = _struct_I.unpack(str[start:end])
00743 pattern = '<%sd'%length
00744 start = end
00745 end += struct.calcsize(pattern)
00746 self.caminfo.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00747 start = end
00748 end += 72
00749 self.caminfo.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00750 start = end
00751 end += 72
00752 self.caminfo.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00753 start = end
00754 end += 96
00755 self.caminfo.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12)
00756 _x = self
00757 start = end
00758 end += 37
00759 (_x.caminfo.binning_x, _x.caminfo.binning_y, _x.caminfo.roi.x_offset, _x.caminfo.roi.y_offset, _x.caminfo.roi.height, _x.caminfo.roi.width, _x.caminfo.roi.do_rectify, _x.camimage.header.seq, _x.camimage.header.stamp.secs, _x.camimage.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
00760 self.caminfo.roi.do_rectify = bool(self.caminfo.roi.do_rectify)
00761 start = end
00762 end += 4
00763 (length,) = _struct_I.unpack(str[start:end])
00764 start = end
00765 end += length
00766 if python3:
00767 self.camimage.header.frame_id = str[start:end].decode('utf-8')
00768 else:
00769 self.camimage.header.frame_id = str[start:end]
00770 _x = self
00771 start = end
00772 end += 8
00773 (_x.camimage.height, _x.camimage.width,) = _struct_2I.unpack(str[start:end])
00774 start = end
00775 end += 4
00776 (length,) = _struct_I.unpack(str[start:end])
00777 start = end
00778 end += length
00779 if python3:
00780 self.camimage.encoding = str[start:end].decode('utf-8')
00781 else:
00782 self.camimage.encoding = str[start:end]
00783 _x = self
00784 start = end
00785 end += 5
00786 (_x.camimage.is_bigendian, _x.camimage.step,) = _struct_BI.unpack(str[start:end])
00787 start = end
00788 end += 4
00789 (length,) = _struct_I.unpack(str[start:end])
00790 start = end
00791 end += length
00792 if python3:
00793 self.camimage.data = str[start:end].decode('utf-8')
00794 else:
00795 self.camimage.data = str[start:end]
00796 return self
00797 except struct.error as e:
00798 raise genpy.DeserializationError(e)
00799
00800 _struct_I = genpy.struct_I
00801 _struct_6IB3I = struct.Struct("<6IB3I")
00802 _struct_12d = struct.Struct("<12d")
00803 _struct_BI = struct.Struct("<BI")
00804 _struct_9d = struct.Struct("<9d")
00805 _struct_3I = struct.Struct("<3I")
00806 _struct_2I = struct.Struct("<2I")
00807 class robot_sensorgetdata(object):
00808 _type = 'openraveros/robot_sensorgetdata'
00809 _md5sum = 'aaa5981131035529f11bb57580150444'
00810 _request_class = robot_sensorgetdataRequest
00811 _response_class = robot_sensorgetdataResponse