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


iri_segway_rmp_msgs
Author(s):
autogenerated on Fri Dec 6 2013 20:36:59