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