_SingleJointPositionGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_controllers_msgs/SingleJointPositionGoal.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 genpy
00008 
00009 class SingleJointPositionGoal(genpy.Message):
00010   _md5sum = "fbaaa562a23a013fd5053e5f72cbb35c"
00011   _type = "pr2_controllers_msgs/SingleJointPositionGoal"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 float64 position
00015 duration min_duration
00016 float64 max_velocity
00017 
00018 """
00019   __slots__ = ['position','min_duration','max_velocity']
00020   _slot_types = ['float64','duration','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        position,min_duration,max_velocity
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(SingleJointPositionGoal, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.position is None:
00040         self.position = 0.
00041       if self.min_duration is None:
00042         self.min_duration = genpy.Duration()
00043       if self.max_velocity is None:
00044         self.max_velocity = 0.
00045     else:
00046       self.position = 0.
00047       self.min_duration = genpy.Duration()
00048       self.max_velocity = 0.
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       _x = self
00063       buff.write(_struct_d2id.pack(_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity))
00064     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00065     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00066 
00067   def deserialize(self, str):
00068     """
00069     unpack serialized message in str into this message instance
00070     :param str: byte array of serialized message, ``str``
00071     """
00072     try:
00073       if self.min_duration is None:
00074         self.min_duration = genpy.Duration()
00075       end = 0
00076       _x = self
00077       start = end
00078       end += 24
00079       (_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity,) = _struct_d2id.unpack(str[start:end])
00080       self.min_duration.canon()
00081       return self
00082     except struct.error as e:
00083       raise genpy.DeserializationError(e) #most likely buffer underfill
00084 
00085 
00086   def serialize_numpy(self, buff, numpy):
00087     """
00088     serialize message with numpy array types into buffer
00089     :param buff: buffer, ``StringIO``
00090     :param numpy: numpy python module
00091     """
00092     try:
00093       _x = self
00094       buff.write(_struct_d2id.pack(_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity))
00095     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00096     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00097 
00098   def deserialize_numpy(self, str, numpy):
00099     """
00100     unpack serialized message in str into this message instance using numpy for array types
00101     :param str: byte array of serialized message, ``str``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       if self.min_duration is None:
00106         self.min_duration = genpy.Duration()
00107       end = 0
00108       _x = self
00109       start = end
00110       end += 24
00111       (_x.position, _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity,) = _struct_d2id.unpack(str[start:end])
00112       self.min_duration.canon()
00113       return self
00114     except struct.error as e:
00115       raise genpy.DeserializationError(e) #most likely buffer underfill
00116 
00117 _struct_I = genpy.struct_I
00118 _struct_d2id = struct.Struct("<d2id")


pr2_controllers_msgs
Author(s): Stuart Glaser
autogenerated on Thu Apr 24 2014 15:44:13