$search
00001 """autogenerated by genmsg_py from ArmHandActionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import cogman_msgs.msg 00006 import geometry_msgs.msg 00007 import roslib.rostime 00008 import actionlib_msgs.msg 00009 import std_msgs.msg 00010 00011 class ArmHandActionGoal(roslib.message.Message): 00012 _md5sum = "67892e60a5b18d39d45d5d9aff6688ae" 00013 _type = "cogman_msgs/ArmHandActionGoal" 00014 _has_header = True #flag to mark the presence of a Header object 00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00016 00017 Header header 00018 actionlib_msgs/GoalID goal_id 00019 ArmHandGoal goal 00020 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 ================================================================================ 00040 MSG: actionlib_msgs/GoalID 00041 # The stamp should store the time at which this goal was requested. 00042 # It is used by an action server when it tries to preempt all 00043 # goals that were requested before a certain time 00044 time stamp 00045 00046 # The id provides a way to associate feedback and 00047 # result message with specific goal requests. The id 00048 # specified must be unique. 00049 string id 00050 00051 00052 ================================================================================ 00053 MSG: cogman_msgs/ArmHandGoal 00054 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00055 string command # 'arm_cart_loid', 'arm_cart_pose', 'arm_cart_name', 'arm_joints', 'arm_joint_name', 'reach_primitive', 'hand_primitive', 'lift', 'put_down' 00056 string pose_name # When moving to pre-defined poses, cointains the name 00057 float32[] joint_angles # If command is 'arm_joints', the joint angles 00058 geometry_msgs/Pose end_effector_pose # command=arm_cart_pose: where the arm should go 00059 uint64 end_effector_loid # one lo_id where the arm should go 00060 string hand_primitive # Allowed strings: open open_thumb90 3pinch 2pinch cup_top peace handshake noop. Used when command is 'finger_primitive' 00061 string object_type # If command is 'reach_primitive', it will define how to grasp (orientation ...) 00062 uint64[] obstacle_ids # List of lo_id's corresponding to obstacles 00063 float32 distance # For reach_primitive: distance from grasp point to approach point (m). For 'lift', distance to lift up (m) 00064 float32 supporting_plane # Height of the table (m) 00065 00066 ================================================================================ 00067 MSG: geometry_msgs/Pose 00068 # A representation of pose in free space, composed of postion and orientation. 00069 Point position 00070 Quaternion orientation 00071 00072 ================================================================================ 00073 MSG: geometry_msgs/Point 00074 # This contains the position of a point in free space 00075 float64 x 00076 float64 y 00077 float64 z 00078 00079 ================================================================================ 00080 MSG: geometry_msgs/Quaternion 00081 # This represents an orientation in free space in quaternion form. 00082 00083 float64 x 00084 float64 y 00085 float64 z 00086 float64 w 00087 00088 """ 00089 __slots__ = ['header','goal_id','goal'] 00090 _slot_types = ['Header','actionlib_msgs/GoalID','cogman_msgs/ArmHandGoal'] 00091 00092 def __init__(self, *args, **kwds): 00093 """ 00094 Constructor. Any message fields that are implicitly/explicitly 00095 set to None will be assigned a default value. The recommend 00096 use is keyword arguments as this is more robust to future message 00097 changes. You cannot mix in-order arguments and keyword arguments. 00098 00099 The available fields are: 00100 header,goal_id,goal 00101 00102 @param args: complete set of field values, in .msg order 00103 @param kwds: use keyword arguments corresponding to message field names 00104 to set specific fields. 00105 """ 00106 if args or kwds: 00107 super(ArmHandActionGoal, self).__init__(*args, **kwds) 00108 #message fields cannot be None, assign default values for those that are 00109 if self.header is None: 00110 self.header = std_msgs.msg._Header.Header() 00111 if self.goal_id is None: 00112 self.goal_id = actionlib_msgs.msg.GoalID() 00113 if self.goal is None: 00114 self.goal = cogman_msgs.msg.ArmHandGoal() 00115 else: 00116 self.header = std_msgs.msg._Header.Header() 00117 self.goal_id = actionlib_msgs.msg.GoalID() 00118 self.goal = cogman_msgs.msg.ArmHandGoal() 00119 00120 def _get_types(self): 00121 """ 00122 internal API method 00123 """ 00124 return self._slot_types 00125 00126 def serialize(self, buff): 00127 """ 00128 serialize message into buffer 00129 @param buff: buffer 00130 @type buff: StringIO 00131 """ 00132 try: 00133 _x = self 00134 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00135 _x = self.header.frame_id 00136 length = len(_x) 00137 buff.write(struct.pack('<I%ss'%length, length, _x)) 00138 _x = self 00139 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00140 _x = self.goal_id.id 00141 length = len(_x) 00142 buff.write(struct.pack('<I%ss'%length, length, _x)) 00143 _x = self.goal.command 00144 length = len(_x) 00145 buff.write(struct.pack('<I%ss'%length, length, _x)) 00146 _x = self.goal.pose_name 00147 length = len(_x) 00148 buff.write(struct.pack('<I%ss'%length, length, _x)) 00149 length = len(self.goal.joint_angles) 00150 buff.write(_struct_I.pack(length)) 00151 pattern = '<%sf'%length 00152 buff.write(struct.pack(pattern, *self.goal.joint_angles)) 00153 _x = self 00154 buff.write(_struct_7dQ.pack(_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid)) 00155 _x = self.goal.hand_primitive 00156 length = len(_x) 00157 buff.write(struct.pack('<I%ss'%length, length, _x)) 00158 _x = self.goal.object_type 00159 length = len(_x) 00160 buff.write(struct.pack('<I%ss'%length, length, _x)) 00161 length = len(self.goal.obstacle_ids) 00162 buff.write(_struct_I.pack(length)) 00163 pattern = '<%sQ'%length 00164 buff.write(struct.pack(pattern, *self.goal.obstacle_ids)) 00165 _x = self 00166 buff.write(_struct_2f.pack(_x.goal.distance, _x.goal.supporting_plane)) 00167 except struct.error as se: self._check_types(se) 00168 except TypeError as te: self._check_types(te) 00169 00170 def deserialize(self, str): 00171 """ 00172 unpack serialized message in str into this message instance 00173 @param str: byte array of serialized message 00174 @type str: str 00175 """ 00176 try: 00177 if self.header is None: 00178 self.header = std_msgs.msg._Header.Header() 00179 if self.goal_id is None: 00180 self.goal_id = actionlib_msgs.msg.GoalID() 00181 if self.goal is None: 00182 self.goal = cogman_msgs.msg.ArmHandGoal() 00183 end = 0 00184 _x = self 00185 start = end 00186 end += 12 00187 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00188 start = end 00189 end += 4 00190 (length,) = _struct_I.unpack(str[start:end]) 00191 start = end 00192 end += length 00193 self.header.frame_id = str[start:end] 00194 _x = self 00195 start = end 00196 end += 8 00197 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00198 start = end 00199 end += 4 00200 (length,) = _struct_I.unpack(str[start:end]) 00201 start = end 00202 end += length 00203 self.goal_id.id = str[start:end] 00204 start = end 00205 end += 4 00206 (length,) = _struct_I.unpack(str[start:end]) 00207 start = end 00208 end += length 00209 self.goal.command = str[start:end] 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 start = end 00214 end += length 00215 self.goal.pose_name = str[start:end] 00216 start = end 00217 end += 4 00218 (length,) = _struct_I.unpack(str[start:end]) 00219 pattern = '<%sf'%length 00220 start = end 00221 end += struct.calcsize(pattern) 00222 self.goal.joint_angles = struct.unpack(pattern, str[start:end]) 00223 _x = self 00224 start = end 00225 end += 64 00226 (_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid,) = _struct_7dQ.unpack(str[start:end]) 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 start = end 00231 end += length 00232 self.goal.hand_primitive = str[start:end] 00233 start = end 00234 end += 4 00235 (length,) = _struct_I.unpack(str[start:end]) 00236 start = end 00237 end += length 00238 self.goal.object_type = str[start:end] 00239 start = end 00240 end += 4 00241 (length,) = _struct_I.unpack(str[start:end]) 00242 pattern = '<%sQ'%length 00243 start = end 00244 end += struct.calcsize(pattern) 00245 self.goal.obstacle_ids = struct.unpack(pattern, str[start:end]) 00246 _x = self 00247 start = end 00248 end += 8 00249 (_x.goal.distance, _x.goal.supporting_plane,) = _struct_2f.unpack(str[start:end]) 00250 return self 00251 except struct.error as e: 00252 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00253 00254 00255 def serialize_numpy(self, buff, numpy): 00256 """ 00257 serialize message with numpy array types into buffer 00258 @param buff: buffer 00259 @type buff: StringIO 00260 @param numpy: numpy python module 00261 @type numpy module 00262 """ 00263 try: 00264 _x = self 00265 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00266 _x = self.header.frame_id 00267 length = len(_x) 00268 buff.write(struct.pack('<I%ss'%length, length, _x)) 00269 _x = self 00270 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00271 _x = self.goal_id.id 00272 length = len(_x) 00273 buff.write(struct.pack('<I%ss'%length, length, _x)) 00274 _x = self.goal.command 00275 length = len(_x) 00276 buff.write(struct.pack('<I%ss'%length, length, _x)) 00277 _x = self.goal.pose_name 00278 length = len(_x) 00279 buff.write(struct.pack('<I%ss'%length, length, _x)) 00280 length = len(self.goal.joint_angles) 00281 buff.write(_struct_I.pack(length)) 00282 pattern = '<%sf'%length 00283 buff.write(self.goal.joint_angles.tostring()) 00284 _x = self 00285 buff.write(_struct_7dQ.pack(_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid)) 00286 _x = self.goal.hand_primitive 00287 length = len(_x) 00288 buff.write(struct.pack('<I%ss'%length, length, _x)) 00289 _x = self.goal.object_type 00290 length = len(_x) 00291 buff.write(struct.pack('<I%ss'%length, length, _x)) 00292 length = len(self.goal.obstacle_ids) 00293 buff.write(_struct_I.pack(length)) 00294 pattern = '<%sQ'%length 00295 buff.write(self.goal.obstacle_ids.tostring()) 00296 _x = self 00297 buff.write(_struct_2f.pack(_x.goal.distance, _x.goal.supporting_plane)) 00298 except struct.error as se: self._check_types(se) 00299 except TypeError as te: self._check_types(te) 00300 00301 def deserialize_numpy(self, str, numpy): 00302 """ 00303 unpack serialized message in str into this message instance using numpy for array types 00304 @param str: byte array of serialized message 00305 @type str: str 00306 @param numpy: numpy python module 00307 @type numpy: module 00308 """ 00309 try: 00310 if self.header is None: 00311 self.header = std_msgs.msg._Header.Header() 00312 if self.goal_id is None: 00313 self.goal_id = actionlib_msgs.msg.GoalID() 00314 if self.goal is None: 00315 self.goal = cogman_msgs.msg.ArmHandGoal() 00316 end = 0 00317 _x = self 00318 start = end 00319 end += 12 00320 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00321 start = end 00322 end += 4 00323 (length,) = _struct_I.unpack(str[start:end]) 00324 start = end 00325 end += length 00326 self.header.frame_id = str[start:end] 00327 _x = self 00328 start = end 00329 end += 8 00330 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00331 start = end 00332 end += 4 00333 (length,) = _struct_I.unpack(str[start:end]) 00334 start = end 00335 end += length 00336 self.goal_id.id = str[start:end] 00337 start = end 00338 end += 4 00339 (length,) = _struct_I.unpack(str[start:end]) 00340 start = end 00341 end += length 00342 self.goal.command = str[start:end] 00343 start = end 00344 end += 4 00345 (length,) = _struct_I.unpack(str[start:end]) 00346 start = end 00347 end += length 00348 self.goal.pose_name = str[start:end] 00349 start = end 00350 end += 4 00351 (length,) = _struct_I.unpack(str[start:end]) 00352 pattern = '<%sf'%length 00353 start = end 00354 end += struct.calcsize(pattern) 00355 self.goal.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00356 _x = self 00357 start = end 00358 end += 64 00359 (_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid,) = _struct_7dQ.unpack(str[start:end]) 00360 start = end 00361 end += 4 00362 (length,) = _struct_I.unpack(str[start:end]) 00363 start = end 00364 end += length 00365 self.goal.hand_primitive = str[start:end] 00366 start = end 00367 end += 4 00368 (length,) = _struct_I.unpack(str[start:end]) 00369 start = end 00370 end += length 00371 self.goal.object_type = str[start:end] 00372 start = end 00373 end += 4 00374 (length,) = _struct_I.unpack(str[start:end]) 00375 pattern = '<%sQ'%length 00376 start = end 00377 end += struct.calcsize(pattern) 00378 self.goal.obstacle_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length) 00379 _x = self 00380 start = end 00381 end += 8 00382 (_x.goal.distance, _x.goal.supporting_plane,) = _struct_2f.unpack(str[start:end]) 00383 return self 00384 except struct.error as e: 00385 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00386 00387 _struct_I = roslib.message.struct_I 00388 _struct_7dQ = struct.Struct("<7dQ") 00389 _struct_3I = struct.Struct("<3I") 00390 _struct_2I = struct.Struct("<2I") 00391 _struct_2f = struct.Struct("<2f")