$search
00001 """autogenerated by genmsg_py from SingleJointPositionFeedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class SingleJointPositionFeedback(roslib.message.Message): 00008 _md5sum = "8cee65610a3d08e0a1bded82f146f1fd" 00009 _type = "pr2_controllers_msgs/SingleJointPositionFeedback" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 Header header 00013 float64 position 00014 float64 velocity 00015 float64 error 00016 00017 00018 ================================================================================ 00019 MSG: std_msgs/Header 00020 # Standard metadata for higher-level stamped data types. 00021 # This is generally used to communicate timestamped data 00022 # in a particular coordinate frame. 00023 # 00024 # sequence ID: consecutively increasing ID 00025 uint32 seq 00026 #Two-integer timestamp that is expressed as: 00027 # * stamp.secs: seconds (stamp_secs) since epoch 00028 # * stamp.nsecs: nanoseconds since stamp_secs 00029 # time-handling sugar is provided by the client library 00030 time stamp 00031 #Frame this data is associated with 00032 # 0: no frame 00033 # 1: global frame 00034 string frame_id 00035 00036 """ 00037 __slots__ = ['header','position','velocity','error'] 00038 _slot_types = ['Header','float64','float64','float64'] 00039 00040 def __init__(self, *args, **kwds): 00041 """ 00042 Constructor. Any message fields that are implicitly/explicitly 00043 set to None will be assigned a default value. The recommend 00044 use is keyword arguments as this is more robust to future message 00045 changes. You cannot mix in-order arguments and keyword arguments. 00046 00047 The available fields are: 00048 header,position,velocity,error 00049 00050 @param args: complete set of field values, in .msg order 00051 @param kwds: use keyword arguments corresponding to message field names 00052 to set specific fields. 00053 """ 00054 if args or kwds: 00055 super(SingleJointPositionFeedback, self).__init__(*args, **kwds) 00056 #message fields cannot be None, assign default values for those that are 00057 if self.header is None: 00058 self.header = std_msgs.msg._Header.Header() 00059 if self.position is None: 00060 self.position = 0. 00061 if self.velocity is None: 00062 self.velocity = 0. 00063 if self.error is None: 00064 self.error = 0. 00065 else: 00066 self.header = std_msgs.msg._Header.Header() 00067 self.position = 0. 00068 self.velocity = 0. 00069 self.error = 0. 00070 00071 def _get_types(self): 00072 """ 00073 internal API method 00074 """ 00075 return self._slot_types 00076 00077 def serialize(self, buff): 00078 """ 00079 serialize message into buffer 00080 @param buff: buffer 00081 @type buff: StringIO 00082 """ 00083 try: 00084 _x = self 00085 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00086 _x = self.header.frame_id 00087 length = len(_x) 00088 buff.write(struct.pack('<I%ss'%length, length, _x)) 00089 _x = self 00090 buff.write(_struct_3d.pack(_x.position, _x.velocity, _x.error)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 if self.header is None: 00102 self.header = std_msgs.msg._Header.Header() 00103 end = 0 00104 _x = self 00105 start = end 00106 end += 12 00107 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 start = end 00112 end += length 00113 self.header.frame_id = str[start:end] 00114 _x = self 00115 start = end 00116 end += 24 00117 (_x.position, _x.velocity, _x.error,) = _struct_3d.unpack(str[start:end]) 00118 return self 00119 except struct.error as e: 00120 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00121 00122 00123 def serialize_numpy(self, buff, numpy): 00124 """ 00125 serialize message with numpy array types into buffer 00126 @param buff: buffer 00127 @type buff: StringIO 00128 @param numpy: numpy python module 00129 @type numpy module 00130 """ 00131 try: 00132 _x = self 00133 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00134 _x = self.header.frame_id 00135 length = len(_x) 00136 buff.write(struct.pack('<I%ss'%length, length, _x)) 00137 _x = self 00138 buff.write(_struct_3d.pack(_x.position, _x.velocity, _x.error)) 00139 except struct.error as se: self._check_types(se) 00140 except TypeError as te: self._check_types(te) 00141 00142 def deserialize_numpy(self, str, numpy): 00143 """ 00144 unpack serialized message in str into this message instance using numpy for array types 00145 @param str: byte array of serialized message 00146 @type str: str 00147 @param numpy: numpy python module 00148 @type numpy: module 00149 """ 00150 try: 00151 if self.header is None: 00152 self.header = std_msgs.msg._Header.Header() 00153 end = 0 00154 _x = self 00155 start = end 00156 end += 12 00157 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00158 start = end 00159 end += 4 00160 (length,) = _struct_I.unpack(str[start:end]) 00161 start = end 00162 end += length 00163 self.header.frame_id = str[start:end] 00164 _x = self 00165 start = end 00166 end += 24 00167 (_x.position, _x.velocity, _x.error,) = _struct_3d.unpack(str[start:end]) 00168 return self 00169 except struct.error as e: 00170 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00171 00172 _struct_I = roslib.message.struct_I 00173 _struct_3I = struct.Struct("<3I") 00174 _struct_3d = struct.Struct("<3d")