_LabeledControllerPoseSettings.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/LabeledControllerPoseSettings.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 LabeledControllerPoseSettings(genpy.Message):
00009   _md5sum = "693211d9c36a5f2d5e074080ca79820b"
00010   _type = "nasa_r2_common_msgs/LabeledControllerPoseSettings"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string originator
00013 float64 maxLinearVelocity
00014 float64 maxRotationalVelocity
00015 float64 maxLinearAcceleration
00016 float64 maxRotationalAcceleration
00017 
00018 """
00019   __slots__ = ['originator','maxLinearVelocity','maxRotationalVelocity','maxLinearAcceleration','maxRotationalAcceleration']
00020   _slot_types = ['string','float64','float64','float64','float64']
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        originator,maxLinearVelocity,maxRotationalVelocity,maxLinearAcceleration,maxRotationalAcceleration
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(LabeledControllerPoseSettings, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.originator is None:
00040         self.originator = ''
00041       if self.maxLinearVelocity is None:
00042         self.maxLinearVelocity = 0.
00043       if self.maxRotationalVelocity is None:
00044         self.maxRotationalVelocity = 0.
00045       if self.maxLinearAcceleration is None:
00046         self.maxLinearAcceleration = 0.
00047       if self.maxRotationalAcceleration is None:
00048         self.maxRotationalAcceleration = 0.
00049     else:
00050       self.originator = ''
00051       self.maxLinearVelocity = 0.
00052       self.maxRotationalVelocity = 0.
00053       self.maxLinearAcceleration = 0.
00054       self.maxRotationalAcceleration = 0.
00055 
00056   def _get_types(self):
00057     """
00058     internal API method
00059     """
00060     return self._slot_types
00061 
00062   def serialize(self, buff):
00063     """
00064     serialize message into buffer
00065     :param buff: buffer, ``StringIO``
00066     """
00067     try:
00068       _x = self.originator
00069       length = len(_x)
00070       if python3 or type(_x) == unicode:
00071         _x = _x.encode('utf-8')
00072         length = len(_x)
00073       buff.write(struct.pack('<I%ss'%length, length, _x))
00074       _x = self
00075       buff.write(_struct_4d.pack(_x.maxLinearVelocity, _x.maxRotationalVelocity, _x.maxLinearAcceleration, _x.maxRotationalAcceleration))
00076     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00077     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00078 
00079   def deserialize(self, str):
00080     """
00081     unpack serialized message in str into this message instance
00082     :param str: byte array of serialized message, ``str``
00083     """
00084     try:
00085       end = 0
00086       start = end
00087       end += 4
00088       (length,) = _struct_I.unpack(str[start:end])
00089       start = end
00090       end += length
00091       if python3:
00092         self.originator = str[start:end].decode('utf-8')
00093       else:
00094         self.originator = str[start:end]
00095       _x = self
00096       start = end
00097       end += 32
00098       (_x.maxLinearVelocity, _x.maxRotationalVelocity, _x.maxLinearAcceleration, _x.maxRotationalAcceleration,) = _struct_4d.unpack(str[start:end])
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       _x = self.originator
00112       length = len(_x)
00113       if python3 or type(_x) == unicode:
00114         _x = _x.encode('utf-8')
00115         length = len(_x)
00116       buff.write(struct.pack('<I%ss'%length, length, _x))
00117       _x = self
00118       buff.write(_struct_4d.pack(_x.maxLinearVelocity, _x.maxRotationalVelocity, _x.maxLinearAcceleration, _x.maxRotationalAcceleration))
00119     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00120     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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, ``str``
00126     :param numpy: numpy python module
00127     """
00128     try:
00129       end = 0
00130       start = end
00131       end += 4
00132       (length,) = _struct_I.unpack(str[start:end])
00133       start = end
00134       end += length
00135       if python3:
00136         self.originator = str[start:end].decode('utf-8')
00137       else:
00138         self.originator = str[start:end]
00139       _x = self
00140       start = end
00141       end += 32
00142       (_x.maxLinearVelocity, _x.maxRotationalVelocity, _x.maxLinearAcceleration, _x.maxRotationalAcceleration,) = _struct_4d.unpack(str[start:end])
00143       return self
00144     except struct.error as e:
00145       raise genpy.DeserializationError(e) #most likely buffer underfill
00146 
00147 _struct_I = genpy.struct_I
00148 _struct_4d = struct.Struct("<4d")


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34