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