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