$search
00001 """autogenerated by genmsg_py from ControlType.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ControlType(roslib.message.Message): 00007 _md5sum = "a91c98360f1bce9810ba146996feea80" 00008 _type = "sr_robot_msgs/ControlType" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int16 control_type 00011 00012 int16 PWM=0 00013 int16 FORCE=1 00014 """ 00015 # Pseudo-constants 00016 PWM = 0 00017 FORCE = 1 00018 00019 __slots__ = ['control_type'] 00020 _slot_types = ['int16'] 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 control_type 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(ControlType, self).__init__(*args, **kwds) 00038 #message fields cannot be None, assign default values for those that are 00039 if self.control_type is None: 00040 self.control_type = 0 00041 else: 00042 self.control_type = 0 00043 00044 def _get_types(self): 00045 """ 00046 internal API method 00047 """ 00048 return self._slot_types 00049 00050 def serialize(self, buff): 00051 """ 00052 serialize message into buffer 00053 @param buff: buffer 00054 @type buff: StringIO 00055 """ 00056 try: 00057 buff.write(_struct_h.pack(self.control_type)) 00058 except struct.error as se: self._check_types(se) 00059 except TypeError as te: self._check_types(te) 00060 00061 def deserialize(self, str): 00062 """ 00063 unpack serialized message in str into this message instance 00064 @param str: byte array of serialized message 00065 @type str: str 00066 """ 00067 try: 00068 end = 0 00069 start = end 00070 end += 2 00071 (self.control_type,) = _struct_h.unpack(str[start:end]) 00072 return self 00073 except struct.error as e: 00074 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00075 00076 00077 def serialize_numpy(self, buff, numpy): 00078 """ 00079 serialize message with numpy array types into buffer 00080 @param buff: buffer 00081 @type buff: StringIO 00082 @param numpy: numpy python module 00083 @type numpy module 00084 """ 00085 try: 00086 buff.write(_struct_h.pack(self.control_type)) 00087 except struct.error as se: self._check_types(se) 00088 except TypeError as te: self._check_types(te) 00089 00090 def deserialize_numpy(self, str, numpy): 00091 """ 00092 unpack serialized message in str into this message instance using numpy for array types 00093 @param str: byte array of serialized message 00094 @type str: str 00095 @param numpy: numpy python module 00096 @type numpy: module 00097 """ 00098 try: 00099 end = 0 00100 start = end 00101 end += 2 00102 (self.control_type,) = _struct_h.unpack(str[start:end]) 00103 return self 00104 except struct.error as e: 00105 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00106 00107 _struct_I = roslib.message.struct_I 00108 _struct_h = struct.Struct("<h")