_PoseTwistStamped.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/PoseTwistStamped.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 PoseTwistStamped(genpy.Message):
00011   _md5sum = "a296da29623d3a182b44fee95e8415a4"
00012   _type = "nasa_r2_common_msgs/PoseTwistStamped"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 geometry_msgs/Pose pose
00016 geometry_msgs/Twist twist
00017 
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data 
00022 # in a particular coordinate frame.
00023 # 
00024 # sequence ID: consecutively increasing ID 
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035 
00036 ================================================================================
00037 MSG: geometry_msgs/Pose
00038 # A representation of pose in free space, composed of postion and orientation. 
00039 Point position
00040 Quaternion orientation
00041 
00042 ================================================================================
00043 MSG: geometry_msgs/Point
00044 # This contains the position of a point in free space
00045 float64 x
00046 float64 y
00047 float64 z
00048 
00049 ================================================================================
00050 MSG: geometry_msgs/Quaternion
00051 # This represents an orientation in free space in quaternion form.
00052 
00053 float64 x
00054 float64 y
00055 float64 z
00056 float64 w
00057 
00058 ================================================================================
00059 MSG: geometry_msgs/Twist
00060 # This expresses velocity in free space broken into its linear and angular parts.
00061 Vector3  linear
00062 Vector3  angular
00063 
00064 ================================================================================
00065 MSG: geometry_msgs/Vector3
00066 # This represents a vector in free space. 
00067 
00068 float64 x
00069 float64 y
00070 float64 z
00071 """
00072   __slots__ = ['header','pose','twist']
00073   _slot_types = ['std_msgs/Header','geometry_msgs/Pose','geometry_msgs/Twist']
00074 
00075   def __init__(self, *args, **kwds):
00076     """
00077     Constructor. Any message fields that are implicitly/explicitly
00078     set to None will be assigned a default value. The recommend
00079     use is keyword arguments as this is more robust to future message
00080     changes.  You cannot mix in-order arguments and keyword arguments.
00081 
00082     The available fields are:
00083        header,pose,twist
00084 
00085     :param args: complete set of field values, in .msg order
00086     :param kwds: use keyword arguments corresponding to message field names
00087     to set specific fields.
00088     """
00089     if args or kwds:
00090       super(PoseTwistStamped, self).__init__(*args, **kwds)
00091       #message fields cannot be None, assign default values for those that are
00092       if self.header is None:
00093         self.header = std_msgs.msg.Header()
00094       if self.pose is None:
00095         self.pose = geometry_msgs.msg.Pose()
00096       if self.twist is None:
00097         self.twist = geometry_msgs.msg.Twist()
00098     else:
00099       self.header = std_msgs.msg.Header()
00100       self.pose = geometry_msgs.msg.Pose()
00101       self.twist = geometry_msgs.msg.Twist()
00102 
00103   def _get_types(self):
00104     """
00105     internal API method
00106     """
00107     return self._slot_types
00108 
00109   def serialize(self, buff):
00110     """
00111     serialize message into buffer
00112     :param buff: buffer, ``StringIO``
00113     """
00114     try:
00115       _x = self
00116       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00117       _x = self.header.frame_id
00118       length = len(_x)
00119       if python3 or type(_x) == unicode:
00120         _x = _x.encode('utf-8')
00121         length = len(_x)
00122       buff.write(struct.pack('<I%ss'%length, length, _x))
00123       _x = self
00124       buff.write(_struct_13d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z))
00125     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00126     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00127 
00128   def deserialize(self, str):
00129     """
00130     unpack serialized message in str into this message instance
00131     :param str: byte array of serialized message, ``str``
00132     """
00133     try:
00134       if self.header is None:
00135         self.header = std_msgs.msg.Header()
00136       if self.pose is None:
00137         self.pose = geometry_msgs.msg.Pose()
00138       if self.twist is None:
00139         self.twist = geometry_msgs.msg.Twist()
00140       end = 0
00141       _x = self
00142       start = end
00143       end += 12
00144       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       start = end
00149       end += length
00150       if python3:
00151         self.header.frame_id = str[start:end].decode('utf-8')
00152       else:
00153         self.header.frame_id = str[start:end]
00154       _x = self
00155       start = end
00156       end += 104
00157       (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z,) = _struct_13d.unpack(str[start:end])
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 
00163   def serialize_numpy(self, buff, numpy):
00164     """
00165     serialize message with numpy array types into buffer
00166     :param buff: buffer, ``StringIO``
00167     :param numpy: numpy python module
00168     """
00169     try:
00170       _x = self
00171       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00172       _x = self.header.frame_id
00173       length = len(_x)
00174       if python3 or type(_x) == unicode:
00175         _x = _x.encode('utf-8')
00176         length = len(_x)
00177       buff.write(struct.pack('<I%ss'%length, length, _x))
00178       _x = self
00179       buff.write(_struct_13d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z))
00180     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00181     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00182 
00183   def deserialize_numpy(self, str, numpy):
00184     """
00185     unpack serialized message in str into this message instance using numpy for array types
00186     :param str: byte array of serialized message, ``str``
00187     :param numpy: numpy python module
00188     """
00189     try:
00190       if self.header is None:
00191         self.header = std_msgs.msg.Header()
00192       if self.pose is None:
00193         self.pose = geometry_msgs.msg.Pose()
00194       if self.twist is None:
00195         self.twist = geometry_msgs.msg.Twist()
00196       end = 0
00197       _x = self
00198       start = end
00199       end += 12
00200       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00201       start = end
00202       end += 4
00203       (length,) = _struct_I.unpack(str[start:end])
00204       start = end
00205       end += length
00206       if python3:
00207         self.header.frame_id = str[start:end].decode('utf-8')
00208       else:
00209         self.header.frame_id = str[start:end]
00210       _x = self
00211       start = end
00212       end += 104
00213       (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z,) = _struct_13d.unpack(str[start:end])
00214       return self
00215     except struct.error as e:
00216       raise genpy.DeserializationError(e) #most likely buffer underfill
00217 
00218 _struct_I = genpy.struct_I
00219 _struct_3I = struct.Struct("<3I")
00220 _struct_13d = struct.Struct("<13d")


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34