00001 """autogenerated by genmsg_py from TestGraspRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007 import object_manipulation_msgs.msg
00008 import sensor_msgs.msg
00009
00010 class TestGraspRequest(roslib.message.Message):
00011 _md5sum = "41430f028afca8b3c3c0ed1bd3ffc59e"
00012 _type = "graspit_interface_msgs/TestGraspRequest"
00013 _has_header = False
00014 _full_text = """
00015
00016
00017
00018
00019 object_manipulation_msgs/Grasp grasp
00020
00021
00022
00023 int32 DIRECT = 0
00024
00025 int32 COMPLIANT_CLOSE = 1
00026
00027 int32 REACTIVE_GRASP = 2
00028
00029 int32 ROBUST_REACTIVE_GRASP = 3
00030 int32 test_type
00031
00032
00033 ================================================================================
00034 MSG: object_manipulation_msgs/Grasp
00035
00036 # The internal posture of the hand for the pre-grasp
00037 # only positions are used
00038 sensor_msgs/JointState pre_grasp_posture
00039
00040 # The internal posture of the hand for the grasp
00041 # positions and efforts are used
00042 sensor_msgs/JointState grasp_posture
00043
00044 # The position of the end-effector for the grasp relative to the object
00045 geometry_msgs/Pose grasp_pose
00046
00047 # The estimated probability of success for this grasp
00048 float64 success_probability
00049
00050 # Debug flag to indicate that this grasp would be the best in its cluster
00051 bool cluster_rep
00052 ================================================================================
00053 MSG: sensor_msgs/JointState
00054 # This is a message that holds data to describe the state of a set of torque controlled joints.
00055 #
00056 # The state of each joint (revolute or prismatic) is defined by:
00057 # * the position of the joint (rad or m),
00058 # * the velocity of the joint (rad/s or m/s) and
00059 # * the effort that is applied in the joint (Nm or N).
00060 #
00061 # Each joint is uniquely identified by its name
00062 # The header specifies the time at which the joint states were recorded. All the joint states
00063 # in one message have to be recorded at the same time.
00064 #
00065 # This message consists of a multiple arrays, one for each part of the joint state.
00066 # The goal is to make each of the fields optional. When e.g. your joints have no
00067 # effort associated with them, you can leave the effort array empty.
00068 #
00069 # All arrays in this message should have the same size, or be empty.
00070 # This is the only way to uniquely associate the joint name with the correct
00071 # states.
00072
00073
00074 Header header
00075
00076 string[] name
00077 float64[] position
00078 float64[] velocity
00079 float64[] effort
00080
00081 ================================================================================
00082 MSG: std_msgs/Header
00083 # Standard metadata for higher-level stamped data types.
00084 # This is generally used to communicate timestamped data
00085 # in a particular coordinate frame.
00086 #
00087 # sequence ID: consecutively increasing ID
00088 uint32 seq
00089 #Two-integer timestamp that is expressed as:
00090 # * stamp.secs: seconds (stamp_secs) since epoch
00091 # * stamp.nsecs: nanoseconds since stamp_secs
00092 # time-handling sugar is provided by the client library
00093 time stamp
00094 #Frame this data is associated with
00095 # 0: no frame
00096 # 1: global frame
00097 string frame_id
00098
00099 ================================================================================
00100 MSG: geometry_msgs/Pose
00101 # A representation of pose in free space, composed of postion and orientation.
00102 Point position
00103 Quaternion orientation
00104
00105 ================================================================================
00106 MSG: geometry_msgs/Point
00107 # This contains the position of a point in free space
00108 float64 x
00109 float64 y
00110 float64 z
00111
00112 ================================================================================
00113 MSG: geometry_msgs/Quaternion
00114 # This represents an orientation in free space in quaternion form.
00115
00116 float64 x
00117 float64 y
00118 float64 z
00119 float64 w
00120
00121 """
00122
00123 DIRECT = 0
00124 COMPLIANT_CLOSE = 1
00125 REACTIVE_GRASP = 2
00126 ROBUST_REACTIVE_GRASP = 3
00127
00128 __slots__ = ['grasp','test_type']
00129 _slot_types = ['object_manipulation_msgs/Grasp','int32']
00130
00131 def __init__(self, *args, **kwds):
00132 """
00133 Constructor. Any message fields that are implicitly/explicitly
00134 set to None will be assigned a default value. The recommend
00135 use is keyword arguments as this is more robust to future message
00136 changes. You cannot mix in-order arguments and keyword arguments.
00137
00138 The available fields are:
00139 grasp,test_type
00140
00141 @param args: complete set of field values, in .msg order
00142 @param kwds: use keyword arguments corresponding to message field names
00143 to set specific fields.
00144 """
00145 if args or kwds:
00146 super(TestGraspRequest, self).__init__(*args, **kwds)
00147
00148 if self.grasp is None:
00149 self.grasp = object_manipulation_msgs.msg.Grasp()
00150 if self.test_type is None:
00151 self.test_type = 0
00152 else:
00153 self.grasp = object_manipulation_msgs.msg.Grasp()
00154 self.test_type = 0
00155
00156 def _get_types(self):
00157 """
00158 internal API method
00159 """
00160 return self._slot_types
00161
00162 def serialize(self, buff):
00163 """
00164 serialize message into buffer
00165 @param buff: buffer
00166 @type buff: StringIO
00167 """
00168 try:
00169 _x = self
00170 buff.write(_struct_3I.pack(_x.grasp.pre_grasp_posture.header.seq, _x.grasp.pre_grasp_posture.header.stamp.secs, _x.grasp.pre_grasp_posture.header.stamp.nsecs))
00171 _x = self.grasp.pre_grasp_posture.header.frame_id
00172 length = len(_x)
00173 buff.write(struct.pack('<I%ss'%length, length, _x))
00174 length = len(self.grasp.pre_grasp_posture.name)
00175 buff.write(_struct_I.pack(length))
00176 for val1 in self.grasp.pre_grasp_posture.name:
00177 length = len(val1)
00178 buff.write(struct.pack('<I%ss'%length, length, val1))
00179 length = len(self.grasp.pre_grasp_posture.position)
00180 buff.write(_struct_I.pack(length))
00181 pattern = '<%sd'%length
00182 buff.write(struct.pack(pattern, *self.grasp.pre_grasp_posture.position))
00183 length = len(self.grasp.pre_grasp_posture.velocity)
00184 buff.write(_struct_I.pack(length))
00185 pattern = '<%sd'%length
00186 buff.write(struct.pack(pattern, *self.grasp.pre_grasp_posture.velocity))
00187 length = len(self.grasp.pre_grasp_posture.effort)
00188 buff.write(_struct_I.pack(length))
00189 pattern = '<%sd'%length
00190 buff.write(struct.pack(pattern, *self.grasp.pre_grasp_posture.effort))
00191 _x = self
00192 buff.write(_struct_3I.pack(_x.grasp.grasp_posture.header.seq, _x.grasp.grasp_posture.header.stamp.secs, _x.grasp.grasp_posture.header.stamp.nsecs))
00193 _x = self.grasp.grasp_posture.header.frame_id
00194 length = len(_x)
00195 buff.write(struct.pack('<I%ss'%length, length, _x))
00196 length = len(self.grasp.grasp_posture.name)
00197 buff.write(_struct_I.pack(length))
00198 for val1 in self.grasp.grasp_posture.name:
00199 length = len(val1)
00200 buff.write(struct.pack('<I%ss'%length, length, val1))
00201 length = len(self.grasp.grasp_posture.position)
00202 buff.write(_struct_I.pack(length))
00203 pattern = '<%sd'%length
00204 buff.write(struct.pack(pattern, *self.grasp.grasp_posture.position))
00205 length = len(self.grasp.grasp_posture.velocity)
00206 buff.write(_struct_I.pack(length))
00207 pattern = '<%sd'%length
00208 buff.write(struct.pack(pattern, *self.grasp.grasp_posture.velocity))
00209 length = len(self.grasp.grasp_posture.effort)
00210 buff.write(_struct_I.pack(length))
00211 pattern = '<%sd'%length
00212 buff.write(struct.pack(pattern, *self.grasp.grasp_posture.effort))
00213 _x = self
00214 buff.write(_struct_8dBi.pack(_x.grasp.grasp_pose.position.x, _x.grasp.grasp_pose.position.y, _x.grasp.grasp_pose.position.z, _x.grasp.grasp_pose.orientation.x, _x.grasp.grasp_pose.orientation.y, _x.grasp.grasp_pose.orientation.z, _x.grasp.grasp_pose.orientation.w, _x.grasp.success_probability, _x.grasp.cluster_rep, _x.test_type))
00215 except struct.error, se: self._check_types(se)
00216 except TypeError, te: self._check_types(te)
00217
00218 def deserialize(self, str):
00219 """
00220 unpack serialized message in str into this message instance
00221 @param str: byte array of serialized message
00222 @type str: str
00223 """
00224 try:
00225 if self.grasp is None:
00226 self.grasp = object_manipulation_msgs.msg.Grasp()
00227 end = 0
00228 _x = self
00229 start = end
00230 end += 12
00231 (_x.grasp.pre_grasp_posture.header.seq, _x.grasp.pre_grasp_posture.header.stamp.secs, _x.grasp.pre_grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00232 start = end
00233 end += 4
00234 (length,) = _struct_I.unpack(str[start:end])
00235 start = end
00236 end += length
00237 self.grasp.pre_grasp_posture.header.frame_id = str[start:end]
00238 start = end
00239 end += 4
00240 (length,) = _struct_I.unpack(str[start:end])
00241 self.grasp.pre_grasp_posture.name = []
00242 for i in xrange(0, length):
00243 start = end
00244 end += 4
00245 (length,) = _struct_I.unpack(str[start:end])
00246 start = end
00247 end += length
00248 val1 = str[start:end]
00249 self.grasp.pre_grasp_posture.name.append(val1)
00250 start = end
00251 end += 4
00252 (length,) = _struct_I.unpack(str[start:end])
00253 pattern = '<%sd'%length
00254 start = end
00255 end += struct.calcsize(pattern)
00256 self.grasp.pre_grasp_posture.position = struct.unpack(pattern, str[start:end])
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 pattern = '<%sd'%length
00261 start = end
00262 end += struct.calcsize(pattern)
00263 self.grasp.pre_grasp_posture.velocity = struct.unpack(pattern, str[start:end])
00264 start = end
00265 end += 4
00266 (length,) = _struct_I.unpack(str[start:end])
00267 pattern = '<%sd'%length
00268 start = end
00269 end += struct.calcsize(pattern)
00270 self.grasp.pre_grasp_posture.effort = struct.unpack(pattern, str[start:end])
00271 _x = self
00272 start = end
00273 end += 12
00274 (_x.grasp.grasp_posture.header.seq, _x.grasp.grasp_posture.header.stamp.secs, _x.grasp.grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00275 start = end
00276 end += 4
00277 (length,) = _struct_I.unpack(str[start:end])
00278 start = end
00279 end += length
00280 self.grasp.grasp_posture.header.frame_id = str[start:end]
00281 start = end
00282 end += 4
00283 (length,) = _struct_I.unpack(str[start:end])
00284 self.grasp.grasp_posture.name = []
00285 for i in xrange(0, length):
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 start = end
00290 end += length
00291 val1 = str[start:end]
00292 self.grasp.grasp_posture.name.append(val1)
00293 start = end
00294 end += 4
00295 (length,) = _struct_I.unpack(str[start:end])
00296 pattern = '<%sd'%length
00297 start = end
00298 end += struct.calcsize(pattern)
00299 self.grasp.grasp_posture.position = struct.unpack(pattern, str[start:end])
00300 start = end
00301 end += 4
00302 (length,) = _struct_I.unpack(str[start:end])
00303 pattern = '<%sd'%length
00304 start = end
00305 end += struct.calcsize(pattern)
00306 self.grasp.grasp_posture.velocity = struct.unpack(pattern, str[start:end])
00307 start = end
00308 end += 4
00309 (length,) = _struct_I.unpack(str[start:end])
00310 pattern = '<%sd'%length
00311 start = end
00312 end += struct.calcsize(pattern)
00313 self.grasp.grasp_posture.effort = struct.unpack(pattern, str[start:end])
00314 _x = self
00315 start = end
00316 end += 69
00317 (_x.grasp.grasp_pose.position.x, _x.grasp.grasp_pose.position.y, _x.grasp.grasp_pose.position.z, _x.grasp.grasp_pose.orientation.x, _x.grasp.grasp_pose.orientation.y, _x.grasp.grasp_pose.orientation.z, _x.grasp.grasp_pose.orientation.w, _x.grasp.success_probability, _x.grasp.cluster_rep, _x.test_type,) = _struct_8dBi.unpack(str[start:end])
00318 self.grasp.cluster_rep = bool(self.grasp.cluster_rep)
00319 return self
00320 except struct.error, e:
00321 raise roslib.message.DeserializationError(e)
00322
00323
00324 def serialize_numpy(self, buff, numpy):
00325 """
00326 serialize message with numpy array types into buffer
00327 @param buff: buffer
00328 @type buff: StringIO
00329 @param numpy: numpy python module
00330 @type numpy module
00331 """
00332 try:
00333 _x = self
00334 buff.write(_struct_3I.pack(_x.grasp.pre_grasp_posture.header.seq, _x.grasp.pre_grasp_posture.header.stamp.secs, _x.grasp.pre_grasp_posture.header.stamp.nsecs))
00335 _x = self.grasp.pre_grasp_posture.header.frame_id
00336 length = len(_x)
00337 buff.write(struct.pack('<I%ss'%length, length, _x))
00338 length = len(self.grasp.pre_grasp_posture.name)
00339 buff.write(_struct_I.pack(length))
00340 for val1 in self.grasp.pre_grasp_posture.name:
00341 length = len(val1)
00342 buff.write(struct.pack('<I%ss'%length, length, val1))
00343 length = len(self.grasp.pre_grasp_posture.position)
00344 buff.write(_struct_I.pack(length))
00345 pattern = '<%sd'%length
00346 buff.write(self.grasp.pre_grasp_posture.position.tostring())
00347 length = len(self.grasp.pre_grasp_posture.velocity)
00348 buff.write(_struct_I.pack(length))
00349 pattern = '<%sd'%length
00350 buff.write(self.grasp.pre_grasp_posture.velocity.tostring())
00351 length = len(self.grasp.pre_grasp_posture.effort)
00352 buff.write(_struct_I.pack(length))
00353 pattern = '<%sd'%length
00354 buff.write(self.grasp.pre_grasp_posture.effort.tostring())
00355 _x = self
00356 buff.write(_struct_3I.pack(_x.grasp.grasp_posture.header.seq, _x.grasp.grasp_posture.header.stamp.secs, _x.grasp.grasp_posture.header.stamp.nsecs))
00357 _x = self.grasp.grasp_posture.header.frame_id
00358 length = len(_x)
00359 buff.write(struct.pack('<I%ss'%length, length, _x))
00360 length = len(self.grasp.grasp_posture.name)
00361 buff.write(_struct_I.pack(length))
00362 for val1 in self.grasp.grasp_posture.name:
00363 length = len(val1)
00364 buff.write(struct.pack('<I%ss'%length, length, val1))
00365 length = len(self.grasp.grasp_posture.position)
00366 buff.write(_struct_I.pack(length))
00367 pattern = '<%sd'%length
00368 buff.write(self.grasp.grasp_posture.position.tostring())
00369 length = len(self.grasp.grasp_posture.velocity)
00370 buff.write(_struct_I.pack(length))
00371 pattern = '<%sd'%length
00372 buff.write(self.grasp.grasp_posture.velocity.tostring())
00373 length = len(self.grasp.grasp_posture.effort)
00374 buff.write(_struct_I.pack(length))
00375 pattern = '<%sd'%length
00376 buff.write(self.grasp.grasp_posture.effort.tostring())
00377 _x = self
00378 buff.write(_struct_8dBi.pack(_x.grasp.grasp_pose.position.x, _x.grasp.grasp_pose.position.y, _x.grasp.grasp_pose.position.z, _x.grasp.grasp_pose.orientation.x, _x.grasp.grasp_pose.orientation.y, _x.grasp.grasp_pose.orientation.z, _x.grasp.grasp_pose.orientation.w, _x.grasp.success_probability, _x.grasp.cluster_rep, _x.test_type))
00379 except struct.error, se: self._check_types(se)
00380 except TypeError, te: self._check_types(te)
00381
00382 def deserialize_numpy(self, str, numpy):
00383 """
00384 unpack serialized message in str into this message instance using numpy for array types
00385 @param str: byte array of serialized message
00386 @type str: str
00387 @param numpy: numpy python module
00388 @type numpy: module
00389 """
00390 try:
00391 if self.grasp is None:
00392 self.grasp = object_manipulation_msgs.msg.Grasp()
00393 end = 0
00394 _x = self
00395 start = end
00396 end += 12
00397 (_x.grasp.pre_grasp_posture.header.seq, _x.grasp.pre_grasp_posture.header.stamp.secs, _x.grasp.pre_grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00398 start = end
00399 end += 4
00400 (length,) = _struct_I.unpack(str[start:end])
00401 start = end
00402 end += length
00403 self.grasp.pre_grasp_posture.header.frame_id = str[start:end]
00404 start = end
00405 end += 4
00406 (length,) = _struct_I.unpack(str[start:end])
00407 self.grasp.pre_grasp_posture.name = []
00408 for i in xrange(0, length):
00409 start = end
00410 end += 4
00411 (length,) = _struct_I.unpack(str[start:end])
00412 start = end
00413 end += length
00414 val1 = str[start:end]
00415 self.grasp.pre_grasp_posture.name.append(val1)
00416 start = end
00417 end += 4
00418 (length,) = _struct_I.unpack(str[start:end])
00419 pattern = '<%sd'%length
00420 start = end
00421 end += struct.calcsize(pattern)
00422 self.grasp.pre_grasp_posture.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00423 start = end
00424 end += 4
00425 (length,) = _struct_I.unpack(str[start:end])
00426 pattern = '<%sd'%length
00427 start = end
00428 end += struct.calcsize(pattern)
00429 self.grasp.pre_grasp_posture.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00430 start = end
00431 end += 4
00432 (length,) = _struct_I.unpack(str[start:end])
00433 pattern = '<%sd'%length
00434 start = end
00435 end += struct.calcsize(pattern)
00436 self.grasp.pre_grasp_posture.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00437 _x = self
00438 start = end
00439 end += 12
00440 (_x.grasp.grasp_posture.header.seq, _x.grasp.grasp_posture.header.stamp.secs, _x.grasp.grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00441 start = end
00442 end += 4
00443 (length,) = _struct_I.unpack(str[start:end])
00444 start = end
00445 end += length
00446 self.grasp.grasp_posture.header.frame_id = str[start:end]
00447 start = end
00448 end += 4
00449 (length,) = _struct_I.unpack(str[start:end])
00450 self.grasp.grasp_posture.name = []
00451 for i in xrange(0, length):
00452 start = end
00453 end += 4
00454 (length,) = _struct_I.unpack(str[start:end])
00455 start = end
00456 end += length
00457 val1 = str[start:end]
00458 self.grasp.grasp_posture.name.append(val1)
00459 start = end
00460 end += 4
00461 (length,) = _struct_I.unpack(str[start:end])
00462 pattern = '<%sd'%length
00463 start = end
00464 end += struct.calcsize(pattern)
00465 self.grasp.grasp_posture.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00466 start = end
00467 end += 4
00468 (length,) = _struct_I.unpack(str[start:end])
00469 pattern = '<%sd'%length
00470 start = end
00471 end += struct.calcsize(pattern)
00472 self.grasp.grasp_posture.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00473 start = end
00474 end += 4
00475 (length,) = _struct_I.unpack(str[start:end])
00476 pattern = '<%sd'%length
00477 start = end
00478 end += struct.calcsize(pattern)
00479 self.grasp.grasp_posture.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00480 _x = self
00481 start = end
00482 end += 69
00483 (_x.grasp.grasp_pose.position.x, _x.grasp.grasp_pose.position.y, _x.grasp.grasp_pose.position.z, _x.grasp.grasp_pose.orientation.x, _x.grasp.grasp_pose.orientation.y, _x.grasp.grasp_pose.orientation.z, _x.grasp.grasp_pose.orientation.w, _x.grasp.success_probability, _x.grasp.cluster_rep, _x.test_type,) = _struct_8dBi.unpack(str[start:end])
00484 self.grasp.cluster_rep = bool(self.grasp.cluster_rep)
00485 return self
00486 except struct.error, e:
00487 raise roslib.message.DeserializationError(e)
00488
00489 _struct_I = roslib.message.struct_I
00490 _struct_3I = struct.Struct("<3I")
00491 _struct_8dBi = struct.Struct("<8dBi")
00492 """autogenerated by genmsg_py from TestGraspResponse.msg. Do not edit."""
00493 import roslib.message
00494 import struct
00495
00496
00497 class TestGraspResponse(roslib.message.Message):
00498 _md5sum = "745239a222da348b3e36561caeefd73b"
00499 _type = "graspit_interface_msgs/TestGraspResponse"
00500 _has_header = False
00501 _full_text = """
00502
00503 int32 TEST_WAS_PERFORMED = 0
00504 int32 TEST_WAS_NOT_PERFORMED = 1
00505 int32 test_performed
00506
00507
00508 int32 HAND_COLLISION = 0
00509 int32 GRASP_FAILURE = 1
00510 int32 GRASP_SUCCESS = 2
00511 int32 test_result
00512
00513
00514 bool hand_object_collision
00515 bool hand_environment_collision
00516
00517
00518
00519 float32 energy_value
00520
00521 float32[] energy_value_list
00522
00523 """
00524
00525 TEST_WAS_PERFORMED = 0
00526 TEST_WAS_NOT_PERFORMED = 1
00527 HAND_COLLISION = 0
00528 GRASP_FAILURE = 1
00529 GRASP_SUCCESS = 2
00530
00531 __slots__ = ['test_performed','test_result','hand_object_collision','hand_environment_collision','energy_value','energy_value_list']
00532 _slot_types = ['int32','int32','bool','bool','float32','float32[]']
00533
00534 def __init__(self, *args, **kwds):
00535 """
00536 Constructor. Any message fields that are implicitly/explicitly
00537 set to None will be assigned a default value. The recommend
00538 use is keyword arguments as this is more robust to future message
00539 changes. You cannot mix in-order arguments and keyword arguments.
00540
00541 The available fields are:
00542 test_performed,test_result,hand_object_collision,hand_environment_collision,energy_value,energy_value_list
00543
00544 @param args: complete set of field values, in .msg order
00545 @param kwds: use keyword arguments corresponding to message field names
00546 to set specific fields.
00547 """
00548 if args or kwds:
00549 super(TestGraspResponse, self).__init__(*args, **kwds)
00550
00551 if self.test_performed is None:
00552 self.test_performed = 0
00553 if self.test_result is None:
00554 self.test_result = 0
00555 if self.hand_object_collision is None:
00556 self.hand_object_collision = False
00557 if self.hand_environment_collision is None:
00558 self.hand_environment_collision = False
00559 if self.energy_value is None:
00560 self.energy_value = 0.
00561 if self.energy_value_list is None:
00562 self.energy_value_list = []
00563 else:
00564 self.test_performed = 0
00565 self.test_result = 0
00566 self.hand_object_collision = False
00567 self.hand_environment_collision = False
00568 self.energy_value = 0.
00569 self.energy_value_list = []
00570
00571 def _get_types(self):
00572 """
00573 internal API method
00574 """
00575 return self._slot_types
00576
00577 def serialize(self, buff):
00578 """
00579 serialize message into buffer
00580 @param buff: buffer
00581 @type buff: StringIO
00582 """
00583 try:
00584 _x = self
00585 buff.write(_struct_2i2Bf.pack(_x.test_performed, _x.test_result, _x.hand_object_collision, _x.hand_environment_collision, _x.energy_value))
00586 length = len(self.energy_value_list)
00587 buff.write(_struct_I.pack(length))
00588 pattern = '<%sf'%length
00589 buff.write(struct.pack(pattern, *self.energy_value_list))
00590 except struct.error, se: self._check_types(se)
00591 except TypeError, te: self._check_types(te)
00592
00593 def deserialize(self, str):
00594 """
00595 unpack serialized message in str into this message instance
00596 @param str: byte array of serialized message
00597 @type str: str
00598 """
00599 try:
00600 end = 0
00601 _x = self
00602 start = end
00603 end += 14
00604 (_x.test_performed, _x.test_result, _x.hand_object_collision, _x.hand_environment_collision, _x.energy_value,) = _struct_2i2Bf.unpack(str[start:end])
00605 self.hand_object_collision = bool(self.hand_object_collision)
00606 self.hand_environment_collision = bool(self.hand_environment_collision)
00607 start = end
00608 end += 4
00609 (length,) = _struct_I.unpack(str[start:end])
00610 pattern = '<%sf'%length
00611 start = end
00612 end += struct.calcsize(pattern)
00613 self.energy_value_list = struct.unpack(pattern, str[start:end])
00614 return self
00615 except struct.error, e:
00616 raise roslib.message.DeserializationError(e)
00617
00618
00619 def serialize_numpy(self, buff, numpy):
00620 """
00621 serialize message with numpy array types into buffer
00622 @param buff: buffer
00623 @type buff: StringIO
00624 @param numpy: numpy python module
00625 @type numpy module
00626 """
00627 try:
00628 _x = self
00629 buff.write(_struct_2i2Bf.pack(_x.test_performed, _x.test_result, _x.hand_object_collision, _x.hand_environment_collision, _x.energy_value))
00630 length = len(self.energy_value_list)
00631 buff.write(_struct_I.pack(length))
00632 pattern = '<%sf'%length
00633 buff.write(self.energy_value_list.tostring())
00634 except struct.error, se: self._check_types(se)
00635 except TypeError, te: self._check_types(te)
00636
00637 def deserialize_numpy(self, str, numpy):
00638 """
00639 unpack serialized message in str into this message instance using numpy for array types
00640 @param str: byte array of serialized message
00641 @type str: str
00642 @param numpy: numpy python module
00643 @type numpy: module
00644 """
00645 try:
00646 end = 0
00647 _x = self
00648 start = end
00649 end += 14
00650 (_x.test_performed, _x.test_result, _x.hand_object_collision, _x.hand_environment_collision, _x.energy_value,) = _struct_2i2Bf.unpack(str[start:end])
00651 self.hand_object_collision = bool(self.hand_object_collision)
00652 self.hand_environment_collision = bool(self.hand_environment_collision)
00653 start = end
00654 end += 4
00655 (length,) = _struct_I.unpack(str[start:end])
00656 pattern = '<%sf'%length
00657 start = end
00658 end += struct.calcsize(pattern)
00659 self.energy_value_list = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00660 return self
00661 except struct.error, e:
00662 raise roslib.message.DeserializationError(e)
00663
00664 _struct_I = roslib.message.struct_I
00665 _struct_2i2Bf = struct.Struct("<2i2Bf")
00666 class TestGrasp(roslib.message.ServiceDefinition):
00667 _type = 'graspit_interface_msgs/TestGrasp'
00668 _md5sum = '4dd507f7b77b3d427b256967f910ced4'
00669 _request_class = TestGraspRequest
00670 _response_class = TestGraspResponse