00001 """autogenerated by genmsg_py from ReactiveLiftActionGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import trajectory_msgs.msg
00006 import object_manipulation_msgs.msg
00007 import roslib.rostime
00008 import actionlib_msgs.msg
00009 import geometry_msgs.msg
00010 import sensor_msgs.msg
00011 import std_msgs.msg
00012 import household_objects_database_msgs.msg
00013
00014 class ReactiveLiftActionGoal(roslib.message.Message):
00015 _md5sum = "3611eea603abd3b1208a6386c383ad64"
00016 _type = "object_manipulation_msgs/ReactiveLiftActionGoal"
00017 _has_header = True
00018 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00019
00020 Header header
00021 actionlib_msgs/GoalID goal_id
00022 ReactiveLiftGoal goal
00023
00024 ================================================================================
00025 MSG: std_msgs/Header
00026 # Standard metadata for higher-level stamped data types.
00027 # This is generally used to communicate timestamped data
00028 # in a particular coordinate frame.
00029 #
00030 # sequence ID: consecutively increasing ID
00031 uint32 seq
00032 #Two-integer timestamp that is expressed as:
00033 # * stamp.secs: seconds (stamp_secs) since epoch
00034 # * stamp.nsecs: nanoseconds since stamp_secs
00035 # time-handling sugar is provided by the client library
00036 time stamp
00037 #Frame this data is associated with
00038 # 0: no frame
00039 # 1: global frame
00040 string frame_id
00041
00042 ================================================================================
00043 MSG: actionlib_msgs/GoalID
00044 # The stamp should store the time at which this goal was requested.
00045 # It is used by an action server when it tries to preempt all
00046 # goals that were requested before a certain time
00047 time stamp
00048
00049 # The id provides a way to associate feedback and
00050 # result message with specific goal requests. The id
00051 # specified must be unique.
00052 string id
00053
00054
00055 ================================================================================
00056 MSG: object_manipulation_msgs/ReactiveLiftGoal
00057 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00058
00059 # the name of the arm being used
00060 string arm_name
00061
00062 # the object to be grasped
00063 GraspableObject target
00064
00065 # How the object should be lifted
00066 GripperTranslation lift
00067
00068 # the joint trajectory to use for the approach (if available)
00069 # this trajectory is expected to start at the current pose of the gripper
00070 # and end at the desired grasp pose
00071 trajectory_msgs/JointTrajectory trajectory
00072
00073 # the name of the support surface in the collision environment, if any
00074 string collision_support_surface_name
00075
00076
00077 ================================================================================
00078 MSG: object_manipulation_msgs/GraspableObject
00079 # an object that the object_manipulator can work on
00080
00081 # a graspable object can be represented in multiple ways. This message
00082 # can contain all of them. Which one is actually used is up to the receiver
00083 # of this message. When adding new representations, one must be careful that
00084 # they have reasonable lightweight defaults indicating that that particular
00085 # representation is not available.
00086
00087 # the tf frame to be used as a reference frame when combining information from
00088 # the different representations below
00089 string reference_frame_id
00090
00091 # potential recognition results from a database of models
00092 # all poses are relative to the object reference pose
00093 household_objects_database_msgs/DatabaseModelPose[] potential_models
00094
00095 # the point cloud itself
00096 sensor_msgs/PointCloud cluster
00097
00098 # a region of a PointCloud2 of interest
00099 object_manipulation_msgs/SceneRegion region
00100
00101
00102 ================================================================================
00103 MSG: household_objects_database_msgs/DatabaseModelPose
00104 # Informs that a specific model from the Model Database has been
00105 # identified at a certain location
00106
00107 # the database id of the model
00108 int32 model_id
00109
00110 # the pose that it can be found in
00111 geometry_msgs/PoseStamped pose
00112
00113 # a measure of the confidence level in this detection result
00114 float32 confidence
00115 ================================================================================
00116 MSG: geometry_msgs/PoseStamped
00117 # A Pose with reference coordinate frame and timestamp
00118 Header header
00119 Pose pose
00120
00121 ================================================================================
00122 MSG: geometry_msgs/Pose
00123 # A representation of pose in free space, composed of postion and orientation.
00124 Point position
00125 Quaternion orientation
00126
00127 ================================================================================
00128 MSG: geometry_msgs/Point
00129 # This contains the position of a point in free space
00130 float64 x
00131 float64 y
00132 float64 z
00133
00134 ================================================================================
00135 MSG: geometry_msgs/Quaternion
00136 # This represents an orientation in free space in quaternion form.
00137
00138 float64 x
00139 float64 y
00140 float64 z
00141 float64 w
00142
00143 ================================================================================
00144 MSG: sensor_msgs/PointCloud
00145 # This message holds a collection of 3d points, plus optional additional
00146 # information about each point.
00147
00148 # Time of sensor data acquisition, coordinate frame ID.
00149 Header header
00150
00151 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00152 # in the frame given in the header.
00153 geometry_msgs/Point32[] points
00154
00155 # Each channel should have the same number of elements as points array,
00156 # and the data in each channel should correspond 1:1 with each point.
00157 # Channel names in common practice are listed in ChannelFloat32.msg.
00158 ChannelFloat32[] channels
00159
00160 ================================================================================
00161 MSG: geometry_msgs/Point32
00162 # This contains the position of a point in free space(with 32 bits of precision).
00163 # It is recommeded to use Point wherever possible instead of Point32.
00164 #
00165 # This recommendation is to promote interoperability.
00166 #
00167 # This message is designed to take up less space when sending
00168 # lots of points at once, as in the case of a PointCloud.
00169
00170 float32 x
00171 float32 y
00172 float32 z
00173 ================================================================================
00174 MSG: sensor_msgs/ChannelFloat32
00175 # This message is used by the PointCloud message to hold optional data
00176 # associated with each point in the cloud. The length of the values
00177 # array should be the same as the length of the points array in the
00178 # PointCloud, and each value should be associated with the corresponding
00179 # point.
00180
00181 # Channel names in existing practice include:
00182 # "u", "v" - row and column (respectively) in the left stereo image.
00183 # This is opposite to usual conventions but remains for
00184 # historical reasons. The newer PointCloud2 message has no
00185 # such problem.
00186 # "rgb" - For point clouds produced by color stereo cameras. uint8
00187 # (R,G,B) values packed into the least significant 24 bits,
00188 # in order.
00189 # "intensity" - laser or pixel intensity.
00190 # "distance"
00191
00192 # The channel name should give semantics of the channel (e.g.
00193 # "intensity" instead of "value").
00194 string name
00195
00196 # The values array should be 1-1 with the elements of the associated
00197 # PointCloud.
00198 float32[] values
00199
00200 ================================================================================
00201 MSG: object_manipulation_msgs/SceneRegion
00202 # Point cloud
00203 sensor_msgs/PointCloud2 cloud
00204
00205 # Indices for the region of interest
00206 int32[] mask
00207
00208 # One of the corresponding 2D images, if applicable
00209 sensor_msgs/Image image
00210
00211 # The disparity image, if applicable
00212 sensor_msgs/Image disparity_image
00213
00214 # Camera info for the camera that took the image
00215 sensor_msgs/CameraInfo cam_info
00216
00217 ================================================================================
00218 MSG: sensor_msgs/PointCloud2
00219 # This message holds a collection of N-dimensional points, which may
00220 # contain additional information such as normals, intensity, etc. The
00221 # point data is stored as a binary blob, its layout described by the
00222 # contents of the "fields" array.
00223
00224 # The point cloud data may be organized 2d (image-like) or 1d
00225 # (unordered). Point clouds organized as 2d images may be produced by
00226 # camera depth sensors such as stereo or time-of-flight.
00227
00228 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00229 # points).
00230 Header header
00231
00232 # 2D structure of the point cloud. If the cloud is unordered, height is
00233 # 1 and width is the length of the point cloud.
00234 uint32 height
00235 uint32 width
00236
00237 # Describes the channels and their layout in the binary data blob.
00238 PointField[] fields
00239
00240 bool is_bigendian # Is this data bigendian?
00241 uint32 point_step # Length of a point in bytes
00242 uint32 row_step # Length of a row in bytes
00243 uint8[] data # Actual point data, size is (row_step*height)
00244
00245 bool is_dense # True if there are no invalid points
00246
00247 ================================================================================
00248 MSG: sensor_msgs/PointField
00249 # This message holds the description of one point entry in the
00250 # PointCloud2 message format.
00251 uint8 INT8 = 1
00252 uint8 UINT8 = 2
00253 uint8 INT16 = 3
00254 uint8 UINT16 = 4
00255 uint8 INT32 = 5
00256 uint8 UINT32 = 6
00257 uint8 FLOAT32 = 7
00258 uint8 FLOAT64 = 8
00259
00260 string name # Name of field
00261 uint32 offset # Offset from start of point struct
00262 uint8 datatype # Datatype enumeration, see above
00263 uint32 count # How many elements in the field
00264
00265 ================================================================================
00266 MSG: sensor_msgs/Image
00267 # This message contains an uncompressed image
00268 # (0, 0) is at top-left corner of image
00269 #
00270
00271 Header header # Header timestamp should be acquisition time of image
00272 # Header frame_id should be optical frame of camera
00273 # origin of frame should be optical center of cameara
00274 # +x should point to the right in the image
00275 # +y should point down in the image
00276 # +z should point into to plane of the image
00277 # If the frame_id here and the frame_id of the CameraInfo
00278 # message associated with the image conflict
00279 # the behavior is undefined
00280
00281 uint32 height # image height, that is, number of rows
00282 uint32 width # image width, that is, number of columns
00283
00284 # The legal values for encoding are in file src/image_encodings.cpp
00285 # If you want to standardize a new string format, join
00286 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00287
00288 string encoding # Encoding of pixels -- channel meaning, ordering, size
00289 # taken from the list of strings in src/image_encodings.cpp
00290
00291 uint8 is_bigendian # is this data bigendian?
00292 uint32 step # Full row length in bytes
00293 uint8[] data # actual matrix data, size is (step * rows)
00294
00295 ================================================================================
00296 MSG: sensor_msgs/CameraInfo
00297 # This message defines meta information for a camera. It should be in a
00298 # camera namespace on topic "camera_info" and accompanied by up to five
00299 # image topics named:
00300 #
00301 # image_raw - raw data from the camera driver, possibly Bayer encoded
00302 # image - monochrome, distorted
00303 # image_color - color, distorted
00304 # image_rect - monochrome, rectified
00305 # image_rect_color - color, rectified
00306 #
00307 # The image_pipeline contains packages (image_proc, stereo_image_proc)
00308 # for producing the four processed image topics from image_raw and
00309 # camera_info. The meaning of the camera parameters are described in
00310 # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
00311 #
00312 # The image_geometry package provides a user-friendly interface to
00313 # common operations using this meta information. If you want to, e.g.,
00314 # project a 3d point into image coordinates, we strongly recommend
00315 # using image_geometry.
00316 #
00317 # If the camera is uncalibrated, the matrices D, K, R, P should be left
00318 # zeroed out. In particular, clients may assume that K[0] == 0.0
00319 # indicates an uncalibrated camera.
00320
00321 #######################################################################
00322 # Image acquisition info #
00323 #######################################################################
00324
00325 # Time of image acquisition, camera coordinate frame ID
00326 Header header # Header timestamp should be acquisition time of image
00327 # Header frame_id should be optical frame of camera
00328 # origin of frame should be optical center of camera
00329 # +x should point to the right in the image
00330 # +y should point down in the image
00331 # +z should point into the plane of the image
00332
00333
00334 #######################################################################
00335 # Calibration Parameters #
00336 #######################################################################
00337 # These are fixed during camera calibration. Their values will be the #
00338 # same in all messages until the camera is recalibrated. Note that #
00339 # self-calibrating systems may "recalibrate" frequently. #
00340 # #
00341 # The internal parameters can be used to warp a raw (distorted) image #
00342 # to: #
00343 # 1. An undistorted image (requires D and K) #
00344 # 2. A rectified image (requires D, K, R) #
00345 # The projection matrix P projects 3D points into the rectified image.#
00346 #######################################################################
00347
00348 # The image dimensions with which the camera was calibrated. Normally
00349 # this will be the full camera resolution in pixels.
00350 uint32 height
00351 uint32 width
00352
00353 # The distortion model used. Supported models are listed in
00354 # sensor_msgs/distortion_models.h. For most cameras, "plumb_bob" - a
00355 # simple model of radial and tangential distortion - is sufficent.
00356 string distortion_model
00357
00358 # The distortion parameters, size depending on the distortion model.
00359 # For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3).
00360 float64[] D
00361
00362 # Intrinsic camera matrix for the raw (distorted) images.
00363 # [fx 0 cx]
00364 # K = [ 0 fy cy]
00365 # [ 0 0 1]
00366 # Projects 3D points in the camera coordinate frame to 2D pixel
00367 # coordinates using the focal lengths (fx, fy) and principal point
00368 # (cx, cy).
00369 float64[9] K # 3x3 row-major matrix
00370
00371 # Rectification matrix (stereo cameras only)
00372 # A rotation matrix aligning the camera coordinate system to the ideal
00373 # stereo image plane so that epipolar lines in both stereo images are
00374 # parallel.
00375 float64[9] R # 3x3 row-major matrix
00376
00377 # Projection/camera matrix
00378 # [fx' 0 cx' Tx]
00379 # P = [ 0 fy' cy' Ty]
00380 # [ 0 0 1 0]
00381 # By convention, this matrix specifies the intrinsic (camera) matrix
00382 # of the processed (rectified) image. That is, the left 3x3 portion
00383 # is the normal camera intrinsic matrix for the rectified image.
00384 # It projects 3D points in the camera coordinate frame to 2D pixel
00385 # coordinates using the focal lengths (fx', fy') and principal point
00386 # (cx', cy') - these may differ from the values in K.
00387 # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
00388 # also have R = the identity and P[1:3,1:3] = K.
00389 # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
00390 # position of the optical center of the second camera in the first
00391 # camera's frame. We assume Tz = 0 so both cameras are in the same
00392 # stereo image plane. The first camera always has Tx = Ty = 0. For
00393 # the right (second) camera of a horizontal stereo pair, Ty = 0 and
00394 # Tx = -fx' * B, where B is the baseline between the cameras.
00395 # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
00396 # the rectified image is given by:
00397 # [u v w]' = P * [X Y Z 1]'
00398 # x = u / w
00399 # y = v / w
00400 # This holds for both images of a stereo pair.
00401 float64[12] P # 3x4 row-major matrix
00402
00403
00404 #######################################################################
00405 # Operational Parameters #
00406 #######################################################################
00407 # These define the image region actually captured by the camera #
00408 # driver. Although they affect the geometry of the output image, they #
00409 # may be changed freely without recalibrating the camera. #
00410 #######################################################################
00411
00412 # Binning refers here to any camera setting which combines rectangular
00413 # neighborhoods of pixels into larger "super-pixels." It reduces the
00414 # resolution of the output image to
00415 # (width / binning_x) x (height / binning_y).
00416 # The default values binning_x = binning_y = 0 is considered the same
00417 # as binning_x = binning_y = 1 (no subsampling).
00418 uint32 binning_x
00419 uint32 binning_y
00420
00421 # Region of interest (subwindow of full camera resolution), given in
00422 # full resolution (unbinned) image coordinates. A particular ROI
00423 # always denotes the same window of pixels on the camera sensor,
00424 # regardless of binning settings.
00425 # The default setting of roi (all values 0) is considered the same as
00426 # full resolution (roi.width = width, roi.height = height).
00427 RegionOfInterest roi
00428
00429 ================================================================================
00430 MSG: sensor_msgs/RegionOfInterest
00431 # This message is used to specify a region of interest within an image.
00432 #
00433 # When used to specify the ROI setting of the camera when the image was
00434 # taken, the height and width fields should either match the height and
00435 # width fields for the associated image; or height = width = 0
00436 # indicates that the full resolution image was captured.
00437
00438 uint32 x_offset # Leftmost pixel of the ROI
00439 # (0 if the ROI includes the left edge of the image)
00440 uint32 y_offset # Topmost pixel of the ROI
00441 # (0 if the ROI includes the top edge of the image)
00442 uint32 height # Height of ROI
00443 uint32 width # Width of ROI
00444
00445 # True if a distinct rectified ROI should be calculated from the "raw"
00446 # ROI in this message. Typically this should be False if the full image
00447 # is captured (ROI not used), and True if a subwindow is captured (ROI
00448 # used).
00449 bool do_rectify
00450
00451 ================================================================================
00452 MSG: object_manipulation_msgs/GripperTranslation
00453 # defines a translation for the gripper, used in pickup or place tasks
00454 # for example for lifting an object off a table or approaching the table for placing
00455
00456 # the direction of the translation
00457 geometry_msgs/Vector3Stamped direction
00458
00459 # the desired translation distance
00460 float32 desired_distance
00461
00462 # the min distance that must be considered feasible before the
00463 # grasp is even attempted
00464 float32 min_distance
00465 ================================================================================
00466 MSG: geometry_msgs/Vector3Stamped
00467 # This represents a Vector3 with reference coordinate frame and timestamp
00468 Header header
00469 Vector3 vector
00470
00471 ================================================================================
00472 MSG: geometry_msgs/Vector3
00473 # This represents a vector in free space.
00474
00475 float64 x
00476 float64 y
00477 float64 z
00478 ================================================================================
00479 MSG: trajectory_msgs/JointTrajectory
00480 Header header
00481 string[] joint_names
00482 JointTrajectoryPoint[] points
00483 ================================================================================
00484 MSG: trajectory_msgs/JointTrajectoryPoint
00485 float64[] positions
00486 float64[] velocities
00487 float64[] accelerations
00488 duration time_from_start
00489 """
00490 __slots__ = ['header','goal_id','goal']
00491 _slot_types = ['Header','actionlib_msgs/GoalID','object_manipulation_msgs/ReactiveLiftGoal']
00492
00493 def __init__(self, *args, **kwds):
00494 """
00495 Constructor. Any message fields that are implicitly/explicitly
00496 set to None will be assigned a default value. The recommend
00497 use is keyword arguments as this is more robust to future message
00498 changes. You cannot mix in-order arguments and keyword arguments.
00499
00500 The available fields are:
00501 header,goal_id,goal
00502
00503 @param args: complete set of field values, in .msg order
00504 @param kwds: use keyword arguments corresponding to message field names
00505 to set specific fields.
00506 """
00507 if args or kwds:
00508 super(ReactiveLiftActionGoal, self).__init__(*args, **kwds)
00509 #message fields cannot be None, assign default values for those that are
00510 if self.header is None:
00511 self.header = std_msgs.msg._Header.Header()
00512 if self.goal_id is None:
00513 self.goal_id = actionlib_msgs.msg.GoalID()
00514 if self.goal is None:
00515 self.goal = object_manipulation_msgs.msg.ReactiveLiftGoal()
00516 else:
00517 self.header = std_msgs.msg._Header.Header()
00518 self.goal_id = actionlib_msgs.msg.GoalID()
00519 self.goal = object_manipulation_msgs.msg.ReactiveLiftGoal()
00520
00521 def _get_types(self):
00522 """
00523 internal API method
00524 """
00525 return self._slot_types
00526
00527 def serialize(self, buff):
00528 """
00529 serialize message into buffer
00530 @param buff: buffer
00531 @type buff: StringIO
00532 """
00533 try:
00534 _x = self
00535 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00536 _x = self.header.frame_id
00537 length = len(_x)
00538 buff.write(struct.pack('<I%ss'%length, length, _x))
00539 _x = self
00540 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00541 _x = self.goal_id.id
00542 length = len(_x)
00543 buff.write(struct.pack('<I%ss'%length, length, _x))
00544 _x = self.goal.arm_name
00545 length = len(_x)
00546 buff.write(struct.pack('<I%ss'%length, length, _x))
00547 _x = self.goal.target.reference_frame_id
00548 length = len(_x)
00549 buff.write(struct.pack('<I%ss'%length, length, _x))
00550 length = len(self.goal.target.potential_models)
00551 buff.write(_struct_I.pack(length))
00552 for val1 in self.goal.target.potential_models:
00553 buff.write(_struct_i.pack(val1.model_id))
00554 _v1 = val1.pose
00555 _v2 = _v1.header
00556 buff.write(_struct_I.pack(_v2.seq))
00557 _v3 = _v2.stamp
00558 _x = _v3
00559 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00560 _x = _v2.frame_id
00561 length = len(_x)
00562 buff.write(struct.pack('<I%ss'%length, length, _x))
00563 _v4 = _v1.pose
00564 _v5 = _v4.position
00565 _x = _v5
00566 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00567 _v6 = _v4.orientation
00568 _x = _v6
00569 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00570 buff.write(_struct_f.pack(val1.confidence))
00571 _x = self
00572 buff.write(_struct_3I.pack(_x.goal.target.cluster.header.seq, _x.goal.target.cluster.header.stamp.secs, _x.goal.target.cluster.header.stamp.nsecs))
00573 _x = self.goal.target.cluster.header.frame_id
00574 length = len(_x)
00575 buff.write(struct.pack('<I%ss'%length, length, _x))
00576 length = len(self.goal.target.cluster.points)
00577 buff.write(_struct_I.pack(length))
00578 for val1 in self.goal.target.cluster.points:
00579 _x = val1
00580 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00581 length = len(self.goal.target.cluster.channels)
00582 buff.write(_struct_I.pack(length))
00583 for val1 in self.goal.target.cluster.channels:
00584 _x = val1.name
00585 length = len(_x)
00586 buff.write(struct.pack('<I%ss'%length, length, _x))
00587 length = len(val1.values)
00588 buff.write(_struct_I.pack(length))
00589 pattern = '<%sf'%length
00590 buff.write(struct.pack(pattern, *val1.values))
00591 _x = self
00592 buff.write(_struct_3I.pack(_x.goal.target.region.cloud.header.seq, _x.goal.target.region.cloud.header.stamp.secs, _x.goal.target.region.cloud.header.stamp.nsecs))
00593 _x = self.goal.target.region.cloud.header.frame_id
00594 length = len(_x)
00595 buff.write(struct.pack('<I%ss'%length, length, _x))
00596 _x = self
00597 buff.write(_struct_2I.pack(_x.goal.target.region.cloud.height, _x.goal.target.region.cloud.width))
00598 length = len(self.goal.target.region.cloud.fields)
00599 buff.write(_struct_I.pack(length))
00600 for val1 in self.goal.target.region.cloud.fields:
00601 _x = val1.name
00602 length = len(_x)
00603 buff.write(struct.pack('<I%ss'%length, length, _x))
00604 _x = val1
00605 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00606 _x = self
00607 buff.write(_struct_B2I.pack(_x.goal.target.region.cloud.is_bigendian, _x.goal.target.region.cloud.point_step, _x.goal.target.region.cloud.row_step))
00608 _x = self.goal.target.region.cloud.data
00609 length = len(_x)
00610 # - if encoded as a list instead, serialize as bytes instead of string
00611 if type(_x) in [list, tuple]:
00612 buff.write(struct.pack('<I%sB'%length, length, *_x))
00613 else:
00614 buff.write(struct.pack('<I%ss'%length, length, _x))
00615 buff.write(_struct_B.pack(self.goal.target.region.cloud.is_dense))
00616 length = len(self.goal.target.region.mask)
00617 buff.write(_struct_I.pack(length))
00618 pattern = '<%si'%length
00619 buff.write(struct.pack(pattern, *self.goal.target.region.mask))
00620 _x = self
00621 buff.write(_struct_3I.pack(_x.goal.target.region.image.header.seq, _x.goal.target.region.image.header.stamp.secs, _x.goal.target.region.image.header.stamp.nsecs))
00622 _x = self.goal.target.region.image.header.frame_id
00623 length = len(_x)
00624 buff.write(struct.pack('<I%ss'%length, length, _x))
00625 _x = self
00626 buff.write(_struct_2I.pack(_x.goal.target.region.image.height, _x.goal.target.region.image.width))
00627 _x = self.goal.target.region.image.encoding
00628 length = len(_x)
00629 buff.write(struct.pack('<I%ss'%length, length, _x))
00630 _x = self
00631 buff.write(_struct_BI.pack(_x.goal.target.region.image.is_bigendian, _x.goal.target.region.image.step))
00632 _x = self.goal.target.region.image.data
00633 length = len(_x)
00634 # - if encoded as a list instead, serialize as bytes instead of string
00635 if type(_x) in [list, tuple]:
00636 buff.write(struct.pack('<I%sB'%length, length, *_x))
00637 else:
00638 buff.write(struct.pack('<I%ss'%length, length, _x))
00639 _x = self
00640 buff.write(_struct_3I.pack(_x.goal.target.region.disparity_image.header.seq, _x.goal.target.region.disparity_image.header.stamp.secs, _x.goal.target.region.disparity_image.header.stamp.nsecs))
00641 _x = self.goal.target.region.disparity_image.header.frame_id
00642 length = len(_x)
00643 buff.write(struct.pack('<I%ss'%length, length, _x))
00644 _x = self
00645 buff.write(_struct_2I.pack(_x.goal.target.region.disparity_image.height, _x.goal.target.region.disparity_image.width))
00646 _x = self.goal.target.region.disparity_image.encoding
00647 length = len(_x)
00648 buff.write(struct.pack('<I%ss'%length, length, _x))
00649 _x = self
00650 buff.write(_struct_BI.pack(_x.goal.target.region.disparity_image.is_bigendian, _x.goal.target.region.disparity_image.step))
00651 _x = self.goal.target.region.disparity_image.data
00652 length = len(_x)
00653 # - if encoded as a list instead, serialize as bytes instead of string
00654 if type(_x) in [list, tuple]:
00655 buff.write(struct.pack('<I%sB'%length, length, *_x))
00656 else:
00657 buff.write(struct.pack('<I%ss'%length, length, _x))
00658 _x = self
00659 buff.write(_struct_3I.pack(_x.goal.target.region.cam_info.header.seq, _x.goal.target.region.cam_info.header.stamp.secs, _x.goal.target.region.cam_info.header.stamp.nsecs))
00660 _x = self.goal.target.region.cam_info.header.frame_id
00661 length = len(_x)
00662 buff.write(struct.pack('<I%ss'%length, length, _x))
00663 _x = self
00664 buff.write(_struct_2I.pack(_x.goal.target.region.cam_info.height, _x.goal.target.region.cam_info.width))
00665 _x = self.goal.target.region.cam_info.distortion_model
00666 length = len(_x)
00667 buff.write(struct.pack('<I%ss'%length, length, _x))
00668 length = len(self.goal.target.region.cam_info.D)
00669 buff.write(_struct_I.pack(length))
00670 pattern = '<%sd'%length
00671 buff.write(struct.pack(pattern, *self.goal.target.region.cam_info.D))
00672 buff.write(_struct_9d.pack(*self.goal.target.region.cam_info.K))
00673 buff.write(_struct_9d.pack(*self.goal.target.region.cam_info.R))
00674 buff.write(_struct_12d.pack(*self.goal.target.region.cam_info.P))
00675 _x = self
00676 buff.write(_struct_6IB3I.pack(_x.goal.target.region.cam_info.binning_x, _x.goal.target.region.cam_info.binning_y, _x.goal.target.region.cam_info.roi.x_offset, _x.goal.target.region.cam_info.roi.y_offset, _x.goal.target.region.cam_info.roi.height, _x.goal.target.region.cam_info.roi.width, _x.goal.target.region.cam_info.roi.do_rectify, _x.goal.lift.direction.header.seq, _x.goal.lift.direction.header.stamp.secs, _x.goal.lift.direction.header.stamp.nsecs))
00677 _x = self.goal.lift.direction.header.frame_id
00678 length = len(_x)
00679 buff.write(struct.pack('<I%ss'%length, length, _x))
00680 _x = self
00681 buff.write(_struct_3d2f3I.pack(_x.goal.lift.direction.vector.x, _x.goal.lift.direction.vector.y, _x.goal.lift.direction.vector.z, _x.goal.lift.desired_distance, _x.goal.lift.min_distance, _x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs))
00682 _x = self.goal.trajectory.header.frame_id
00683 length = len(_x)
00684 buff.write(struct.pack('<I%ss'%length, length, _x))
00685 length = len(self.goal.trajectory.joint_names)
00686 buff.write(_struct_I.pack(length))
00687 for val1 in self.goal.trajectory.joint_names:
00688 length = len(val1)
00689 buff.write(struct.pack('<I%ss'%length, length, val1))
00690 length = len(self.goal.trajectory.points)
00691 buff.write(_struct_I.pack(length))
00692 for val1 in self.goal.trajectory.points:
00693 length = len(val1.positions)
00694 buff.write(_struct_I.pack(length))
00695 pattern = '<%sd'%length
00696 buff.write(struct.pack(pattern, *val1.positions))
00697 length = len(val1.velocities)
00698 buff.write(_struct_I.pack(length))
00699 pattern = '<%sd'%length
00700 buff.write(struct.pack(pattern, *val1.velocities))
00701 length = len(val1.accelerations)
00702 buff.write(_struct_I.pack(length))
00703 pattern = '<%sd'%length
00704 buff.write(struct.pack(pattern, *val1.accelerations))
00705 _v7 = val1.time_from_start
00706 _x = _v7
00707 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00708 _x = self.goal.collision_support_surface_name
00709 length = len(_x)
00710 buff.write(struct.pack('<I%ss'%length, length, _x))
00711 except struct.error, se: self._check_types(se)
00712 except TypeError, te: self._check_types(te)
00713
00714 def deserialize(self, str):
00715 """
00716 unpack serialized message in str into this message instance
00717 @param str: byte array of serialized message
00718 @type str: str
00719 """
00720 try:
00721 if self.header is None:
00722 self.header = std_msgs.msg._Header.Header()
00723 if self.goal_id is None:
00724 self.goal_id = actionlib_msgs.msg.GoalID()
00725 if self.goal is None:
00726 self.goal = object_manipulation_msgs.msg.ReactiveLiftGoal()
00727 end = 0
00728 _x = self
00729 start = end
00730 end += 12
00731 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00732 start = end
00733 end += 4
00734 (length,) = _struct_I.unpack(str[start:end])
00735 start = end
00736 end += length
00737 self.header.frame_id = str[start:end]
00738 _x = self
00739 start = end
00740 end += 8
00741 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00742 start = end
00743 end += 4
00744 (length,) = _struct_I.unpack(str[start:end])
00745 start = end
00746 end += length
00747 self.goal_id.id = str[start:end]
00748 start = end
00749 end += 4
00750 (length,) = _struct_I.unpack(str[start:end])
00751 start = end
00752 end += length
00753 self.goal.arm_name = str[start:end]
00754 start = end
00755 end += 4
00756 (length,) = _struct_I.unpack(str[start:end])
00757 start = end
00758 end += length
00759 self.goal.target.reference_frame_id = str[start:end]
00760 start = end
00761 end += 4
00762 (length,) = _struct_I.unpack(str[start:end])
00763 self.goal.target.potential_models = []
00764 for i in xrange(0, length):
00765 val1 = household_objects_database_msgs.msg.DatabaseModelPose()
00766 start = end
00767 end += 4
00768 (val1.model_id,) = _struct_i.unpack(str[start:end])
00769 _v8 = val1.pose
00770 _v9 = _v8.header
00771 start = end
00772 end += 4
00773 (_v9.seq,) = _struct_I.unpack(str[start:end])
00774 _v10 = _v9.stamp
00775 _x = _v10
00776 start = end
00777 end += 8
00778 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00779 start = end
00780 end += 4
00781 (length,) = _struct_I.unpack(str[start:end])
00782 start = end
00783 end += length
00784 _v9.frame_id = str[start:end]
00785 _v11 = _v8.pose
00786 _v12 = _v11.position
00787 _x = _v12
00788 start = end
00789 end += 24
00790 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00791 _v13 = _v11.orientation
00792 _x = _v13
00793 start = end
00794 end += 32
00795 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00796 start = end
00797 end += 4
00798 (val1.confidence,) = _struct_f.unpack(str[start:end])
00799 self.goal.target.potential_models.append(val1)
00800 _x = self
00801 start = end
00802 end += 12
00803 (_x.goal.target.cluster.header.seq, _x.goal.target.cluster.header.stamp.secs, _x.goal.target.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00804 start = end
00805 end += 4
00806 (length,) = _struct_I.unpack(str[start:end])
00807 start = end
00808 end += length
00809 self.goal.target.cluster.header.frame_id = str[start:end]
00810 start = end
00811 end += 4
00812 (length,) = _struct_I.unpack(str[start:end])
00813 self.goal.target.cluster.points = []
00814 for i in xrange(0, length):
00815 val1 = geometry_msgs.msg.Point32()
00816 _x = val1
00817 start = end
00818 end += 12
00819 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00820 self.goal.target.cluster.points.append(val1)
00821 start = end
00822 end += 4
00823 (length,) = _struct_I.unpack(str[start:end])
00824 self.goal.target.cluster.channels = []
00825 for i in xrange(0, length):
00826 val1 = sensor_msgs.msg.ChannelFloat32()
00827 start = end
00828 end += 4
00829 (length,) = _struct_I.unpack(str[start:end])
00830 start = end
00831 end += length
00832 val1.name = str[start:end]
00833 start = end
00834 end += 4
00835 (length,) = _struct_I.unpack(str[start:end])
00836 pattern = '<%sf'%length
00837 start = end
00838 end += struct.calcsize(pattern)
00839 val1.values = struct.unpack(pattern, str[start:end])
00840 self.goal.target.cluster.channels.append(val1)
00841 _x = self
00842 start = end
00843 end += 12
00844 (_x.goal.target.region.cloud.header.seq, _x.goal.target.region.cloud.header.stamp.secs, _x.goal.target.region.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00845 start = end
00846 end += 4
00847 (length,) = _struct_I.unpack(str[start:end])
00848 start = end
00849 end += length
00850 self.goal.target.region.cloud.header.frame_id = str[start:end]
00851 _x = self
00852 start = end
00853 end += 8
00854 (_x.goal.target.region.cloud.height, _x.goal.target.region.cloud.width,) = _struct_2I.unpack(str[start:end])
00855 start = end
00856 end += 4
00857 (length,) = _struct_I.unpack(str[start:end])
00858 self.goal.target.region.cloud.fields = []
00859 for i in xrange(0, length):
00860 val1 = sensor_msgs.msg.PointField()
00861 start = end
00862 end += 4
00863 (length,) = _struct_I.unpack(str[start:end])
00864 start = end
00865 end += length
00866 val1.name = str[start:end]
00867 _x = val1
00868 start = end
00869 end += 9
00870 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00871 self.goal.target.region.cloud.fields.append(val1)
00872 _x = self
00873 start = end
00874 end += 9
00875 (_x.goal.target.region.cloud.is_bigendian, _x.goal.target.region.cloud.point_step, _x.goal.target.region.cloud.row_step,) = _struct_B2I.unpack(str[start:end])
00876 self.goal.target.region.cloud.is_bigendian = bool(self.goal.target.region.cloud.is_bigendian)
00877 start = end
00878 end += 4
00879 (length,) = _struct_I.unpack(str[start:end])
00880 start = end
00881 end += length
00882 self.goal.target.region.cloud.data = str[start:end]
00883 start = end
00884 end += 1
00885 (self.goal.target.region.cloud.is_dense,) = _struct_B.unpack(str[start:end])
00886 self.goal.target.region.cloud.is_dense = bool(self.goal.target.region.cloud.is_dense)
00887 start = end
00888 end += 4
00889 (length,) = _struct_I.unpack(str[start:end])
00890 pattern = '<%si'%length
00891 start = end
00892 end += struct.calcsize(pattern)
00893 self.goal.target.region.mask = struct.unpack(pattern, str[start:end])
00894 _x = self
00895 start = end
00896 end += 12
00897 (_x.goal.target.region.image.header.seq, _x.goal.target.region.image.header.stamp.secs, _x.goal.target.region.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00898 start = end
00899 end += 4
00900 (length,) = _struct_I.unpack(str[start:end])
00901 start = end
00902 end += length
00903 self.goal.target.region.image.header.frame_id = str[start:end]
00904 _x = self
00905 start = end
00906 end += 8
00907 (_x.goal.target.region.image.height, _x.goal.target.region.image.width,) = _struct_2I.unpack(str[start:end])
00908 start = end
00909 end += 4
00910 (length,) = _struct_I.unpack(str[start:end])
00911 start = end
00912 end += length
00913 self.goal.target.region.image.encoding = str[start:end]
00914 _x = self
00915 start = end
00916 end += 5
00917 (_x.goal.target.region.image.is_bigendian, _x.goal.target.region.image.step,) = _struct_BI.unpack(str[start:end])
00918 start = end
00919 end += 4
00920 (length,) = _struct_I.unpack(str[start:end])
00921 start = end
00922 end += length
00923 self.goal.target.region.image.data = str[start:end]
00924 _x = self
00925 start = end
00926 end += 12
00927 (_x.goal.target.region.disparity_image.header.seq, _x.goal.target.region.disparity_image.header.stamp.secs, _x.goal.target.region.disparity_image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00928 start = end
00929 end += 4
00930 (length,) = _struct_I.unpack(str[start:end])
00931 start = end
00932 end += length
00933 self.goal.target.region.disparity_image.header.frame_id = str[start:end]
00934 _x = self
00935 start = end
00936 end += 8
00937 (_x.goal.target.region.disparity_image.height, _x.goal.target.region.disparity_image.width,) = _struct_2I.unpack(str[start:end])
00938 start = end
00939 end += 4
00940 (length,) = _struct_I.unpack(str[start:end])
00941 start = end
00942 end += length
00943 self.goal.target.region.disparity_image.encoding = str[start:end]
00944 _x = self
00945 start = end
00946 end += 5
00947 (_x.goal.target.region.disparity_image.is_bigendian, _x.goal.target.region.disparity_image.step,) = _struct_BI.unpack(str[start:end])
00948 start = end
00949 end += 4
00950 (length,) = _struct_I.unpack(str[start:end])
00951 start = end
00952 end += length
00953 self.goal.target.region.disparity_image.data = str[start:end]
00954 _x = self
00955 start = end
00956 end += 12
00957 (_x.goal.target.region.cam_info.header.seq, _x.goal.target.region.cam_info.header.stamp.secs, _x.goal.target.region.cam_info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00958 start = end
00959 end += 4
00960 (length,) = _struct_I.unpack(str[start:end])
00961 start = end
00962 end += length
00963 self.goal.target.region.cam_info.header.frame_id = str[start:end]
00964 _x = self
00965 start = end
00966 end += 8
00967 (_x.goal.target.region.cam_info.height, _x.goal.target.region.cam_info.width,) = _struct_2I.unpack(str[start:end])
00968 start = end
00969 end += 4
00970 (length,) = _struct_I.unpack(str[start:end])
00971 start = end
00972 end += length
00973 self.goal.target.region.cam_info.distortion_model = str[start:end]
00974 start = end
00975 end += 4
00976 (length,) = _struct_I.unpack(str[start:end])
00977 pattern = '<%sd'%length
00978 start = end
00979 end += struct.calcsize(pattern)
00980 self.goal.target.region.cam_info.D = struct.unpack(pattern, str[start:end])
00981 start = end
00982 end += 72
00983 self.goal.target.region.cam_info.K = _struct_9d.unpack(str[start:end])
00984 start = end
00985 end += 72
00986 self.goal.target.region.cam_info.R = _struct_9d.unpack(str[start:end])
00987 start = end
00988 end += 96
00989 self.goal.target.region.cam_info.P = _struct_12d.unpack(str[start:end])
00990 _x = self
00991 start = end
00992 end += 37
00993 (_x.goal.target.region.cam_info.binning_x, _x.goal.target.region.cam_info.binning_y, _x.goal.target.region.cam_info.roi.x_offset, _x.goal.target.region.cam_info.roi.y_offset, _x.goal.target.region.cam_info.roi.height, _x.goal.target.region.cam_info.roi.width, _x.goal.target.region.cam_info.roi.do_rectify, _x.goal.lift.direction.header.seq, _x.goal.lift.direction.header.stamp.secs, _x.goal.lift.direction.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
00994 self.goal.target.region.cam_info.roi.do_rectify = bool(self.goal.target.region.cam_info.roi.do_rectify)
00995 start = end
00996 end += 4
00997 (length,) = _struct_I.unpack(str[start:end])
00998 start = end
00999 end += length
01000 self.goal.lift.direction.header.frame_id = str[start:end]
01001 _x = self
01002 start = end
01003 end += 44
01004 (_x.goal.lift.direction.vector.x, _x.goal.lift.direction.vector.y, _x.goal.lift.direction.vector.z, _x.goal.lift.desired_distance, _x.goal.lift.min_distance, _x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs,) = _struct_3d2f3I.unpack(str[start:end])
01005 start = end
01006 end += 4
01007 (length,) = _struct_I.unpack(str[start:end])
01008 start = end
01009 end += length
01010 self.goal.trajectory.header.frame_id = str[start:end]
01011 start = end
01012 end += 4
01013 (length,) = _struct_I.unpack(str[start:end])
01014 self.goal.trajectory.joint_names = []
01015 for i in xrange(0, length):
01016 start = end
01017 end += 4
01018 (length,) = _struct_I.unpack(str[start:end])
01019 start = end
01020 end += length
01021 val1 = str[start:end]
01022 self.goal.trajectory.joint_names.append(val1)
01023 start = end
01024 end += 4
01025 (length,) = _struct_I.unpack(str[start:end])
01026 self.goal.trajectory.points = []
01027 for i in xrange(0, length):
01028 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
01029 start = end
01030 end += 4
01031 (length,) = _struct_I.unpack(str[start:end])
01032 pattern = '<%sd'%length
01033 start = end
01034 end += struct.calcsize(pattern)
01035 val1.positions = struct.unpack(pattern, str[start:end])
01036 start = end
01037 end += 4
01038 (length,) = _struct_I.unpack(str[start:end])
01039 pattern = '<%sd'%length
01040 start = end
01041 end += struct.calcsize(pattern)
01042 val1.velocities = struct.unpack(pattern, str[start:end])
01043 start = end
01044 end += 4
01045 (length,) = _struct_I.unpack(str[start:end])
01046 pattern = '<%sd'%length
01047 start = end
01048 end += struct.calcsize(pattern)
01049 val1.accelerations = struct.unpack(pattern, str[start:end])
01050 _v14 = val1.time_from_start
01051 _x = _v14
01052 start = end
01053 end += 8
01054 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
01055 self.goal.trajectory.points.append(val1)
01056 start = end
01057 end += 4
01058 (length,) = _struct_I.unpack(str[start:end])
01059 start = end
01060 end += length
01061 self.goal.collision_support_surface_name = str[start:end]
01062 return self
01063 except struct.error, e:
01064 raise roslib.message.DeserializationError(e) #most likely buffer underfill
01065
01066
01067 def serialize_numpy(self, buff, numpy):
01068 """
01069 serialize message with numpy array types into buffer
01070 @param buff: buffer
01071 @type buff: StringIO
01072 @param numpy: numpy python module
01073 @type numpy module
01074 """
01075 try:
01076 _x = self
01077 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
01078 _x = self.header.frame_id
01079 length = len(_x)
01080 buff.write(struct.pack('<I%ss'%length, length, _x))
01081 _x = self
01082 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
01083 _x = self.goal_id.id
01084 length = len(_x)
01085 buff.write(struct.pack('<I%ss'%length, length, _x))
01086 _x = self.goal.arm_name
01087 length = len(_x)
01088 buff.write(struct.pack('<I%ss'%length, length, _x))
01089 _x = self.goal.target.reference_frame_id
01090 length = len(_x)
01091 buff.write(struct.pack('<I%ss'%length, length, _x))
01092 length = len(self.goal.target.potential_models)
01093 buff.write(_struct_I.pack(length))
01094 for val1 in self.goal.target.potential_models:
01095 buff.write(_struct_i.pack(val1.model_id))
01096 _v15 = val1.pose
01097 _v16 = _v15.header
01098 buff.write(_struct_I.pack(_v16.seq))
01099 _v17 = _v16.stamp
01100 _x = _v17
01101 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
01102 _x = _v16.frame_id
01103 length = len(_x)
01104 buff.write(struct.pack('<I%ss'%length, length, _x))
01105 _v18 = _v15.pose
01106 _v19 = _v18.position
01107 _x = _v19
01108 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
01109 _v20 = _v18.orientation
01110 _x = _v20
01111 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
01112 buff.write(_struct_f.pack(val1.confidence))
01113 _x = self
01114 buff.write(_struct_3I.pack(_x.goal.target.cluster.header.seq, _x.goal.target.cluster.header.stamp.secs, _x.goal.target.cluster.header.stamp.nsecs))
01115 _x = self.goal.target.cluster.header.frame_id
01116 length = len(_x)
01117 buff.write(struct.pack('<I%ss'%length, length, _x))
01118 length = len(self.goal.target.cluster.points)
01119 buff.write(_struct_I.pack(length))
01120 for val1 in self.goal.target.cluster.points:
01121 _x = val1
01122 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
01123 length = len(self.goal.target.cluster.channels)
01124 buff.write(_struct_I.pack(length))
01125 for val1 in self.goal.target.cluster.channels:
01126 _x = val1.name
01127 length = len(_x)
01128 buff.write(struct.pack('<I%ss'%length, length, _x))
01129 length = len(val1.values)
01130 buff.write(_struct_I.pack(length))
01131 pattern = '<%sf'%length
01132 buff.write(val1.values.tostring())
01133 _x = self
01134 buff.write(_struct_3I.pack(_x.goal.target.region.cloud.header.seq, _x.goal.target.region.cloud.header.stamp.secs, _x.goal.target.region.cloud.header.stamp.nsecs))
01135 _x = self.goal.target.region.cloud.header.frame_id
01136 length = len(_x)
01137 buff.write(struct.pack('<I%ss'%length, length, _x))
01138 _x = self
01139 buff.write(_struct_2I.pack(_x.goal.target.region.cloud.height, _x.goal.target.region.cloud.width))
01140 length = len(self.goal.target.region.cloud.fields)
01141 buff.write(_struct_I.pack(length))
01142 for val1 in self.goal.target.region.cloud.fields:
01143 _x = val1.name
01144 length = len(_x)
01145 buff.write(struct.pack('<I%ss'%length, length, _x))
01146 _x = val1
01147 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
01148 _x = self
01149 buff.write(_struct_B2I.pack(_x.goal.target.region.cloud.is_bigendian, _x.goal.target.region.cloud.point_step, _x.goal.target.region.cloud.row_step))
01150 _x = self.goal.target.region.cloud.data
01151 length = len(_x)
01152 # - if encoded as a list instead, serialize as bytes instead of string
01153 if type(_x) in [list, tuple]:
01154 buff.write(struct.pack('<I%sB'%length, length, *_x))
01155 else:
01156 buff.write(struct.pack('<I%ss'%length, length, _x))
01157 buff.write(_struct_B.pack(self.goal.target.region.cloud.is_dense))
01158 length = len(self.goal.target.region.mask)
01159 buff.write(_struct_I.pack(length))
01160 pattern = '<%si'%length
01161 buff.write(self.goal.target.region.mask.tostring())
01162 _x = self
01163 buff.write(_struct_3I.pack(_x.goal.target.region.image.header.seq, _x.goal.target.region.image.header.stamp.secs, _x.goal.target.region.image.header.stamp.nsecs))
01164 _x = self.goal.target.region.image.header.frame_id
01165 length = len(_x)
01166 buff.write(struct.pack('<I%ss'%length, length, _x))
01167 _x = self
01168 buff.write(_struct_2I.pack(_x.goal.target.region.image.height, _x.goal.target.region.image.width))
01169 _x = self.goal.target.region.image.encoding
01170 length = len(_x)
01171 buff.write(struct.pack('<I%ss'%length, length, _x))
01172 _x = self
01173 buff.write(_struct_BI.pack(_x.goal.target.region.image.is_bigendian, _x.goal.target.region.image.step))
01174 _x = self.goal.target.region.image.data
01175 length = len(_x)
01176 # - if encoded as a list instead, serialize as bytes instead of string
01177 if type(_x) in [list, tuple]:
01178 buff.write(struct.pack('<I%sB'%length, length, *_x))
01179 else:
01180 buff.write(struct.pack('<I%ss'%length, length, _x))
01181 _x = self
01182 buff.write(_struct_3I.pack(_x.goal.target.region.disparity_image.header.seq, _x.goal.target.region.disparity_image.header.stamp.secs, _x.goal.target.region.disparity_image.header.stamp.nsecs))
01183 _x = self.goal.target.region.disparity_image.header.frame_id
01184 length = len(_x)
01185 buff.write(struct.pack('<I%ss'%length, length, _x))
01186 _x = self
01187 buff.write(_struct_2I.pack(_x.goal.target.region.disparity_image.height, _x.goal.target.region.disparity_image.width))
01188 _x = self.goal.target.region.disparity_image.encoding
01189 length = len(_x)
01190 buff.write(struct.pack('<I%ss'%length, length, _x))
01191 _x = self
01192 buff.write(_struct_BI.pack(_x.goal.target.region.disparity_image.is_bigendian, _x.goal.target.region.disparity_image.step))
01193 _x = self.goal.target.region.disparity_image.data
01194 length = len(_x)
01195 # - if encoded as a list instead, serialize as bytes instead of string
01196 if type(_x) in [list, tuple]:
01197 buff.write(struct.pack('<I%sB'%length, length, *_x))
01198 else:
01199 buff.write(struct.pack('<I%ss'%length, length, _x))
01200 _x = self
01201 buff.write(_struct_3I.pack(_x.goal.target.region.cam_info.header.seq, _x.goal.target.region.cam_info.header.stamp.secs, _x.goal.target.region.cam_info.header.stamp.nsecs))
01202 _x = self.goal.target.region.cam_info.header.frame_id
01203 length = len(_x)
01204 buff.write(struct.pack('<I%ss'%length, length, _x))
01205 _x = self
01206 buff.write(_struct_2I.pack(_x.goal.target.region.cam_info.height, _x.goal.target.region.cam_info.width))
01207 _x = self.goal.target.region.cam_info.distortion_model
01208 length = len(_x)
01209 buff.write(struct.pack('<I%ss'%length, length, _x))
01210 length = len(self.goal.target.region.cam_info.D)
01211 buff.write(_struct_I.pack(length))
01212 pattern = '<%sd'%length
01213 buff.write(self.goal.target.region.cam_info.D.tostring())
01214 buff.write(self.goal.target.region.cam_info.K.tostring())
01215 buff.write(self.goal.target.region.cam_info.R.tostring())
01216 buff.write(self.goal.target.region.cam_info.P.tostring())
01217 _x = self
01218 buff.write(_struct_6IB3I.pack(_x.goal.target.region.cam_info.binning_x, _x.goal.target.region.cam_info.binning_y, _x.goal.target.region.cam_info.roi.x_offset, _x.goal.target.region.cam_info.roi.y_offset, _x.goal.target.region.cam_info.roi.height, _x.goal.target.region.cam_info.roi.width, _x.goal.target.region.cam_info.roi.do_rectify, _x.goal.lift.direction.header.seq, _x.goal.lift.direction.header.stamp.secs, _x.goal.lift.direction.header.stamp.nsecs))
01219 _x = self.goal.lift.direction.header.frame_id
01220 length = len(_x)
01221 buff.write(struct.pack('<I%ss'%length, length, _x))
01222 _x = self
01223 buff.write(_struct_3d2f3I.pack(_x.goal.lift.direction.vector.x, _x.goal.lift.direction.vector.y, _x.goal.lift.direction.vector.z, _x.goal.lift.desired_distance, _x.goal.lift.min_distance, _x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs))
01224 _x = self.goal.trajectory.header.frame_id
01225 length = len(_x)
01226 buff.write(struct.pack('<I%ss'%length, length, _x))
01227 length = len(self.goal.trajectory.joint_names)
01228 buff.write(_struct_I.pack(length))
01229 for val1 in self.goal.trajectory.joint_names:
01230 length = len(val1)
01231 buff.write(struct.pack('<I%ss'%length, length, val1))
01232 length = len(self.goal.trajectory.points)
01233 buff.write(_struct_I.pack(length))
01234 for val1 in self.goal.trajectory.points:
01235 length = len(val1.positions)
01236 buff.write(_struct_I.pack(length))
01237 pattern = '<%sd'%length
01238 buff.write(val1.positions.tostring())
01239 length = len(val1.velocities)
01240 buff.write(_struct_I.pack(length))
01241 pattern = '<%sd'%length
01242 buff.write(val1.velocities.tostring())
01243 length = len(val1.accelerations)
01244 buff.write(_struct_I.pack(length))
01245 pattern = '<%sd'%length
01246 buff.write(val1.accelerations.tostring())
01247 _v21 = val1.time_from_start
01248 _x = _v21
01249 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
01250 _x = self.goal.collision_support_surface_name
01251 length = len(_x)
01252 buff.write(struct.pack('<I%ss'%length, length, _x))
01253 except struct.error, se: self._check_types(se)
01254 except TypeError, te: self._check_types(te)
01255
01256 def deserialize_numpy(self, str, numpy):
01257 """
01258 unpack serialized message in str into this message instance using numpy for array types
01259 @param str: byte array of serialized message
01260 @type str: str
01261 @param numpy: numpy python module
01262 @type numpy: module
01263 """
01264 try:
01265 if self.header is None:
01266 self.header = std_msgs.msg._Header.Header()
01267 if self.goal_id is None:
01268 self.goal_id = actionlib_msgs.msg.GoalID()
01269 if self.goal is None:
01270 self.goal = object_manipulation_msgs.msg.ReactiveLiftGoal()
01271 end = 0
01272 _x = self
01273 start = end
01274 end += 12
01275 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01276 start = end
01277 end += 4
01278 (length,) = _struct_I.unpack(str[start:end])
01279 start = end
01280 end += length
01281 self.header.frame_id = str[start:end]
01282 _x = self
01283 start = end
01284 end += 8
01285 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
01286 start = end
01287 end += 4
01288 (length,) = _struct_I.unpack(str[start:end])
01289 start = end
01290 end += length
01291 self.goal_id.id = str[start:end]
01292 start = end
01293 end += 4
01294 (length,) = _struct_I.unpack(str[start:end])
01295 start = end
01296 end += length
01297 self.goal.arm_name = str[start:end]
01298 start = end
01299 end += 4
01300 (length,) = _struct_I.unpack(str[start:end])
01301 start = end
01302 end += length
01303 self.goal.target.reference_frame_id = str[start:end]
01304 start = end
01305 end += 4
01306 (length,) = _struct_I.unpack(str[start:end])
01307 self.goal.target.potential_models = []
01308 for i in xrange(0, length):
01309 val1 = household_objects_database_msgs.msg.DatabaseModelPose()
01310 start = end
01311 end += 4
01312 (val1.model_id,) = _struct_i.unpack(str[start:end])
01313 _v22 = val1.pose
01314 _v23 = _v22.header
01315 start = end
01316 end += 4
01317 (_v23.seq,) = _struct_I.unpack(str[start:end])
01318 _v24 = _v23.stamp
01319 _x = _v24
01320 start = end
01321 end += 8
01322 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
01323 start = end
01324 end += 4
01325 (length,) = _struct_I.unpack(str[start:end])
01326 start = end
01327 end += length
01328 _v23.frame_id = str[start:end]
01329 _v25 = _v22.pose
01330 _v26 = _v25.position
01331 _x = _v26
01332 start = end
01333 end += 24
01334 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01335 _v27 = _v25.orientation
01336 _x = _v27
01337 start = end
01338 end += 32
01339 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01340 start = end
01341 end += 4
01342 (val1.confidence,) = _struct_f.unpack(str[start:end])
01343 self.goal.target.potential_models.append(val1)
01344 _x = self
01345 start = end
01346 end += 12
01347 (_x.goal.target.cluster.header.seq, _x.goal.target.cluster.header.stamp.secs, _x.goal.target.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01348 start = end
01349 end += 4
01350 (length,) = _struct_I.unpack(str[start:end])
01351 start = end
01352 end += length
01353 self.goal.target.cluster.header.frame_id = str[start:end]
01354 start = end
01355 end += 4
01356 (length,) = _struct_I.unpack(str[start:end])
01357 self.goal.target.cluster.points = []
01358 for i in xrange(0, length):
01359 val1 = geometry_msgs.msg.Point32()
01360 _x = val1
01361 start = end
01362 end += 12
01363 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
01364 self.goal.target.cluster.points.append(val1)
01365 start = end
01366 end += 4
01367 (length,) = _struct_I.unpack(str[start:end])
01368 self.goal.target.cluster.channels = []
01369 for i in xrange(0, length):
01370 val1 = sensor_msgs.msg.ChannelFloat32()
01371 start = end
01372 end += 4
01373 (length,) = _struct_I.unpack(str[start:end])
01374 start = end
01375 end += length
01376 val1.name = str[start:end]
01377 start = end
01378 end += 4
01379 (length,) = _struct_I.unpack(str[start:end])
01380 pattern = '<%sf'%length
01381 start = end
01382 end += struct.calcsize(pattern)
01383 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
01384 self.goal.target.cluster.channels.append(val1)
01385 _x = self
01386 start = end
01387 end += 12
01388 (_x.goal.target.region.cloud.header.seq, _x.goal.target.region.cloud.header.stamp.secs, _x.goal.target.region.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01389 start = end
01390 end += 4
01391 (length,) = _struct_I.unpack(str[start:end])
01392 start = end
01393 end += length
01394 self.goal.target.region.cloud.header.frame_id = str[start:end]
01395 _x = self
01396 start = end
01397 end += 8
01398 (_x.goal.target.region.cloud.height, _x.goal.target.region.cloud.width,) = _struct_2I.unpack(str[start:end])
01399 start = end
01400 end += 4
01401 (length,) = _struct_I.unpack(str[start:end])
01402 self.goal.target.region.cloud.fields = []
01403 for i in xrange(0, length):
01404 val1 = sensor_msgs.msg.PointField()
01405 start = end
01406 end += 4
01407 (length,) = _struct_I.unpack(str[start:end])
01408 start = end
01409 end += length
01410 val1.name = str[start:end]
01411 _x = val1
01412 start = end
01413 end += 9
01414 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
01415 self.goal.target.region.cloud.fields.append(val1)
01416 _x = self
01417 start = end
01418 end += 9
01419 (_x.goal.target.region.cloud.is_bigendian, _x.goal.target.region.cloud.point_step, _x.goal.target.region.cloud.row_step,) = _struct_B2I.unpack(str[start:end])
01420 self.goal.target.region.cloud.is_bigendian = bool(self.goal.target.region.cloud.is_bigendian)
01421 start = end
01422 end += 4
01423 (length,) = _struct_I.unpack(str[start:end])
01424 start = end
01425 end += length
01426 self.goal.target.region.cloud.data = str[start:end]
01427 start = end
01428 end += 1
01429 (self.goal.target.region.cloud.is_dense,) = _struct_B.unpack(str[start:end])
01430 self.goal.target.region.cloud.is_dense = bool(self.goal.target.region.cloud.is_dense)
01431 start = end
01432 end += 4
01433 (length,) = _struct_I.unpack(str[start:end])
01434 pattern = '<%si'%length
01435 start = end
01436 end += struct.calcsize(pattern)
01437 self.goal.target.region.mask = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
01438 _x = self
01439 start = end
01440 end += 12
01441 (_x.goal.target.region.image.header.seq, _x.goal.target.region.image.header.stamp.secs, _x.goal.target.region.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01442 start = end
01443 end += 4
01444 (length,) = _struct_I.unpack(str[start:end])
01445 start = end
01446 end += length
01447 self.goal.target.region.image.header.frame_id = str[start:end]
01448 _x = self
01449 start = end
01450 end += 8
01451 (_x.goal.target.region.image.height, _x.goal.target.region.image.width,) = _struct_2I.unpack(str[start:end])
01452 start = end
01453 end += 4
01454 (length,) = _struct_I.unpack(str[start:end])
01455 start = end
01456 end += length
01457 self.goal.target.region.image.encoding = str[start:end]
01458 _x = self
01459 start = end
01460 end += 5
01461 (_x.goal.target.region.image.is_bigendian, _x.goal.target.region.image.step,) = _struct_BI.unpack(str[start:end])
01462 start = end
01463 end += 4
01464 (length,) = _struct_I.unpack(str[start:end])
01465 start = end
01466 end += length
01467 self.goal.target.region.image.data = str[start:end]
01468 _x = self
01469 start = end
01470 end += 12
01471 (_x.goal.target.region.disparity_image.header.seq, _x.goal.target.region.disparity_image.header.stamp.secs, _x.goal.target.region.disparity_image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01472 start = end
01473 end += 4
01474 (length,) = _struct_I.unpack(str[start:end])
01475 start = end
01476 end += length
01477 self.goal.target.region.disparity_image.header.frame_id = str[start:end]
01478 _x = self
01479 start = end
01480 end += 8
01481 (_x.goal.target.region.disparity_image.height, _x.goal.target.region.disparity_image.width,) = _struct_2I.unpack(str[start:end])
01482 start = end
01483 end += 4
01484 (length,) = _struct_I.unpack(str[start:end])
01485 start = end
01486 end += length
01487 self.goal.target.region.disparity_image.encoding = str[start:end]
01488 _x = self
01489 start = end
01490 end += 5
01491 (_x.goal.target.region.disparity_image.is_bigendian, _x.goal.target.region.disparity_image.step,) = _struct_BI.unpack(str[start:end])
01492 start = end
01493 end += 4
01494 (length,) = _struct_I.unpack(str[start:end])
01495 start = end
01496 end += length
01497 self.goal.target.region.disparity_image.data = str[start:end]
01498 _x = self
01499 start = end
01500 end += 12
01501 (_x.goal.target.region.cam_info.header.seq, _x.goal.target.region.cam_info.header.stamp.secs, _x.goal.target.region.cam_info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01502 start = end
01503 end += 4
01504 (length,) = _struct_I.unpack(str[start:end])
01505 start = end
01506 end += length
01507 self.goal.target.region.cam_info.header.frame_id = str[start:end]
01508 _x = self
01509 start = end
01510 end += 8
01511 (_x.goal.target.region.cam_info.height, _x.goal.target.region.cam_info.width,) = _struct_2I.unpack(str[start:end])
01512 start = end
01513 end += 4
01514 (length,) = _struct_I.unpack(str[start:end])
01515 start = end
01516 end += length
01517 self.goal.target.region.cam_info.distortion_model = str[start:end]
01518 start = end
01519 end += 4
01520 (length,) = _struct_I.unpack(str[start:end])
01521 pattern = '<%sd'%length
01522 start = end
01523 end += struct.calcsize(pattern)
01524 self.goal.target.region.cam_info.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01525 start = end
01526 end += 72
01527 self.goal.target.region.cam_info.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
01528 start = end
01529 end += 72
01530 self.goal.target.region.cam_info.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
01531 start = end
01532 end += 96
01533 self.goal.target.region.cam_info.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12)
01534 _x = self
01535 start = end
01536 end += 37
01537 (_x.goal.target.region.cam_info.binning_x, _x.goal.target.region.cam_info.binning_y, _x.goal.target.region.cam_info.roi.x_offset, _x.goal.target.region.cam_info.roi.y_offset, _x.goal.target.region.cam_info.roi.height, _x.goal.target.region.cam_info.roi.width, _x.goal.target.region.cam_info.roi.do_rectify, _x.goal.lift.direction.header.seq, _x.goal.lift.direction.header.stamp.secs, _x.goal.lift.direction.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
01538 self.goal.target.region.cam_info.roi.do_rectify = bool(self.goal.target.region.cam_info.roi.do_rectify)
01539 start = end
01540 end += 4
01541 (length,) = _struct_I.unpack(str[start:end])
01542 start = end
01543 end += length
01544 self.goal.lift.direction.header.frame_id = str[start:end]
01545 _x = self
01546 start = end
01547 end += 44
01548 (_x.goal.lift.direction.vector.x, _x.goal.lift.direction.vector.y, _x.goal.lift.direction.vector.z, _x.goal.lift.desired_distance, _x.goal.lift.min_distance, _x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs,) = _struct_3d2f3I.unpack(str[start:end])
01549 start = end
01550 end += 4
01551 (length,) = _struct_I.unpack(str[start:end])
01552 start = end
01553 end += length
01554 self.goal.trajectory.header.frame_id = str[start:end]
01555 start = end
01556 end += 4
01557 (length,) = _struct_I.unpack(str[start:end])
01558 self.goal.trajectory.joint_names = []
01559 for i in xrange(0, length):
01560 start = end
01561 end += 4
01562 (length,) = _struct_I.unpack(str[start:end])
01563 start = end
01564 end += length
01565 val1 = str[start:end]
01566 self.goal.trajectory.joint_names.append(val1)
01567 start = end
01568 end += 4
01569 (length,) = _struct_I.unpack(str[start:end])
01570 self.goal.trajectory.points = []
01571 for i in xrange(0, length):
01572 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
01573 start = end
01574 end += 4
01575 (length,) = _struct_I.unpack(str[start:end])
01576 pattern = '<%sd'%length
01577 start = end
01578 end += struct.calcsize(pattern)
01579 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01580 start = end
01581 end += 4
01582 (length,) = _struct_I.unpack(str[start:end])
01583 pattern = '<%sd'%length
01584 start = end
01585 end += struct.calcsize(pattern)
01586 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01587 start = end
01588 end += 4
01589 (length,) = _struct_I.unpack(str[start:end])
01590 pattern = '<%sd'%length
01591 start = end
01592 end += struct.calcsize(pattern)
01593 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01594 _v28 = val1.time_from_start
01595 _x = _v28
01596 start = end
01597 end += 8
01598 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
01599 self.goal.trajectory.points.append(val1)
01600 start = end
01601 end += 4
01602 (length,) = _struct_I.unpack(str[start:end])
01603 start = end
01604 end += length
01605 self.goal.collision_support_surface_name = str[start:end]
01606 return self
01607 except struct.error, e:
01608 raise roslib.message.DeserializationError(e) #most likely buffer underfill
01609
01610 _struct_I = roslib.message.struct_I
01611 _struct_IBI = struct.Struct("<IBI")
01612 _struct_6IB3I = struct.Struct("<6IB3I")
01613 _struct_B = struct.Struct("<B")
01614 _struct_12d = struct.Struct("<12d")
01615 _struct_f = struct.Struct("<f")
01616 _struct_i = struct.Struct("<i")
01617 _struct_BI = struct.Struct("<BI")
01618 _struct_3f = struct.Struct("<3f")
01619 _struct_2i = struct.Struct("<2i")
01620 _struct_3I = struct.Struct("<3I")
01621 _struct_9d = struct.Struct("<9d")
01622 _struct_B2I = struct.Struct("<B2I")
01623 _struct_3d2f3I = struct.Struct("<3d2f3I")
01624 _struct_4d = struct.Struct("<4d")
01625 _struct_2I = struct.Struct("<2I")
01626 _struct_3d = struct.Struct("<3d")