$search
00001 """autogenerated by genmsg_py from ChangeMotorSystemControlsRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import sr_robot_msgs.msg 00006 00007 class ChangeMotorSystemControlsRequest(roslib.message.Message): 00008 _md5sum = "6458c2239125c960f4d1ef4d23696a1e" 00009 _type = "sr_robot_msgs/ChangeMotorSystemControlsRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """MotorSystemControls[] motor_system_controls 00012 00013 ================================================================================ 00014 MSG: sr_robot_msgs/MotorSystemControls 00015 int8 motor_id # the id of the motor you want to control 00016 00017 bool enable_backlash_compensation # switch on/off backlash compensation at the motor level 00018 bool increase_sgl_tracking # increment the tracking value for the left gauge 00019 bool decrease_sgl_tracking # decrement the tracking value for the left gauge 00020 bool increase_sgr_tracking # increment the tracking value for the right gauge 00021 bool decrease_sgr_tracking # decrement the tracking value for the right gauge 00022 bool initiate_jiggling # starts jiggling the given motor 00023 bool write_config_to_eeprom # write the current configuration to the eeprom 00024 """ 00025 __slots__ = ['motor_system_controls'] 00026 _slot_types = ['sr_robot_msgs/MotorSystemControls[]'] 00027 00028 def __init__(self, *args, **kwds): 00029 """ 00030 Constructor. Any message fields that are implicitly/explicitly 00031 set to None will be assigned a default value. The recommend 00032 use is keyword arguments as this is more robust to future message 00033 changes. You cannot mix in-order arguments and keyword arguments. 00034 00035 The available fields are: 00036 motor_system_controls 00037 00038 @param args: complete set of field values, in .msg order 00039 @param kwds: use keyword arguments corresponding to message field names 00040 to set specific fields. 00041 """ 00042 if args or kwds: 00043 super(ChangeMotorSystemControlsRequest, self).__init__(*args, **kwds) 00044 #message fields cannot be None, assign default values for those that are 00045 if self.motor_system_controls is None: 00046 self.motor_system_controls = [] 00047 else: 00048 self.motor_system_controls = [] 00049 00050 def _get_types(self): 00051 """ 00052 internal API method 00053 """ 00054 return self._slot_types 00055 00056 def serialize(self, buff): 00057 """ 00058 serialize message into buffer 00059 @param buff: buffer 00060 @type buff: StringIO 00061 """ 00062 try: 00063 length = len(self.motor_system_controls) 00064 buff.write(_struct_I.pack(length)) 00065 for val1 in self.motor_system_controls: 00066 _x = val1 00067 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)) 00068 except struct.error as se: self._check_types(se) 00069 except TypeError as te: self._check_types(te) 00070 00071 def deserialize(self, str): 00072 """ 00073 unpack serialized message in str into this message instance 00074 @param str: byte array of serialized message 00075 @type str: str 00076 """ 00077 try: 00078 end = 0 00079 start = end 00080 end += 4 00081 (length,) = _struct_I.unpack(str[start:end]) 00082 self.motor_system_controls = [] 00083 for i in range(0, length): 00084 val1 = sr_robot_msgs.msg.MotorSystemControls() 00085 _x = val1 00086 start = end 00087 end += 8 00088 (_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]) 00089 val1.enable_backlash_compensation = bool(val1.enable_backlash_compensation) 00090 val1.increase_sgl_tracking = bool(val1.increase_sgl_tracking) 00091 val1.decrease_sgl_tracking = bool(val1.decrease_sgl_tracking) 00092 val1.increase_sgr_tracking = bool(val1.increase_sgr_tracking) 00093 val1.decrease_sgr_tracking = bool(val1.decrease_sgr_tracking) 00094 val1.initiate_jiggling = bool(val1.initiate_jiggling) 00095 val1.write_config_to_eeprom = bool(val1.write_config_to_eeprom) 00096 self.motor_system_controls.append(val1) 00097 return self 00098 except struct.error as e: 00099 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00100 00101 00102 def serialize_numpy(self, buff, numpy): 00103 """ 00104 serialize message with numpy array types into buffer 00105 @param buff: buffer 00106 @type buff: StringIO 00107 @param numpy: numpy python module 00108 @type numpy module 00109 """ 00110 try: 00111 length = len(self.motor_system_controls) 00112 buff.write(_struct_I.pack(length)) 00113 for val1 in self.motor_system_controls: 00114 _x = val1 00115 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)) 00116 except struct.error as se: self._check_types(se) 00117 except TypeError as te: self._check_types(te) 00118 00119 def deserialize_numpy(self, str, numpy): 00120 """ 00121 unpack serialized message in str into this message instance using numpy for array types 00122 @param str: byte array of serialized message 00123 @type str: str 00124 @param numpy: numpy python module 00125 @type numpy: module 00126 """ 00127 try: 00128 end = 0 00129 start = end 00130 end += 4 00131 (length,) = _struct_I.unpack(str[start:end]) 00132 self.motor_system_controls = [] 00133 for i in range(0, length): 00134 val1 = sr_robot_msgs.msg.MotorSystemControls() 00135 _x = val1 00136 start = end 00137 end += 8 00138 (_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]) 00139 val1.enable_backlash_compensation = bool(val1.enable_backlash_compensation) 00140 val1.increase_sgl_tracking = bool(val1.increase_sgl_tracking) 00141 val1.decrease_sgl_tracking = bool(val1.decrease_sgl_tracking) 00142 val1.increase_sgr_tracking = bool(val1.increase_sgr_tracking) 00143 val1.decrease_sgr_tracking = bool(val1.decrease_sgr_tracking) 00144 val1.initiate_jiggling = bool(val1.initiate_jiggling) 00145 val1.write_config_to_eeprom = bool(val1.write_config_to_eeprom) 00146 self.motor_system_controls.append(val1) 00147 return self 00148 except struct.error as e: 00149 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00150 00151 _struct_I = roslib.message.struct_I 00152 _struct_b7B = struct.Struct("<b7B") 00153 """autogenerated by genmsg_py from ChangeMotorSystemControlsResponse.msg. Do not edit.""" 00154 import roslib.message 00155 import struct 00156 00157 00158 class ChangeMotorSystemControlsResponse(roslib.message.Message): 00159 _md5sum = "5dade9e97a517a3f230ed76028e54c71" 00160 _type = "sr_robot_msgs/ChangeMotorSystemControlsResponse" 00161 _has_header = False #flag to mark the presence of a Header object 00162 _full_text = """int8 result 00163 00164 int8 SUCCESS=0 00165 int8 MOTOR_ID_OUT_OF_RANGE=-1 00166 00167 """ 00168 # Pseudo-constants 00169 SUCCESS = 0 00170 MOTOR_ID_OUT_OF_RANGE = -1 00171 00172 __slots__ = ['result'] 00173 _slot_types = ['int8'] 00174 00175 def __init__(self, *args, **kwds): 00176 """ 00177 Constructor. Any message fields that are implicitly/explicitly 00178 set to None will be assigned a default value. The recommend 00179 use is keyword arguments as this is more robust to future message 00180 changes. You cannot mix in-order arguments and keyword arguments. 00181 00182 The available fields are: 00183 result 00184 00185 @param args: complete set of field values, in .msg order 00186 @param kwds: use keyword arguments corresponding to message field names 00187 to set specific fields. 00188 """ 00189 if args or kwds: 00190 super(ChangeMotorSystemControlsResponse, self).__init__(*args, **kwds) 00191 #message fields cannot be None, assign default values for those that are 00192 if self.result is None: 00193 self.result = 0 00194 else: 00195 self.result = 0 00196 00197 def _get_types(self): 00198 """ 00199 internal API method 00200 """ 00201 return self._slot_types 00202 00203 def serialize(self, buff): 00204 """ 00205 serialize message into buffer 00206 @param buff: buffer 00207 @type buff: StringIO 00208 """ 00209 try: 00210 buff.write(_struct_b.pack(self.result)) 00211 except struct.error as se: self._check_types(se) 00212 except TypeError as te: self._check_types(te) 00213 00214 def deserialize(self, str): 00215 """ 00216 unpack serialized message in str into this message instance 00217 @param str: byte array of serialized message 00218 @type str: str 00219 """ 00220 try: 00221 end = 0 00222 start = end 00223 end += 1 00224 (self.result,) = _struct_b.unpack(str[start:end]) 00225 return self 00226 except struct.error as e: 00227 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00228 00229 00230 def serialize_numpy(self, buff, numpy): 00231 """ 00232 serialize message with numpy array types into buffer 00233 @param buff: buffer 00234 @type buff: StringIO 00235 @param numpy: numpy python module 00236 @type numpy module 00237 """ 00238 try: 00239 buff.write(_struct_b.pack(self.result)) 00240 except struct.error as se: self._check_types(se) 00241 except TypeError as te: self._check_types(te) 00242 00243 def deserialize_numpy(self, str, numpy): 00244 """ 00245 unpack serialized message in str into this message instance using numpy for array types 00246 @param str: byte array of serialized message 00247 @type str: str 00248 @param numpy: numpy python module 00249 @type numpy: module 00250 """ 00251 try: 00252 end = 0 00253 start = end 00254 end += 1 00255 (self.result,) = _struct_b.unpack(str[start:end]) 00256 return self 00257 except struct.error as e: 00258 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00259 00260 _struct_I = roslib.message.struct_I 00261 _struct_b = struct.Struct("<b") 00262 class ChangeMotorSystemControls(roslib.message.ServiceDefinition): 00263 _type = 'sr_robot_msgs/ChangeMotorSystemControls' 00264 _md5sum = 'd953bca2f568403b8e2c3f41c87d9ac4' 00265 _request_class = ChangeMotorSystemControlsRequest 00266 _response_class = ChangeMotorSystemControlsResponse