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


tulip_gazebo
Author(s): Tim Assman, Pieter van Zutven
autogenerated on Sun Jan 26 2014 21:00:10