$search
00001 """autogenerated by genmsg_py from SingleJointPositionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class SingleJointPositionGoal(roslib.message.Message): 00008 _md5sum = "fbaaa562a23a013fd5053e5f72cbb35c" 00009 _type = "pr2_controllers_msgs/SingleJointPositionGoal" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 float64 position 00013 duration min_duration 00014 float64 max_velocity 00015 00016 """ 00017 __slots__ = ['position','min_duration','max_velocity'] 00018 _slot_types = ['float64','duration','float64'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 position,min_duration,max_velocity 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(SingleJointPositionGoal, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.position is None: 00038 self.position = 0. 00039 if self.min_duration is None: 00040 self.min_duration = roslib.rostime.Duration() 00041 if self.max_velocity is None: 00042 self.max_velocity = 0. 00043 else: 00044 self.position = 0. 00045 self.min_duration = roslib.rostime.Duration() 00046 self.max_velocity = 0. 00047 00048 def _get_types(self): 00049 """ 00050 internal API method 00051 """ 00052 return self._slot_types 00053 00054 def serialize(self, buff): 00055 """ 00056 serialize message into buffer 00057 @param buff: buffer 00058 @type buff: StringIO 00059 """ 00060 try: 00061 _x = self 00062 buff.write(_struct_d2id.pack(_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity)) 00063 except struct.error as se: self._check_types(se) 00064 except TypeError as te: self._check_types(te) 00065 00066 def deserialize(self, str): 00067 """ 00068 unpack serialized message in str into this message instance 00069 @param str: byte array of serialized message 00070 @type str: str 00071 """ 00072 try: 00073 if self.min_duration is None: 00074 self.min_duration = roslib.rostime.Duration() 00075 end = 0 00076 _x = self 00077 start = end 00078 end += 24 00079 (_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity,) = _struct_d2id.unpack(str[start:end]) 00080 self.min_duration.canon() 00081 return self 00082 except struct.error as e: 00083 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00084 00085 00086 def serialize_numpy(self, buff, numpy): 00087 """ 00088 serialize message with numpy array types into buffer 00089 @param buff: buffer 00090 @type buff: StringIO 00091 @param numpy: numpy python module 00092 @type numpy module 00093 """ 00094 try: 00095 _x = self 00096 buff.write(_struct_d2id.pack(_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity)) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 00099 00100 def deserialize_numpy(self, str, numpy): 00101 """ 00102 unpack serialized message in str into this message instance using numpy for array types 00103 @param str: byte array of serialized message 00104 @type str: str 00105 @param numpy: numpy python module 00106 @type numpy: module 00107 """ 00108 try: 00109 if self.min_duration is None: 00110 self.min_duration = roslib.rostime.Duration() 00111 end = 0 00112 _x = self 00113 start = end 00114 end += 24 00115 (_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity,) = _struct_d2id.unpack(str[start:end]) 00116 self.min_duration.canon() 00117 return self 00118 except struct.error as e: 00119 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00120 00121 _struct_I = roslib.message.struct_I 00122 _struct_d2id = struct.Struct("<d2id")