Go to the documentation of this file.00001 """autogenerated by genpy from corobot_msgs/MoveArm.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 MoveArm(genpy.Message):
00009 _md5sum = "75521d5964134bfaa7e916433846c0ca"
00010 _type = "corobot_msgs/MoveArm"
00011 _has_header = False
00012 _full_text = """#
00013 # Morgan Cormier <mcormier@coroware.com>
00014 #
00015 # Message used to set or get the position of a servo motor connected to a Phidget servo controller.
00016 #
00017
00018 ####### Possible Indexes #########
00019 uint8 BASE_ROTATION = 0
00020 uint8 SHOULDER = 1
00021 uint8 ELBOW = 2
00022 uint8 WRIST_FLEX = 3
00023 uint8 WRIST_ROTATION = 3
00024 uint8 GRIPPER = 4
00025
00026 # Index is the index from the list of possible index.
00027 int8 index
00028
00029 # position is the angle in degree set for the servo motor selected with index
00030 float32 position
00031
00032 """
00033
00034 BASE_ROTATION = 0
00035 SHOULDER = 1
00036 ELBOW = 2
00037 WRIST_FLEX = 3
00038 WRIST_ROTATION = 3
00039 GRIPPER = 4
00040
00041 __slots__ = ['index','position']
00042 _slot_types = ['int8','float32']
00043
00044 def __init__(self, *args, **kwds):
00045 """
00046 Constructor. Any message fields that are implicitly/explicitly
00047 set to None will be assigned a default value. The recommend
00048 use is keyword arguments as this is more robust to future message
00049 changes. You cannot mix in-order arguments and keyword arguments.
00050
00051 The available fields are:
00052 index,position
00053
00054 :param args: complete set of field values, in .msg order
00055 :param kwds: use keyword arguments corresponding to message field names
00056 to set specific fields.
00057 """
00058 if args or kwds:
00059 super(MoveArm, self).__init__(*args, **kwds)
00060
00061 if self.index is None:
00062 self.index = 0
00063 if self.position is None:
00064 self.position = 0.
00065 else:
00066 self.index = 0
00067 self.position = 0.
00068
00069 def _get_types(self):
00070 """
00071 internal API method
00072 """
00073 return self._slot_types
00074
00075 def serialize(self, buff):
00076 """
00077 serialize message into buffer
00078 :param buff: buffer, ``StringIO``
00079 """
00080 try:
00081 _x = self
00082 buff.write(_struct_bf.pack(_x.index, _x.position))
00083 except struct.error as se: self._check_types(se)
00084 except TypeError as te: self._check_types(te)
00085
00086 def deserialize(self, str):
00087 """
00088 unpack serialized message in str into this message instance
00089 :param str: byte array of serialized message, ``str``
00090 """
00091 try:
00092 end = 0
00093 _x = self
00094 start = end
00095 end += 5
00096 (_x.index, _x.position,) = _struct_bf.unpack(str[start:end])
00097 return self
00098 except struct.error as e:
00099 raise genpy.DeserializationError(e)
00100
00101
00102 def serialize_numpy(self, buff, numpy):
00103 """
00104 serialize message with numpy array types into buffer
00105 :param buff: buffer, ``StringIO``
00106 :param numpy: numpy python module
00107 """
00108 try:
00109 _x = self
00110 buff.write(_struct_bf.pack(_x.index, _x.position))
00111 except struct.error as se: self._check_types(se)
00112 except TypeError as te: self._check_types(te)
00113
00114 def deserialize_numpy(self, str, numpy):
00115 """
00116 unpack serialized message in str into this message instance using numpy for array types
00117 :param str: byte array of serialized message, ``str``
00118 :param numpy: numpy python module
00119 """
00120 try:
00121 end = 0
00122 _x = self
00123 start = end
00124 end += 5
00125 (_x.index, _x.position,) = _struct_bf.unpack(str[start:end])
00126 return self
00127 except struct.error as e:
00128 raise genpy.DeserializationError(e)
00129
00130 _struct_I = genpy.struct_I
00131 _struct_bf = struct.Struct("<bf")