$search
00001 """autogenerated by genmsg_py from SteeringCommand.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class SteeringCommand(roslib.message.Message): 00008 _md5sum = "0b28cba4463dbaf6e3e1eaa49cf68c4a" 00009 _type = "art_msgs/SteeringCommand" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """# ART steering controller command message 00012 00013 # $Id: SteeringCommand.msg 644 2010-09-28 03:19:07Z jack.oquin $ 00014 00015 # The maximum allowed steering angle is ArtVehicle::max_steer_degrees 00016 # (29 degrees) in either direction, defined in the art_msgs/ArtVehicle 00017 # message. 00018 00019 # The driver enforces this limit to protect the vehicle from 00020 # mechanical damage. There is about a two degree safety margin 00021 # included in that limit. 00022 00023 Header header 00024 00025 # request types 00026 uint32 Degrees = 0 # set absolute angle in degrees: +left, 0 center, -right 00027 uint32 Relative = 1 # change angle relative to current setting (degrees) 00028 00029 uint32 request # request type 00030 float32 angle # requested angle (degrees) 00031 00032 00033 00034 ================================================================================ 00035 MSG: std_msgs/Header 00036 # Standard metadata for higher-level stamped data types. 00037 # This is generally used to communicate timestamped data 00038 # in a particular coordinate frame. 00039 # 00040 # sequence ID: consecutively increasing ID 00041 uint32 seq 00042 #Two-integer timestamp that is expressed as: 00043 # * stamp.secs: seconds (stamp_secs) since epoch 00044 # * stamp.nsecs: nanoseconds since stamp_secs 00045 # time-handling sugar is provided by the client library 00046 time stamp 00047 #Frame this data is associated with 00048 # 0: no frame 00049 # 1: global frame 00050 string frame_id 00051 00052 """ 00053 # Pseudo-constants 00054 Degrees = 0 00055 Relative = 1 00056 00057 __slots__ = ['header','request','angle'] 00058 _slot_types = ['Header','uint32','float32'] 00059 00060 def __init__(self, *args, **kwds): 00061 """ 00062 Constructor. Any message fields that are implicitly/explicitly 00063 set to None will be assigned a default value. The recommend 00064 use is keyword arguments as this is more robust to future message 00065 changes. You cannot mix in-order arguments and keyword arguments. 00066 00067 The available fields are: 00068 header,request,angle 00069 00070 @param args: complete set of field values, in .msg order 00071 @param kwds: use keyword arguments corresponding to message field names 00072 to set specific fields. 00073 """ 00074 if args or kwds: 00075 super(SteeringCommand, self).__init__(*args, **kwds) 00076 #message fields cannot be None, assign default values for those that are 00077 if self.header is None: 00078 self.header = std_msgs.msg._Header.Header() 00079 if self.request is None: 00080 self.request = 0 00081 if self.angle is None: 00082 self.angle = 0. 00083 else: 00084 self.header = std_msgs.msg._Header.Header() 00085 self.request = 0 00086 self.angle = 0. 00087 00088 def _get_types(self): 00089 """ 00090 internal API method 00091 """ 00092 return self._slot_types 00093 00094 def serialize(self, buff): 00095 """ 00096 serialize message into buffer 00097 @param buff: buffer 00098 @type buff: StringIO 00099 """ 00100 try: 00101 _x = self 00102 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00103 _x = self.header.frame_id 00104 length = len(_x) 00105 buff.write(struct.pack('<I%ss'%length, length, _x)) 00106 _x = self 00107 buff.write(_struct_If.pack(_x.request, _x.angle)) 00108 except struct.error as se: self._check_types(se) 00109 except TypeError as te: self._check_types(te) 00110 00111 def deserialize(self, str): 00112 """ 00113 unpack serialized message in str into this message instance 00114 @param str: byte array of serialized message 00115 @type str: str 00116 """ 00117 try: 00118 if self.header is None: 00119 self.header = std_msgs.msg._Header.Header() 00120 end = 0 00121 _x = self 00122 start = end 00123 end += 12 00124 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00125 start = end 00126 end += 4 00127 (length,) = _struct_I.unpack(str[start:end]) 00128 start = end 00129 end += length 00130 self.header.frame_id = str[start:end] 00131 _x = self 00132 start = end 00133 end += 8 00134 (_x.request, _x.angle,) = _struct_If.unpack(str[start:end]) 00135 return self 00136 except struct.error as e: 00137 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00138 00139 00140 def serialize_numpy(self, buff, numpy): 00141 """ 00142 serialize message with numpy array types into buffer 00143 @param buff: buffer 00144 @type buff: StringIO 00145 @param numpy: numpy python module 00146 @type numpy module 00147 """ 00148 try: 00149 _x = self 00150 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00151 _x = self.header.frame_id 00152 length = len(_x) 00153 buff.write(struct.pack('<I%ss'%length, length, _x)) 00154 _x = self 00155 buff.write(_struct_If.pack(_x.request, _x.angle)) 00156 except struct.error as se: self._check_types(se) 00157 except TypeError as te: self._check_types(te) 00158 00159 def deserialize_numpy(self, str, numpy): 00160 """ 00161 unpack serialized message in str into this message instance using numpy for array types 00162 @param str: byte array of serialized message 00163 @type str: str 00164 @param numpy: numpy python module 00165 @type numpy: module 00166 """ 00167 try: 00168 if self.header is None: 00169 self.header = std_msgs.msg._Header.Header() 00170 end = 0 00171 _x = self 00172 start = end 00173 end += 12 00174 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00175 start = end 00176 end += 4 00177 (length,) = _struct_I.unpack(str[start:end]) 00178 start = end 00179 end += length 00180 self.header.frame_id = str[start:end] 00181 _x = self 00182 start = end 00183 end += 8 00184 (_x.request, _x.angle,) = _struct_If.unpack(str[start:end]) 00185 return self 00186 except struct.error as e: 00187 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00188 00189 _struct_I = roslib.message.struct_I 00190 _struct_3I = struct.Struct("<3I") 00191 _struct_If = struct.Struct("<If")