00001 """autogenerated by genmsg_py from PoleSection.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006
00007 class PoleSection(roslib.message.Message):
00008 _md5sum = "91fec3910453ee4a9661a543b494b0c0"
00009 _type = "pole_structure_mapper/PoleSection"
00010 _has_header = False
00011 _full_text = """# Description…
00012
00013 geometry_msgs/Point base
00014 geometry_msgs/Vector3 axis
00015 float32 diameter # m
00016 float32 length # m
00017
00018 ================================================================================
00019 MSG: geometry_msgs/Point
00020 # This contains the position of a point in free space
00021 float64 x
00022 float64 y
00023 float64 z
00024
00025 ================================================================================
00026 MSG: geometry_msgs/Vector3
00027 # This represents a vector in free space.
00028
00029 float64 x
00030 float64 y
00031 float64 z
00032 """
00033 __slots__ = ['base','axis','diameter','length']
00034 _slot_types = ['geometry_msgs/Point','geometry_msgs/Vector3','float32','float32']
00035
00036 def __init__(self, *args, **kwds):
00037 """
00038 Constructor. Any message fields that are implicitly/explicitly
00039 set to None will be assigned a default value. The recommend
00040 use is keyword arguments as this is more robust to future message
00041 changes. You cannot mix in-order arguments and keyword arguments.
00042
00043 The available fields are:
00044 base,axis,diameter,length
00045
00046 @param args: complete set of field values, in .msg order
00047 @param kwds: use keyword arguments corresponding to message field names
00048 to set specific fields.
00049 """
00050 if args or kwds:
00051 super(PoleSection, self).__init__(*args, **kwds)
00052
00053 if self.base is None:
00054 self.base = geometry_msgs.msg.Point()
00055 if self.axis is None:
00056 self.axis = geometry_msgs.msg.Vector3()
00057 if self.diameter is None:
00058 self.diameter = 0.
00059 if self.length is None:
00060 self.length = 0.
00061 else:
00062 self.base = geometry_msgs.msg.Point()
00063 self.axis = geometry_msgs.msg.Vector3()
00064 self.diameter = 0.
00065 self.length = 0.
00066
00067 def _get_types(self):
00068 """
00069 internal API method
00070 """
00071 return self._slot_types
00072
00073 def serialize(self, buff):
00074 """
00075 serialize message into buffer
00076 @param buff: buffer
00077 @type buff: StringIO
00078 """
00079 try:
00080 _x = self
00081 buff.write(_struct_6d2f.pack(_x.base.x, _x.base.y, _x.base.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.diameter, _x.length))
00082 except struct.error as se: self._check_types(se)
00083 except TypeError as te: self._check_types(te)
00084
00085 def deserialize(self, str):
00086 """
00087 unpack serialized message in str into this message instance
00088 @param str: byte array of serialized message
00089 @type str: str
00090 """
00091 try:
00092 if self.base is None:
00093 self.base = geometry_msgs.msg.Point()
00094 if self.axis is None:
00095 self.axis = geometry_msgs.msg.Vector3()
00096 end = 0
00097 _x = self
00098 start = end
00099 end += 56
00100 (_x.base.x, _x.base.y, _x.base.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.diameter, _x.length,) = _struct_6d2f.unpack(str[start:end])
00101 return self
00102 except struct.error as e:
00103 raise roslib.message.DeserializationError(e)
00104
00105
00106 def serialize_numpy(self, buff, numpy):
00107 """
00108 serialize message with numpy array types into buffer
00109 @param buff: buffer
00110 @type buff: StringIO
00111 @param numpy: numpy python module
00112 @type numpy module
00113 """
00114 try:
00115 _x = self
00116 buff.write(_struct_6d2f.pack(_x.base.x, _x.base.y, _x.base.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.diameter, _x.length))
00117 except struct.error as se: self._check_types(se)
00118 except TypeError as te: self._check_types(te)
00119
00120 def deserialize_numpy(self, str, numpy):
00121 """
00122 unpack serialized message in str into this message instance using numpy for array types
00123 @param str: byte array of serialized message
00124 @type str: str
00125 @param numpy: numpy python module
00126 @type numpy: module
00127 """
00128 try:
00129 if self.base is None:
00130 self.base = geometry_msgs.msg.Point()
00131 if self.axis is None:
00132 self.axis = geometry_msgs.msg.Vector3()
00133 end = 0
00134 _x = self
00135 start = end
00136 end += 56
00137 (_x.base.x, _x.base.y, _x.base.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.diameter, _x.length,) = _struct_6d2f.unpack(str[start:end])
00138 return self
00139 except struct.error as e:
00140 raise roslib.message.DeserializationError(e)
00141
00142 _struct_I = roslib.message.struct_I
00143 _struct_6d2f = struct.Struct("<6d2f")