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


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