_cartesian_position.py
Go to the documentation of this file.
00001 """autogenerated by genpy from sr_robot_msgs/cartesian_position.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 cartesian_position(genpy.Message):
00009   _md5sum = "cfc3f1750a36a668eb93288ed1128f42"
00010   _type = "sr_robot_msgs/cartesian_position"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string  tip_name
00013 float32 tip_pos_x
00014 float32 tip_pos_y
00015 float32 tip_pos_z
00016 float32 tip_orientation_rho
00017 float32 tip_orientation_theta
00018 float32 tip_orientation_sigma
00019 
00020 
00021 """
00022   __slots__ = ['tip_name','tip_pos_x','tip_pos_y','tip_pos_z','tip_orientation_rho','tip_orientation_theta','tip_orientation_sigma']
00023   _slot_types = ['string','float32','float32','float32','float32','float32','float32']
00024 
00025   def __init__(self, *args, **kwds):
00026     """
00027     Constructor. Any message fields that are implicitly/explicitly
00028     set to None will be assigned a default value. The recommend
00029     use is keyword arguments as this is more robust to future message
00030     changes.  You cannot mix in-order arguments and keyword arguments.
00031 
00032     The available fields are:
00033        tip_name,tip_pos_x,tip_pos_y,tip_pos_z,tip_orientation_rho,tip_orientation_theta,tip_orientation_sigma
00034 
00035     :param args: complete set of field values, in .msg order
00036     :param kwds: use keyword arguments corresponding to message field names
00037     to set specific fields.
00038     """
00039     if args or kwds:
00040       super(cartesian_position, self).__init__(*args, **kwds)
00041       #message fields cannot be None, assign default values for those that are
00042       if self.tip_name is None:
00043         self.tip_name = ''
00044       if self.tip_pos_x is None:
00045         self.tip_pos_x = 0.
00046       if self.tip_pos_y is None:
00047         self.tip_pos_y = 0.
00048       if self.tip_pos_z is None:
00049         self.tip_pos_z = 0.
00050       if self.tip_orientation_rho is None:
00051         self.tip_orientation_rho = 0.
00052       if self.tip_orientation_theta is None:
00053         self.tip_orientation_theta = 0.
00054       if self.tip_orientation_sigma is None:
00055         self.tip_orientation_sigma = 0.
00056     else:
00057       self.tip_name = ''
00058       self.tip_pos_x = 0.
00059       self.tip_pos_y = 0.
00060       self.tip_pos_z = 0.
00061       self.tip_orientation_rho = 0.
00062       self.tip_orientation_theta = 0.
00063       self.tip_orientation_sigma = 0.
00064 
00065   def _get_types(self):
00066     """
00067     internal API method
00068     """
00069     return self._slot_types
00070 
00071   def serialize(self, buff):
00072     """
00073     serialize message into buffer
00074     :param buff: buffer, ``StringIO``
00075     """
00076     try:
00077       _x = self.tip_name
00078       length = len(_x)
00079       if python3 or type(_x) == unicode:
00080         _x = _x.encode('utf-8')
00081         length = len(_x)
00082       buff.write(struct.pack('<I%ss'%length, length, _x))
00083       _x = self
00084       buff.write(_struct_6f.pack(_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma))
00085     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00086     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00087 
00088   def deserialize(self, str):
00089     """
00090     unpack serialized message in str into this message instance
00091     :param str: byte array of serialized message, ``str``
00092     """
00093     try:
00094       end = 0
00095       start = end
00096       end += 4
00097       (length,) = _struct_I.unpack(str[start:end])
00098       start = end
00099       end += length
00100       if python3:
00101         self.tip_name = str[start:end].decode('utf-8')
00102       else:
00103         self.tip_name = str[start:end]
00104       _x = self
00105       start = end
00106       end += 24
00107       (_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma,) = _struct_6f.unpack(str[start:end])
00108       return self
00109     except struct.error as e:
00110       raise genpy.DeserializationError(e) #most likely buffer underfill
00111 
00112 
00113   def serialize_numpy(self, buff, numpy):
00114     """
00115     serialize message with numpy array types into buffer
00116     :param buff: buffer, ``StringIO``
00117     :param numpy: numpy python module
00118     """
00119     try:
00120       _x = self.tip_name
00121       length = len(_x)
00122       if python3 or type(_x) == unicode:
00123         _x = _x.encode('utf-8')
00124         length = len(_x)
00125       buff.write(struct.pack('<I%ss'%length, length, _x))
00126       _x = self
00127       buff.write(_struct_6f.pack(_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma))
00128     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00129     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00130 
00131   def deserialize_numpy(self, str, numpy):
00132     """
00133     unpack serialized message in str into this message instance using numpy for array types
00134     :param str: byte array of serialized message, ``str``
00135     :param numpy: numpy python module
00136     """
00137     try:
00138       end = 0
00139       start = end
00140       end += 4
00141       (length,) = _struct_I.unpack(str[start:end])
00142       start = end
00143       end += length
00144       if python3:
00145         self.tip_name = str[start:end].decode('utf-8')
00146       else:
00147         self.tip_name = str[start:end]
00148       _x = self
00149       start = end
00150       end += 24
00151       (_x.tip_pos_x, _x.tip_pos_y, _x.tip_pos_z, _x.tip_orientation_rho, _x.tip_orientation_theta, _x.tip_orientation_sigma,) = _struct_6f.unpack(str[start:end])
00152       return self
00153     except struct.error as e:
00154       raise genpy.DeserializationError(e) #most likely buffer underfill
00155 
00156 _struct_I = genpy.struct_I
00157 _struct_6f = struct.Struct("<6f")


sr_robot_msgs
Author(s): Ugo Cupcic/ugo@shadowrobot.com
autogenerated on Mon Oct 6 2014 07:40:05