00001 """autogenerated by genmsg_py from ArmHandGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006
00007 class ArmHandGoal(roslib.message.Message):
00008 _md5sum = "3a564cf8a4d7611dab9e91da15079bfc"
00009 _type = "cogman_msgs/ArmHandGoal"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012 string command # 'arm_cart_loid', 'arm_cart_pose', 'arm_cart_name', 'arm_joints', 'arm_joint_name', 'reach_primitive', 'hand_primitive', 'lift', 'put_down'
00013 string pose_name # When moving to pre-defined poses, cointains the name
00014 float32[] joint_angles # If command is 'arm_joints', the joint angles
00015 geometry_msgs/Pose end_effector_pose # command=arm_cart_pose: where the arm should go
00016 uint64 end_effector_loid # one lo_id where the arm should go
00017 string hand_primitive # Allowed strings: open open_thumb90 3pinch 2pinch cup_top peace handshake noop. Used when command is 'finger_primitive'
00018 string object_type # If command is 'reach_primitive', it will define how to grasp (orientation ...)
00019 uint64[] obstacle_ids # List of lo_id's corresponding to obstacles
00020 float32 distance # For reach_primitive: distance from grasp point to approach point (m). For 'lift', distance to lift up (m)
00021 float32 supporting_plane # Height of the table (m)
00022
00023 ================================================================================
00024 MSG: geometry_msgs/Pose
00025 # A representation of pose in free space, composed of postion and orientation.
00026 Point position
00027 Quaternion orientation
00028
00029 ================================================================================
00030 MSG: geometry_msgs/Point
00031 # This contains the position of a point in free space
00032 float64 x
00033 float64 y
00034 float64 z
00035
00036 ================================================================================
00037 MSG: geometry_msgs/Quaternion
00038 # This represents an orientation in free space in quaternion form.
00039
00040 float64 x
00041 float64 y
00042 float64 z
00043 float64 w
00044
00045 """
00046 __slots__ = ['command','pose_name','joint_angles','end_effector_pose','end_effector_loid','hand_primitive','object_type','obstacle_ids','distance','supporting_plane']
00047 _slot_types = ['string','string','float32[]','geometry_msgs/Pose','uint64','string','string','uint64[]','float32','float32']
00048
00049 def __init__(self, *args, **kwds):
00050 """
00051 Constructor. Any message fields that are implicitly/explicitly
00052 set to None will be assigned a default value. The recommend
00053 use is keyword arguments as this is more robust to future message
00054 changes. You cannot mix in-order arguments and keyword arguments.
00055
00056 The available fields are:
00057 command,pose_name,joint_angles,end_effector_pose,end_effector_loid,hand_primitive,object_type,obstacle_ids,distance,supporting_plane
00058
00059 @param args: complete set of field values, in .msg order
00060 @param kwds: use keyword arguments corresponding to message field names
00061 to set specific fields.
00062 """
00063 if args or kwds:
00064 super(ArmHandGoal, self).__init__(*args, **kwds)
00065
00066 if self.command is None:
00067 self.command = ''
00068 if self.pose_name is None:
00069 self.pose_name = ''
00070 if self.joint_angles is None:
00071 self.joint_angles = []
00072 if self.end_effector_pose is None:
00073 self.end_effector_pose = geometry_msgs.msg.Pose()
00074 if self.end_effector_loid is None:
00075 self.end_effector_loid = 0
00076 if self.hand_primitive is None:
00077 self.hand_primitive = ''
00078 if self.object_type is None:
00079 self.object_type = ''
00080 if self.obstacle_ids is None:
00081 self.obstacle_ids = []
00082 if self.distance is None:
00083 self.distance = 0.
00084 if self.supporting_plane is None:
00085 self.supporting_plane = 0.
00086 else:
00087 self.command = ''
00088 self.pose_name = ''
00089 self.joint_angles = []
00090 self.end_effector_pose = geometry_msgs.msg.Pose()
00091 self.end_effector_loid = 0
00092 self.hand_primitive = ''
00093 self.object_type = ''
00094 self.obstacle_ids = []
00095 self.distance = 0.
00096 self.supporting_plane = 0.
00097
00098 def _get_types(self):
00099 """
00100 internal API method
00101 """
00102 return self._slot_types
00103
00104 def serialize(self, buff):
00105 """
00106 serialize message into buffer
00107 @param buff: buffer
00108 @type buff: StringIO
00109 """
00110 try:
00111 _x = self.command
00112 length = len(_x)
00113 buff.write(struct.pack('<I%ss'%length, length, _x))
00114 _x = self.pose_name
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 length = len(self.joint_angles)
00118 buff.write(_struct_I.pack(length))
00119 pattern = '<%sf'%length
00120 buff.write(struct.pack(pattern, *self.joint_angles))
00121 _x = self
00122 buff.write(_struct_7dQ.pack(_x.end_effector_pose.position.x, _x.end_effector_pose.position.y, _x.end_effector_pose.position.z, _x.end_effector_pose.orientation.x, _x.end_effector_pose.orientation.y, _x.end_effector_pose.orientation.z, _x.end_effector_pose.orientation.w, _x.end_effector_loid))
00123 _x = self.hand_primitive
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 _x = self.object_type
00127 length = len(_x)
00128 buff.write(struct.pack('<I%ss'%length, length, _x))
00129 length = len(self.obstacle_ids)
00130 buff.write(_struct_I.pack(length))
00131 pattern = '<%sQ'%length
00132 buff.write(struct.pack(pattern, *self.obstacle_ids))
00133 _x = self
00134 buff.write(_struct_2f.pack(_x.distance, _x.supporting_plane))
00135 except struct.error, se: self._check_types(se)
00136 except TypeError, te: self._check_types(te)
00137
00138 def deserialize(self, str):
00139 """
00140 unpack serialized message in str into this message instance
00141 @param str: byte array of serialized message
00142 @type str: str
00143 """
00144 try:
00145 if self.end_effector_pose is None:
00146 self.end_effector_pose = geometry_msgs.msg.Pose()
00147 end = 0
00148 start = end
00149 end += 4
00150 (length,) = _struct_I.unpack(str[start:end])
00151 start = end
00152 end += length
00153 self.command = str[start:end]
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 start = end
00158 end += length
00159 self.pose_name = str[start:end]
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 pattern = '<%sf'%length
00164 start = end
00165 end += struct.calcsize(pattern)
00166 self.joint_angles = struct.unpack(pattern, str[start:end])
00167 _x = self
00168 start = end
00169 end += 64
00170 (_x.end_effector_pose.position.x, _x.end_effector_pose.position.y, _x.end_effector_pose.position.z, _x.end_effector_pose.orientation.x, _x.end_effector_pose.orientation.y, _x.end_effector_pose.orientation.z, _x.end_effector_pose.orientation.w, _x.end_effector_loid,) = _struct_7dQ.unpack(str[start:end])
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 self.hand_primitive = str[start:end]
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 self.object_type = str[start:end]
00183 start = end
00184 end += 4
00185 (length,) = _struct_I.unpack(str[start:end])
00186 pattern = '<%sQ'%length
00187 start = end
00188 end += struct.calcsize(pattern)
00189 self.obstacle_ids = struct.unpack(pattern, str[start:end])
00190 _x = self
00191 start = end
00192 end += 8
00193 (_x.distance, _x.supporting_plane,) = _struct_2f.unpack(str[start:end])
00194 return self
00195 except struct.error, e:
00196 raise roslib.message.DeserializationError(e)
00197
00198
00199 def serialize_numpy(self, buff, numpy):
00200 """
00201 serialize message with numpy array types into buffer
00202 @param buff: buffer
00203 @type buff: StringIO
00204 @param numpy: numpy python module
00205 @type numpy module
00206 """
00207 try:
00208 _x = self.command
00209 length = len(_x)
00210 buff.write(struct.pack('<I%ss'%length, length, _x))
00211 _x = self.pose_name
00212 length = len(_x)
00213 buff.write(struct.pack('<I%ss'%length, length, _x))
00214 length = len(self.joint_angles)
00215 buff.write(_struct_I.pack(length))
00216 pattern = '<%sf'%length
00217 buff.write(self.joint_angles.tostring())
00218 _x = self
00219 buff.write(_struct_7dQ.pack(_x.end_effector_pose.position.x, _x.end_effector_pose.position.y, _x.end_effector_pose.position.z, _x.end_effector_pose.orientation.x, _x.end_effector_pose.orientation.y, _x.end_effector_pose.orientation.z, _x.end_effector_pose.orientation.w, _x.end_effector_loid))
00220 _x = self.hand_primitive
00221 length = len(_x)
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 _x = self.object_type
00224 length = len(_x)
00225 buff.write(struct.pack('<I%ss'%length, length, _x))
00226 length = len(self.obstacle_ids)
00227 buff.write(_struct_I.pack(length))
00228 pattern = '<%sQ'%length
00229 buff.write(self.obstacle_ids.tostring())
00230 _x = self
00231 buff.write(_struct_2f.pack(_x.distance, _x.supporting_plane))
00232 except struct.error, se: self._check_types(se)
00233 except TypeError, te: self._check_types(te)
00234
00235 def deserialize_numpy(self, str, numpy):
00236 """
00237 unpack serialized message in str into this message instance using numpy for array types
00238 @param str: byte array of serialized message
00239 @type str: str
00240 @param numpy: numpy python module
00241 @type numpy: module
00242 """
00243 try:
00244 if self.end_effector_pose is None:
00245 self.end_effector_pose = geometry_msgs.msg.Pose()
00246 end = 0
00247 start = end
00248 end += 4
00249 (length,) = _struct_I.unpack(str[start:end])
00250 start = end
00251 end += length
00252 self.command = str[start:end]
00253 start = end
00254 end += 4
00255 (length,) = _struct_I.unpack(str[start:end])
00256 start = end
00257 end += length
00258 self.pose_name = str[start:end]
00259 start = end
00260 end += 4
00261 (length,) = _struct_I.unpack(str[start:end])
00262 pattern = '<%sf'%length
00263 start = end
00264 end += struct.calcsize(pattern)
00265 self.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00266 _x = self
00267 start = end
00268 end += 64
00269 (_x.end_effector_pose.position.x, _x.end_effector_pose.position.y, _x.end_effector_pose.position.z, _x.end_effector_pose.orientation.x, _x.end_effector_pose.orientation.y, _x.end_effector_pose.orientation.z, _x.end_effector_pose.orientation.w, _x.end_effector_loid,) = _struct_7dQ.unpack(str[start:end])
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 start = end
00274 end += length
00275 self.hand_primitive = str[start:end]
00276 start = end
00277 end += 4
00278 (length,) = _struct_I.unpack(str[start:end])
00279 start = end
00280 end += length
00281 self.object_type = str[start:end]
00282 start = end
00283 end += 4
00284 (length,) = _struct_I.unpack(str[start:end])
00285 pattern = '<%sQ'%length
00286 start = end
00287 end += struct.calcsize(pattern)
00288 self.obstacle_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length)
00289 _x = self
00290 start = end
00291 end += 8
00292 (_x.distance, _x.supporting_plane,) = _struct_2f.unpack(str[start:end])
00293 return self
00294 except struct.error, e:
00295 raise roslib.message.DeserializationError(e)
00296
00297 _struct_I = roslib.message.struct_I
00298 _struct_7dQ = struct.Struct("<7dQ")
00299 _struct_2f = struct.Struct("<2f")