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


sr_robot_msgs
Author(s): Ugo Cupcic/ugo@shadowrobot.com
autogenerated on Mon Oct 6 2014 07:40:05