00001 """autogenerated by genpy from object_manipulation_msgs/GripperTranslation.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 std_msgs.msg
00009
00010 class GripperTranslation(genpy.Message):
00011 _md5sum = "b53bc0ad0f717cdec3b0e42dec300121"
00012 _type = "object_manipulation_msgs/GripperTranslation"
00013 _has_header = False
00014 _full_text = """# defines a translation for the gripper, used in pickup or place tasks
00015 # for example for lifting an object off a table or approaching the table for placing
00016
00017 # the direction of the translation
00018 geometry_msgs/Vector3Stamped direction
00019
00020 # the desired translation distance
00021 float32 desired_distance
00022
00023 # the min distance that must be considered feasible before the
00024 # grasp is even attempted
00025 float32 min_distance
00026 ================================================================================
00027 MSG: geometry_msgs/Vector3Stamped
00028 # This represents a Vector3 with reference coordinate frame and timestamp
00029 Header header
00030 Vector3 vector
00031
00032 ================================================================================
00033 MSG: std_msgs/Header
00034 # Standard metadata for higher-level stamped data types.
00035 # This is generally used to communicate timestamped data
00036 # in a particular coordinate frame.
00037 #
00038 # sequence ID: consecutively increasing ID
00039 uint32 seq
00040 #Two-integer timestamp that is expressed as:
00041 # * stamp.secs: seconds (stamp_secs) since epoch
00042 # * stamp.nsecs: nanoseconds since stamp_secs
00043 # time-handling sugar is provided by the client library
00044 time stamp
00045 #Frame this data is associated with
00046 # 0: no frame
00047 # 1: global frame
00048 string frame_id
00049
00050 ================================================================================
00051 MSG: geometry_msgs/Vector3
00052 # This represents a vector in free space.
00053
00054 float64 x
00055 float64 y
00056 float64 z
00057 """
00058 __slots__ = ['direction','desired_distance','min_distance']
00059 _slot_types = ['geometry_msgs/Vector3Stamped','float32','float32']
00060
00061 def __init__(self, *args, **kwds):
00062 """
00063 Constructor. Any message fields that are implicitly/explicitly
00064 set to None will be assigned a default value. The recommend
00065 use is keyword arguments as this is more robust to future message
00066 changes. You cannot mix in-order arguments and keyword arguments.
00067
00068 The available fields are:
00069 direction,desired_distance,min_distance
00070
00071 :param args: complete set of field values, in .msg order
00072 :param kwds: use keyword arguments corresponding to message field names
00073 to set specific fields.
00074 """
00075 if args or kwds:
00076 super(GripperTranslation, self).__init__(*args, **kwds)
00077
00078 if self.direction is None:
00079 self.direction = geometry_msgs.msg.Vector3Stamped()
00080 if self.desired_distance is None:
00081 self.desired_distance = 0.
00082 if self.min_distance is None:
00083 self.min_distance = 0.
00084 else:
00085 self.direction = geometry_msgs.msg.Vector3Stamped()
00086 self.desired_distance = 0.
00087 self.min_distance = 0.
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_3I.pack(_x.direction.header.seq, _x.direction.header.stamp.secs, _x.direction.header.stamp.nsecs))
00103 _x = self.direction.header.frame_id
00104 length = len(_x)
00105 if python3 or type(_x) == unicode:
00106 _x = _x.encode('utf-8')
00107 length = len(_x)
00108 buff.write(struct.pack('<I%ss'%length, length, _x))
00109 _x = self
00110 buff.write(_struct_3d2f.pack(_x.direction.vector.x, _x.direction.vector.y, _x.direction.vector.z, _x.desired_distance, _x.min_distance))
00111 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00112 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00113
00114 def deserialize(self, str):
00115 """
00116 unpack serialized message in str into this message instance
00117 :param str: byte array of serialized message, ``str``
00118 """
00119 try:
00120 if self.direction is None:
00121 self.direction = geometry_msgs.msg.Vector3Stamped()
00122 end = 0
00123 _x = self
00124 start = end
00125 end += 12
00126 (_x.direction.header.seq, _x.direction.header.stamp.secs, _x.direction.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00127 start = end
00128 end += 4
00129 (length,) = _struct_I.unpack(str[start:end])
00130 start = end
00131 end += length
00132 if python3:
00133 self.direction.header.frame_id = str[start:end].decode('utf-8')
00134 else:
00135 self.direction.header.frame_id = str[start:end]
00136 _x = self
00137 start = end
00138 end += 32
00139 (_x.direction.vector.x, _x.direction.vector.y, _x.direction.vector.z, _x.desired_distance, _x.min_distance,) = _struct_3d2f.unpack(str[start:end])
00140 return self
00141 except struct.error as e:
00142 raise genpy.DeserializationError(e)
00143
00144
00145 def serialize_numpy(self, buff, numpy):
00146 """
00147 serialize message with numpy array types into buffer
00148 :param buff: buffer, ``StringIO``
00149 :param numpy: numpy python module
00150 """
00151 try:
00152 _x = self
00153 buff.write(_struct_3I.pack(_x.direction.header.seq, _x.direction.header.stamp.secs, _x.direction.header.stamp.nsecs))
00154 _x = self.direction.header.frame_id
00155 length = len(_x)
00156 if python3 or type(_x) == unicode:
00157 _x = _x.encode('utf-8')
00158 length = len(_x)
00159 buff.write(struct.pack('<I%ss'%length, length, _x))
00160 _x = self
00161 buff.write(_struct_3d2f.pack(_x.direction.vector.x, _x.direction.vector.y, _x.direction.vector.z, _x.desired_distance, _x.min_distance))
00162 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00163 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00164
00165 def deserialize_numpy(self, str, numpy):
00166 """
00167 unpack serialized message in str into this message instance using numpy for array types
00168 :param str: byte array of serialized message, ``str``
00169 :param numpy: numpy python module
00170 """
00171 try:
00172 if self.direction is None:
00173 self.direction = geometry_msgs.msg.Vector3Stamped()
00174 end = 0
00175 _x = self
00176 start = end
00177 end += 12
00178 (_x.direction.header.seq, _x.direction.header.stamp.secs, _x.direction.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00179 start = end
00180 end += 4
00181 (length,) = _struct_I.unpack(str[start:end])
00182 start = end
00183 end += length
00184 if python3:
00185 self.direction.header.frame_id = str[start:end].decode('utf-8')
00186 else:
00187 self.direction.header.frame_id = str[start:end]
00188 _x = self
00189 start = end
00190 end += 32
00191 (_x.direction.vector.x, _x.direction.vector.y, _x.direction.vector.z, _x.desired_distance, _x.min_distance,) = _struct_3d2f.unpack(str[start:end])
00192 return self
00193 except struct.error as e:
00194 raise genpy.DeserializationError(e)
00195
00196 _struct_I = genpy.struct_I
00197 _struct_3I = struct.Struct("<3I")
00198 _struct_3d2f = struct.Struct("<3d2f")