$search
00001 """autogenerated by genmsg_py from MotorSystemControls.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class MotorSystemControls(roslib.message.Message): 00007 _md5sum = "0686822f46acfde0133711bd613a20f1" 00008 _type = "sr_robot_msgs/MotorSystemControls" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int8 motor_id # the id of the motor you want to control 00011 00012 bool enable_backlash_compensation # switch on/off backlash compensation at the motor level 00013 bool increase_sgl_tracking # increment the tracking value for the left gauge 00014 bool decrease_sgl_tracking # decrement the tracking value for the left gauge 00015 bool increase_sgr_tracking # increment the tracking value for the right gauge 00016 bool decrease_sgr_tracking # decrement the tracking value for the right gauge 00017 bool initiate_jiggling # starts jiggling the given motor 00018 bool write_config_to_eeprom # write the current configuration to the eeprom 00019 """ 00020 __slots__ = ['motor_id','enable_backlash_compensation','increase_sgl_tracking','decrease_sgl_tracking','increase_sgr_tracking','decrease_sgr_tracking','initiate_jiggling','write_config_to_eeprom'] 00021 _slot_types = ['int8','bool','bool','bool','bool','bool','bool','bool'] 00022 00023 def __init__(self, *args, **kwds): 00024 """ 00025 Constructor. Any message fields that are implicitly/explicitly 00026 set to None will be assigned a default value. The recommend 00027 use is keyword arguments as this is more robust to future message 00028 changes. You cannot mix in-order arguments and keyword arguments. 00029 00030 The available fields are: 00031 motor_id,enable_backlash_compensation,increase_sgl_tracking,decrease_sgl_tracking,increase_sgr_tracking,decrease_sgr_tracking,initiate_jiggling,write_config_to_eeprom 00032 00033 @param args: complete set of field values, in .msg order 00034 @param kwds: use keyword arguments corresponding to message field names 00035 to set specific fields. 00036 """ 00037 if args or kwds: 00038 super(MotorSystemControls, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.motor_id is None: 00041 self.motor_id = 0 00042 if self.enable_backlash_compensation is None: 00043 self.enable_backlash_compensation = False 00044 if self.increase_sgl_tracking is None: 00045 self.increase_sgl_tracking = False 00046 if self.decrease_sgl_tracking is None: 00047 self.decrease_sgl_tracking = False 00048 if self.increase_sgr_tracking is None: 00049 self.increase_sgr_tracking = False 00050 if self.decrease_sgr_tracking is None: 00051 self.decrease_sgr_tracking = False 00052 if self.initiate_jiggling is None: 00053 self.initiate_jiggling = False 00054 if self.write_config_to_eeprom is None: 00055 self.write_config_to_eeprom = False 00056 else: 00057 self.motor_id = 0 00058 self.enable_backlash_compensation = False 00059 self.increase_sgl_tracking = False 00060 self.decrease_sgl_tracking = False 00061 self.increase_sgr_tracking = False 00062 self.decrease_sgr_tracking = False 00063 self.initiate_jiggling = False 00064 self.write_config_to_eeprom = False 00065 00066 def _get_types(self): 00067 """ 00068 internal API method 00069 """ 00070 return self._slot_types 00071 00072 def serialize(self, buff): 00073 """ 00074 serialize message into buffer 00075 @param buff: buffer 00076 @type buff: StringIO 00077 """ 00078 try: 00079 _x = self 00080 buff.write(_struct_b7B.pack(_x.motor_id, _x.enable_backlash_compensation, _x.increase_sgl_tracking, _x.decrease_sgl_tracking, _x.increase_sgr_tracking, _x.decrease_sgr_tracking, _x.initiate_jiggling, _x.write_config_to_eeprom)) 00081 except struct.error as se: self._check_types(se) 00082 except TypeError as te: self._check_types(te) 00083 00084 def deserialize(self, str): 00085 """ 00086 unpack serialized message in str into this message instance 00087 @param str: byte array of serialized message 00088 @type str: str 00089 """ 00090 try: 00091 end = 0 00092 _x = self 00093 start = end 00094 end += 8 00095 (_x.motor_id, _x.enable_backlash_compensation, _x.increase_sgl_tracking, _x.decrease_sgl_tracking, _x.increase_sgr_tracking, _x.decrease_sgr_tracking, _x.initiate_jiggling, _x.write_config_to_eeprom,) = _struct_b7B.unpack(str[start:end]) 00096 self.enable_backlash_compensation = bool(self.enable_backlash_compensation) 00097 self.increase_sgl_tracking = bool(self.increase_sgl_tracking) 00098 self.decrease_sgl_tracking = bool(self.decrease_sgl_tracking) 00099 self.increase_sgr_tracking = bool(self.increase_sgr_tracking) 00100 self.decrease_sgr_tracking = bool(self.decrease_sgr_tracking) 00101 self.initiate_jiggling = bool(self.initiate_jiggling) 00102 self.write_config_to_eeprom = bool(self.write_config_to_eeprom) 00103 return self 00104 except struct.error as e: 00105 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00106 00107 00108 def serialize_numpy(self, buff, numpy): 00109 """ 00110 serialize message with numpy array types into buffer 00111 @param buff: buffer 00112 @type buff: StringIO 00113 @param numpy: numpy python module 00114 @type numpy module 00115 """ 00116 try: 00117 _x = self 00118 buff.write(_struct_b7B.pack(_x.motor_id, _x.enable_backlash_compensation, _x.increase_sgl_tracking, _x.decrease_sgl_tracking, _x.increase_sgr_tracking, _x.decrease_sgr_tracking, _x.initiate_jiggling, _x.write_config_to_eeprom)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize_numpy(self, str, numpy): 00123 """ 00124 unpack serialized message in str into this message instance using numpy for array types 00125 @param str: byte array of serialized message 00126 @type str: str 00127 @param numpy: numpy python module 00128 @type numpy: module 00129 """ 00130 try: 00131 end = 0 00132 _x = self 00133 start = end 00134 end += 8 00135 (_x.motor_id, _x.enable_backlash_compensation, _x.increase_sgl_tracking, _x.decrease_sgl_tracking, _x.increase_sgr_tracking, _x.decrease_sgr_tracking, _x.initiate_jiggling, _x.write_config_to_eeprom,) = _struct_b7B.unpack(str[start:end]) 00136 self.enable_backlash_compensation = bool(self.enable_backlash_compensation) 00137 self.increase_sgl_tracking = bool(self.increase_sgl_tracking) 00138 self.decrease_sgl_tracking = bool(self.decrease_sgl_tracking) 00139 self.increase_sgr_tracking = bool(self.increase_sgr_tracking) 00140 self.decrease_sgr_tracking = bool(self.decrease_sgr_tracking) 00141 self.initiate_jiggling = bool(self.initiate_jiggling) 00142 self.write_config_to_eeprom = bool(self.write_config_to_eeprom) 00143 return self 00144 except struct.error as e: 00145 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00146 00147 _struct_I = roslib.message.struct_I 00148 _struct_b7B = struct.Struct("<b7B")