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