$search
00001 """autogenerated by genmsg_py from LaserTrajCmd.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import std_msgs.msg 00007 00008 class LaserTrajCmd(roslib.message.Message): 00009 _md5sum = "68a1665e9079049dce55a0384cb2e9b5" 00010 _type = "pr2_msgs/LaserTrajCmd" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """# This message is used to set the profile that the tilt laser controller 00013 # executes. 00014 Header header 00015 string profile # options are currently "linear" or "linear_blended" 00016 float64[] position # Laser positions 00017 duration[] time_from_start # Times to reach laser positions in seconds 00018 float64 max_velocity # Set <= 0 to use default 00019 float64 max_acceleration # Set <= 0 to use default 00020 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 """ 00040 __slots__ = ['header','profile','position','time_from_start','max_velocity','max_acceleration'] 00041 _slot_types = ['Header','string','float64[]','duration[]','float64','float64'] 00042 00043 def __init__(self, *args, **kwds): 00044 """ 00045 Constructor. Any message fields that are implicitly/explicitly 00046 set to None will be assigned a default value. The recommend 00047 use is keyword arguments as this is more robust to future message 00048 changes. You cannot mix in-order arguments and keyword arguments. 00049 00050 The available fields are: 00051 header,profile,position,time_from_start,max_velocity,max_acceleration 00052 00053 @param args: complete set of field values, in .msg order 00054 @param kwds: use keyword arguments corresponding to message field names 00055 to set specific fields. 00056 """ 00057 if args or kwds: 00058 super(LaserTrajCmd, self).__init__(*args, **kwds) 00059 #message fields cannot be None, assign default values for those that are 00060 if self.header is None: 00061 self.header = std_msgs.msg._Header.Header() 00062 if self.profile is None: 00063 self.profile = '' 00064 if self.position is None: 00065 self.position = [] 00066 if self.time_from_start is None: 00067 self.time_from_start = [] 00068 if self.max_velocity is None: 00069 self.max_velocity = 0. 00070 if self.max_acceleration is None: 00071 self.max_acceleration = 0. 00072 else: 00073 self.header = std_msgs.msg._Header.Header() 00074 self.profile = '' 00075 self.position = [] 00076 self.time_from_start = [] 00077 self.max_velocity = 0. 00078 self.max_acceleration = 0. 00079 00080 def _get_types(self): 00081 """ 00082 internal API method 00083 """ 00084 return self._slot_types 00085 00086 def serialize(self, buff): 00087 """ 00088 serialize message into buffer 00089 @param buff: buffer 00090 @type buff: StringIO 00091 """ 00092 try: 00093 _x = self 00094 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00095 _x = self.header.frame_id 00096 length = len(_x) 00097 buff.write(struct.pack('<I%ss'%length, length, _x)) 00098 _x = self.profile 00099 length = len(_x) 00100 buff.write(struct.pack('<I%ss'%length, length, _x)) 00101 length = len(self.position) 00102 buff.write(_struct_I.pack(length)) 00103 pattern = '<%sd'%length 00104 buff.write(struct.pack(pattern, *self.position)) 00105 length = len(self.time_from_start) 00106 buff.write(_struct_I.pack(length)) 00107 for val1 in self.time_from_start: 00108 _x = val1 00109 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00110 _x = self 00111 buff.write(_struct_2d.pack(_x.max_velocity, _x.max_acceleration)) 00112 except struct.error as se: self._check_types(se) 00113 except TypeError as te: self._check_types(te) 00114 00115 def deserialize(self, str): 00116 """ 00117 unpack serialized message in str into this message instance 00118 @param str: byte array of serialized message 00119 @type str: str 00120 """ 00121 try: 00122 if self.header is None: 00123 self.header = std_msgs.msg._Header.Header() 00124 end = 0 00125 _x = self 00126 start = end 00127 end += 12 00128 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00129 start = end 00130 end += 4 00131 (length,) = _struct_I.unpack(str[start:end]) 00132 start = end 00133 end += length 00134 self.header.frame_id = str[start:end] 00135 start = end 00136 end += 4 00137 (length,) = _struct_I.unpack(str[start:end]) 00138 start = end 00139 end += length 00140 self.profile = str[start:end] 00141 start = end 00142 end += 4 00143 (length,) = _struct_I.unpack(str[start:end]) 00144 pattern = '<%sd'%length 00145 start = end 00146 end += struct.calcsize(pattern) 00147 self.position = struct.unpack(pattern, str[start:end]) 00148 start = end 00149 end += 4 00150 (length,) = _struct_I.unpack(str[start:end]) 00151 self.time_from_start = [] 00152 for i in range(0, length): 00153 val1 = roslib.rostime.Duration() 00154 _x = val1 00155 start = end 00156 end += 8 00157 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00158 self.time_from_start.append(val1) 00159 _x = self 00160 start = end 00161 end += 16 00162 (_x.max_velocity, _x.max_acceleration,) = _struct_2d.unpack(str[start:end]) 00163 return self 00164 except struct.error as e: 00165 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00166 00167 00168 def serialize_numpy(self, buff, numpy): 00169 """ 00170 serialize message with numpy array types into buffer 00171 @param buff: buffer 00172 @type buff: StringIO 00173 @param numpy: numpy python module 00174 @type numpy module 00175 """ 00176 try: 00177 _x = self 00178 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00179 _x = self.header.frame_id 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 _x = self.profile 00183 length = len(_x) 00184 buff.write(struct.pack('<I%ss'%length, length, _x)) 00185 length = len(self.position) 00186 buff.write(_struct_I.pack(length)) 00187 pattern = '<%sd'%length 00188 buff.write(self.position.tostring()) 00189 length = len(self.time_from_start) 00190 buff.write(_struct_I.pack(length)) 00191 for val1 in self.time_from_start: 00192 _x = val1 00193 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00194 _x = self 00195 buff.write(_struct_2d.pack(_x.max_velocity, _x.max_acceleration)) 00196 except struct.error as se: self._check_types(se) 00197 except TypeError as te: self._check_types(te) 00198 00199 def deserialize_numpy(self, str, numpy): 00200 """ 00201 unpack serialized message in str into this message instance using numpy for array types 00202 @param str: byte array of serialized message 00203 @type str: str 00204 @param numpy: numpy python module 00205 @type numpy: module 00206 """ 00207 try: 00208 if self.header is None: 00209 self.header = std_msgs.msg._Header.Header() 00210 end = 0 00211 _x = self 00212 start = end 00213 end += 12 00214 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00215 start = end 00216 end += 4 00217 (length,) = _struct_I.unpack(str[start:end]) 00218 start = end 00219 end += length 00220 self.header.frame_id = str[start:end] 00221 start = end 00222 end += 4 00223 (length,) = _struct_I.unpack(str[start:end]) 00224 start = end 00225 end += length 00226 self.profile = str[start:end] 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 pattern = '<%sd'%length 00231 start = end 00232 end += struct.calcsize(pattern) 00233 self.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00234 start = end 00235 end += 4 00236 (length,) = _struct_I.unpack(str[start:end]) 00237 self.time_from_start = [] 00238 for i in range(0, length): 00239 val1 = roslib.rostime.Duration() 00240 _x = val1 00241 start = end 00242 end += 8 00243 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00244 self.time_from_start.append(val1) 00245 _x = self 00246 start = end 00247 end += 16 00248 (_x.max_velocity, _x.max_acceleration,) = _struct_2d.unpack(str[start:end]) 00249 return self 00250 except struct.error as e: 00251 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00252 00253 _struct_I = roslib.message.struct_I 00254 _struct_2d = struct.Struct("<2d") 00255 _struct_3I = struct.Struct("<3I") 00256 _struct_2i = struct.Struct("<2i")