_TKHapticOutput.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tk_haptics_msgs/TKHapticOutput.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 TKHapticOutput(genpy.Message):
00011   _md5sum = "fede64762d5780ae42be213afff4bae8"
00012   _type = "tk_haptics_msgs/TKHapticOutput"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """#
00015 # Copyright 2011  Antonio Franchi and Martin Riedel    
00016 #
00017 # This file is part of TeleKyb.
00018 #
00019 # TeleKyb is free software: you can redistribute it and/or modify
00020 # it under the terms of the GNU General Public License as published by
00021 # the Free Software Foundation, either version 3 of the License, or
00022 # (at your option) any later version.
00023 #
00024 # TeleKyb is distributed in the hope that it will be useful,
00025 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027 # GNU General Public License for more details.
00028 #
00029 # You should have received a copy of the GNU General Public License
00030 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00031 
00032 Header header
00033 
00034 int64 primaryButton
00035 
00036 # Frequency (hz) (of the spin loop)
00037 float64 frequency
00038 
00039 # Position and Orientation
00040 geometry_msgs/Pose pose
00041 
00042 # Linear Velocity
00043 geometry_msgs/Vector3 linear
00044 
00045 # Forces and Torque
00046 geometry_msgs/Vector3 force
00047 
00048 
00049 
00050 
00051 ================================================================================
00052 MSG: std_msgs/Header
00053 # Standard metadata for higher-level stamped data types.
00054 # This is generally used to communicate timestamped data 
00055 # in a particular coordinate frame.
00056 # 
00057 # sequence ID: consecutively increasing ID 
00058 uint32 seq
00059 #Two-integer timestamp that is expressed as:
00060 # * stamp.secs: seconds (stamp_secs) since epoch
00061 # * stamp.nsecs: nanoseconds since stamp_secs
00062 # time-handling sugar is provided by the client library
00063 time stamp
00064 #Frame this data is associated with
00065 # 0: no frame
00066 # 1: global frame
00067 string frame_id
00068 
00069 ================================================================================
00070 MSG: geometry_msgs/Pose
00071 # A representation of pose in free space, composed of postion and orientation. 
00072 Point position
00073 Quaternion orientation
00074 
00075 ================================================================================
00076 MSG: geometry_msgs/Point
00077 # This contains the position of a point in free space
00078 float64 x
00079 float64 y
00080 float64 z
00081 
00082 ================================================================================
00083 MSG: geometry_msgs/Quaternion
00084 # This represents an orientation in free space in quaternion form.
00085 
00086 float64 x
00087 float64 y
00088 float64 z
00089 float64 w
00090 
00091 ================================================================================
00092 MSG: geometry_msgs/Vector3
00093 # This represents a vector in free space. 
00094 
00095 float64 x
00096 float64 y
00097 float64 z
00098 """
00099   __slots__ = ['header','primaryButton','frequency','pose','linear','force']
00100   _slot_types = ['std_msgs/Header','int64','float64','geometry_msgs/Pose','geometry_msgs/Vector3','geometry_msgs/Vector3']
00101 
00102   def __init__(self, *args, **kwds):
00103     """
00104     Constructor. Any message fields that are implicitly/explicitly
00105     set to None will be assigned a default value. The recommend
00106     use is keyword arguments as this is more robust to future message
00107     changes.  You cannot mix in-order arguments and keyword arguments.
00108 
00109     The available fields are:
00110        header,primaryButton,frequency,pose,linear,force
00111 
00112     :param args: complete set of field values, in .msg order
00113     :param kwds: use keyword arguments corresponding to message field names
00114     to set specific fields.
00115     """
00116     if args or kwds:
00117       super(TKHapticOutput, self).__init__(*args, **kwds)
00118       #message fields cannot be None, assign default values for those that are
00119       if self.header is None:
00120         self.header = std_msgs.msg.Header()
00121       if self.primaryButton is None:
00122         self.primaryButton = 0
00123       if self.frequency is None:
00124         self.frequency = 0.
00125       if self.pose is None:
00126         self.pose = geometry_msgs.msg.Pose()
00127       if self.linear is None:
00128         self.linear = geometry_msgs.msg.Vector3()
00129       if self.force is None:
00130         self.force = geometry_msgs.msg.Vector3()
00131     else:
00132       self.header = std_msgs.msg.Header()
00133       self.primaryButton = 0
00134       self.frequency = 0.
00135       self.pose = geometry_msgs.msg.Pose()
00136       self.linear = geometry_msgs.msg.Vector3()
00137       self.force = geometry_msgs.msg.Vector3()
00138 
00139   def _get_types(self):
00140     """
00141     internal API method
00142     """
00143     return self._slot_types
00144 
00145   def serialize(self, buff):
00146     """
00147     serialize message into buffer
00148     :param buff: buffer, ``StringIO``
00149     """
00150     try:
00151       _x = self
00152       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00153       _x = self.header.frame_id
00154       length = len(_x)
00155       if python3 or type(_x) == unicode:
00156         _x = _x.encode('utf-8')
00157         length = len(_x)
00158       buff.write(struct.pack('<I%ss'%length, length, _x))
00159       _x = self
00160       buff.write(_struct_q14d.pack(_x.primaryButton, _x.frequency, _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.linear.x, _x.linear.y, _x.linear.z, _x.force.x, _x.force.y, _x.force.z))
00161     except struct.error as se: self._check_types(se)
00162     except TypeError as te: self._check_types(te)
00163 
00164   def deserialize(self, str):
00165     """
00166     unpack serialized message in str into this message instance
00167     :param str: byte array of serialized message, ``str``
00168     """
00169     try:
00170       if self.header is None:
00171         self.header = std_msgs.msg.Header()
00172       if self.pose is None:
00173         self.pose = geometry_msgs.msg.Pose()
00174       if self.linear is None:
00175         self.linear = geometry_msgs.msg.Vector3()
00176       if self.force is None:
00177         self.force = geometry_msgs.msg.Vector3()
00178       end = 0
00179       _x = self
00180       start = end
00181       end += 12
00182       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       start = end
00187       end += length
00188       if python3:
00189         self.header.frame_id = str[start:end].decode('utf-8')
00190       else:
00191         self.header.frame_id = str[start:end]
00192       _x = self
00193       start = end
00194       end += 120
00195       (_x.primaryButton, _x.frequency, _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.linear.x, _x.linear.y, _x.linear.z, _x.force.x, _x.force.y, _x.force.z,) = _struct_q14d.unpack(str[start:end])
00196       return self
00197     except struct.error as e:
00198       raise genpy.DeserializationError(e) #most likely buffer underfill
00199 
00200 
00201   def serialize_numpy(self, buff, numpy):
00202     """
00203     serialize message with numpy array types into buffer
00204     :param buff: buffer, ``StringIO``
00205     :param numpy: numpy python module
00206     """
00207     try:
00208       _x = self
00209       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00210       _x = self.header.frame_id
00211       length = len(_x)
00212       if python3 or type(_x) == unicode:
00213         _x = _x.encode('utf-8')
00214         length = len(_x)
00215       buff.write(struct.pack('<I%ss'%length, length, _x))
00216       _x = self
00217       buff.write(_struct_q14d.pack(_x.primaryButton, _x.frequency, _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.linear.x, _x.linear.y, _x.linear.z, _x.force.x, _x.force.y, _x.force.z))
00218     except struct.error as se: self._check_types(se)
00219     except TypeError as te: self._check_types(te)
00220 
00221   def deserialize_numpy(self, str, numpy):
00222     """
00223     unpack serialized message in str into this message instance using numpy for array types
00224     :param str: byte array of serialized message, ``str``
00225     :param numpy: numpy python module
00226     """
00227     try:
00228       if self.header is None:
00229         self.header = std_msgs.msg.Header()
00230       if self.pose is None:
00231         self.pose = geometry_msgs.msg.Pose()
00232       if self.linear is None:
00233         self.linear = geometry_msgs.msg.Vector3()
00234       if self.force is None:
00235         self.force = geometry_msgs.msg.Vector3()
00236       end = 0
00237       _x = self
00238       start = end
00239       end += 12
00240       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00241       start = end
00242       end += 4
00243       (length,) = _struct_I.unpack(str[start:end])
00244       start = end
00245       end += length
00246       if python3:
00247         self.header.frame_id = str[start:end].decode('utf-8')
00248       else:
00249         self.header.frame_id = str[start:end]
00250       _x = self
00251       start = end
00252       end += 120
00253       (_x.primaryButton, _x.frequency, _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.linear.x, _x.linear.y, _x.linear.z, _x.force.x, _x.force.y, _x.force.z,) = _struct_q14d.unpack(str[start:end])
00254       return self
00255     except struct.error as e:
00256       raise genpy.DeserializationError(e) #most likely buffer underfill
00257 
00258 _struct_I = genpy.struct_I
00259 _struct_3I = struct.Struct("<3I")
00260 _struct_q14d = struct.Struct("<q14d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


tk_haptics_msgs
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:13:52