_ArmAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from simple_arm_server/ArmAction.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 geometry_msgs.msg
00008 import genpy
00009 
00010 class ArmAction(genpy.Message):
00011   _md5sum = "3cbdbdb85ac6ff6f8288425d4a1dec78"
00012   _type = "simple_arm_server/ArmAction"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """#
00015 # Move arm or adjust gripper
00016 #
00017 
00018 byte MOVE_ARM=0
00019 byte MOVE_GRIPPER=1
00020 
00021 byte type                   # move the arm or the gripper?
00022 
00023 geometry_msgs/Pose goal     # goal for arm
00024 float64 command    # width to open gripper
00025 
00026 duration move_time
00027 
00028 ================================================================================
00029 MSG: geometry_msgs/Pose
00030 # A representation of pose in free space, composed of postion and orientation. 
00031 Point position
00032 Quaternion orientation
00033 
00034 ================================================================================
00035 MSG: geometry_msgs/Point
00036 # This contains the position of a point in free space
00037 float64 x
00038 float64 y
00039 float64 z
00040 
00041 ================================================================================
00042 MSG: geometry_msgs/Quaternion
00043 # This represents an orientation in free space in quaternion form.
00044 
00045 float64 x
00046 float64 y
00047 float64 z
00048 float64 w
00049 
00050 """
00051   # Pseudo-constants
00052   MOVE_ARM = 0
00053   MOVE_GRIPPER = 1
00054 
00055   __slots__ = ['type','goal','command','move_time']
00056   _slot_types = ['byte','geometry_msgs/Pose','float64','duration']
00057 
00058   def __init__(self, *args, **kwds):
00059     """
00060     Constructor. Any message fields that are implicitly/explicitly
00061     set to None will be assigned a default value. The recommend
00062     use is keyword arguments as this is more robust to future message
00063     changes.  You cannot mix in-order arguments and keyword arguments.
00064 
00065     The available fields are:
00066        type,goal,command,move_time
00067 
00068     :param args: complete set of field values, in .msg order
00069     :param kwds: use keyword arguments corresponding to message field names
00070     to set specific fields.
00071     """
00072     if args or kwds:
00073       super(ArmAction, self).__init__(*args, **kwds)
00074       #message fields cannot be None, assign default values for those that are
00075       if self.type is None:
00076         self.type = 0
00077       if self.goal is None:
00078         self.goal = geometry_msgs.msg.Pose()
00079       if self.command is None:
00080         self.command = 0.
00081       if self.move_time is None:
00082         self.move_time = genpy.Duration()
00083     else:
00084       self.type = 0
00085       self.goal = geometry_msgs.msg.Pose()
00086       self.command = 0.
00087       self.move_time = genpy.Duration()
00088 
00089   def _get_types(self):
00090     """
00091     internal API method
00092     """
00093     return self._slot_types
00094 
00095   def serialize(self, buff):
00096     """
00097     serialize message into buffer
00098     :param buff: buffer, ``StringIO``
00099     """
00100     try:
00101       _x = self
00102       buff.write(_struct_b8d2i.pack(_x.type, _x.goal.position.x, _x.goal.position.y, _x.goal.position.z, _x.goal.orientation.x, _x.goal.orientation.y, _x.goal.orientation.z, _x.goal.orientation.w, _x.command, _x.move_time.secs, _x.move_time.nsecs))
00103     except struct.error as se: self._check_types(se)
00104     except TypeError as te: self._check_types(te)
00105 
00106   def deserialize(self, str):
00107     """
00108     unpack serialized message in str into this message instance
00109     :param str: byte array of serialized message, ``str``
00110     """
00111     try:
00112       if self.goal is None:
00113         self.goal = geometry_msgs.msg.Pose()
00114       if self.move_time is None:
00115         self.move_time = genpy.Duration()
00116       end = 0
00117       _x = self
00118       start = end
00119       end += 73
00120       (_x.type, _x.goal.position.x, _x.goal.position.y, _x.goal.position.z, _x.goal.orientation.x, _x.goal.orientation.y, _x.goal.orientation.z, _x.goal.orientation.w, _x.command, _x.move_time.secs, _x.move_time.nsecs,) = _struct_b8d2i.unpack(str[start:end])
00121       self.move_time.canon()
00122       return self
00123     except struct.error as e:
00124       raise genpy.DeserializationError(e) #most likely buffer underfill
00125 
00126 
00127   def serialize_numpy(self, buff, numpy):
00128     """
00129     serialize message with numpy array types into buffer
00130     :param buff: buffer, ``StringIO``
00131     :param numpy: numpy python module
00132     """
00133     try:
00134       _x = self
00135       buff.write(_struct_b8d2i.pack(_x.type, _x.goal.position.x, _x.goal.position.y, _x.goal.position.z, _x.goal.orientation.x, _x.goal.orientation.y, _x.goal.orientation.z, _x.goal.orientation.w, _x.command, _x.move_time.secs, _x.move_time.nsecs))
00136     except struct.error as se: self._check_types(se)
00137     except TypeError as te: self._check_types(te)
00138 
00139   def deserialize_numpy(self, str, numpy):
00140     """
00141     unpack serialized message in str into this message instance using numpy for array types
00142     :param str: byte array of serialized message, ``str``
00143     :param numpy: numpy python module
00144     """
00145     try:
00146       if self.goal is None:
00147         self.goal = geometry_msgs.msg.Pose()
00148       if self.move_time is None:
00149         self.move_time = genpy.Duration()
00150       end = 0
00151       _x = self
00152       start = end
00153       end += 73
00154       (_x.type, _x.goal.position.x, _x.goal.position.y, _x.goal.position.z, _x.goal.orientation.x, _x.goal.orientation.y, _x.goal.orientation.z, _x.goal.orientation.w, _x.command, _x.move_time.secs, _x.move_time.nsecs,) = _struct_b8d2i.unpack(str[start:end])
00155       self.move_time.canon()
00156       return self
00157     except struct.error as e:
00158       raise genpy.DeserializationError(e) #most likely buffer underfill
00159 
00160 _struct_I = genpy.struct_I
00161 _struct_b8d2i = struct.Struct("<b8d2i")


simple_arm_server
Author(s): Michael Ferguson
autogenerated on Fri Jan 3 2014 11:58:43