_ArmToSideGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tidyup_msgs/ArmToSideGoal.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 ArmToSideGoal(genpy.Message):
00009   _md5sum = "4da9069facca935244c3405e288ba555"
00010   _type = "tidyup_msgs/ArmToSideGoal"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 # either move the left or right arm
00014 bool left_arm
00015 bool right_arm
00016 
00017 """
00018   __slots__ = ['left_arm','right_arm']
00019   _slot_types = ['bool','bool']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        left_arm,right_arm
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(ArmToSideGoal, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.left_arm is None:
00039         self.left_arm = False
00040       if self.right_arm is None:
00041         self.right_arm = False
00042     else:
00043       self.left_arm = False
00044       self.right_arm = False
00045 
00046   def _get_types(self):
00047     """
00048     internal API method
00049     """
00050     return self._slot_types
00051 
00052   def serialize(self, buff):
00053     """
00054     serialize message into buffer
00055     :param buff: buffer, ``StringIO``
00056     """
00057     try:
00058       _x = self
00059       buff.write(_struct_2B.pack(_x.left_arm, _x.right_arm))
00060     except struct.error as se: self._check_types(se)
00061     except TypeError as te: self._check_types(te)
00062 
00063   def deserialize(self, str):
00064     """
00065     unpack serialized message in str into this message instance
00066     :param str: byte array of serialized message, ``str``
00067     """
00068     try:
00069       end = 0
00070       _x = self
00071       start = end
00072       end += 2
00073       (_x.left_arm, _x.right_arm,) = _struct_2B.unpack(str[start:end])
00074       self.left_arm = bool(self.left_arm)
00075       self.right_arm = bool(self.right_arm)
00076       return self
00077     except struct.error as e:
00078       raise genpy.DeserializationError(e) #most likely buffer underfill
00079 
00080 
00081   def serialize_numpy(self, buff, numpy):
00082     """
00083     serialize message with numpy array types into buffer
00084     :param buff: buffer, ``StringIO``
00085     :param numpy: numpy python module
00086     """
00087     try:
00088       _x = self
00089       buff.write(_struct_2B.pack(_x.left_arm, _x.right_arm))
00090     except struct.error as se: self._check_types(se)
00091     except TypeError as te: self._check_types(te)
00092 
00093   def deserialize_numpy(self, str, numpy):
00094     """
00095     unpack serialized message in str into this message instance using numpy for array types
00096     :param str: byte array of serialized message, ``str``
00097     :param numpy: numpy python module
00098     """
00099     try:
00100       end = 0
00101       _x = self
00102       start = end
00103       end += 2
00104       (_x.left_arm, _x.right_arm,) = _struct_2B.unpack(str[start:end])
00105       self.left_arm = bool(self.left_arm)
00106       self.right_arm = bool(self.right_arm)
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 _struct_I = genpy.struct_I
00112 _struct_2B = struct.Struct("<2B")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


tidyup_msgs
Author(s): Maintained by Christian Dornhege
autogenerated on Wed Dec 26 2012 15:47:06