Esempio n. 1
0
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   try:
     if self.time_stamp is None:
       self.time_stamp = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 29
     (_x.time_stamp.secs, _x.time_stamp.nsecs, _x.is_visible, _x.shift, _x.angle, _x.distance, _x.arrow_x, _x.arrow_y,) = _struct_2IB3f2i.unpack(str[start:end])
     self.is_visible = bool(self.is_visible)
     self.time_stamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 2
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   if python3:
     codecs.lookup_error("rosmsg").msg_type = self._type
   try:
     if self.header is None:
       self.header = std_msgs.msg.Header()
     if self.time_ref is None:
       self.time_ref = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 12
     (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     start = end
     end += length
     if python3:
       self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
     else:
       self.header.frame_id = str[start:end]
     _x = self
     start = end
     end += 8
     (_x.time_ref.secs, _x.time_ref.nsecs,) = _get_struct_2I().unpack(str[start:end])
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     start = end
     end += length
     if python3:
       self.source = str[start:end].decode('utf-8', 'rosmsg')
     else:
       self.source = str[start:end]
     self.time_ref.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 3
0
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.time_added is None:
             self.time_added = genpy.Time()
         end = 0
         start = end
         end += 1
         (self.ok, ) = _struct_B.unpack(str[start:end])
         self.ok = bool(self.ok)
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.reason = str[start:end].decode('utf-8')
         else:
             self.reason = str[start:end]
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.id = str[start:end].decode('utf-8')
         else:
             self.id = str[start:end]
         _x = self
         start = end
         end += 8
         (
             _x.time_added.secs,
             _x.time_added.nsecs,
         ) = _struct_2I.unpack(str[start:end])
         self.time_added.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 4
0
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.timestamp is None:
             self.timestamp = genpy.Time()
         end = 0
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.name = str[start:end].decode('utf-8')
         else:
             self.name = str[start:end]
         _x = self
         start = end
         end += 82
         (
             _x.timestamp.secs,
             _x.timestamp.nsecs,
             _x.position,
             _x.velocity,
             _x.measured_effort,
             _x.commanded_effort,
             _x.is_calibrated,
             _x.violated_limits,
             _x.odometer,
             _x.min_position,
             _x.max_position,
             _x.max_abs_velocity,
             _x.max_abs_effort,
         ) = _get_struct_2I4d2B5d().unpack(str[start:end])
         self.is_calibrated = bool(self.is_calibrated)
         self.violated_limits = bool(self.violated_limits)
         self.timestamp.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 5
0
 def deserialize(self, str):
     """
 unpack serialized message in str into this message instance
 :param str: byte array of serialized message, ``str``
 """
     try:
         if self.header is None:
             self.header = std_msgs.msg.Header()
         if self.time_utc is None:
             self.time_utc = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 12
         (
             _x.header.seq,
             _x.header.stamp.secs,
             _x.header.stamp.nsecs,
         ) = _get_struct_3I().unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.header.frame_id = str[start:end].decode('utf-8')
         else:
             self.header.frame_id = str[start:end]
         _x = self
         start = end
         end += 18
         (
             _x.id,
             _x.num_logs,
             _x.last_log_num,
             _x.time_utc.secs,
             _x.time_utc.nsecs,
             _x.size,
         ) = _get_struct_3H3I().unpack(str[start:end])
         self.time_utc.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 6
0
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   try:
     if self.stamp is None:
       self.stamp = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 9
     (_x.playing, _x.stamp.secs, _x.stamp.nsecs,) = _struct_B2I.unpack(str[start:end])
     self.playing = bool(self.playing)
     self.stamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 7
0
 def deserialize(self, str):
     """
 unpack serialized message in str into this message instance
 :param str: byte array of serialized message, ``str``
 """
     try:
         if self.header is None:
             self.header = std_msgs.msg.Header()
         if self.TimeOfIssue is None:
             self.TimeOfIssue = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 12
         (
             _x.header.seq,
             _x.header.stamp.secs,
             _x.header.stamp.nsecs,
         ) = _struct_3I.unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.header.frame_id = str[start:end].decode('utf-8')
         else:
             self.header.frame_id = str[start:end]
         _x = self
         start = end
         end += 24
         (
             _x.TimeOfIssue.secs,
             _x.TimeOfIssue.nsecs,
             _x.Index,
             _x.Theta,
             _x.X,
             _x.Y,
         ) = _struct_2Ii3f.unpack(str[start:end])
         self.TimeOfIssue.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 8
0
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   codecs.lookup_error("rosmsg").msg_type = self._type
   try:
     if self.GPStime is None:
       self.GPStime = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 76
     (_x.number, _x.messageid, _x.uavid, _x.plane_state, _x.plane_group, _x.longitudex, _x.latitudey, _x.altitudez, _x.heading, _x.velocity, _x.commandyaw, _x.GPStime.secs, _x.GPStime.nsecs, _x.parity,) = _get_struct_q4H6d2Ii().unpack(str[start:end])
     self.GPStime.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 9
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   try:
     if self.stamp is None:
       self.stamp = genpy.Time()
     if self.pose is None:
       self.pose = geometry_msgs.msg.Pose()
     end = 0
     _x = self
     start = end
     end += 84
     (_x.stamp.secs, _x.stamp.nsecs, _x.seq, _x.roomId, _x.numSpotsVisible, _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.magSpot0, _x.magSpot1,) = _get_struct_5I7d2I().unpack(str[start:end])
     self.stamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 10
0
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   codecs.lookup_error("rosmsg").msg_type = self._type
   try:
     if self.clock is None:
       self.clock = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 8
     (_x.clock.secs, _x.clock.nsecs,) = _get_struct_2I().unpack(str[start:end])
     self.clock.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 11
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   if python3:
     codecs.lookup_error("rosmsg").msg_type = self._type
   try:
     if self.request_time is None:
       self.request_time = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 16
     (_x.request_time.secs, _x.request_time.nsecs, _x.request_radius,) = _get_struct_2Id().unpack(str[start:end])
     self.request_time.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 12
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   try:
     if self.header is None:
       self.header = std_msgs.msg.Header()
     if self.TimeOfIssue is None:
       self.TimeOfIssue = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 12
     (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     start = end
     end += length
     if python3:
       self.header.frame_id = str[start:end].decode('utf-8')
     else:
       self.header.frame_id = str[start:end]
     _x = self
     start = end
     end += 8
     (_x.TimeOfIssue.secs, _x.TimeOfIssue.nsecs,) = _struct_2I.unpack(str[start:end])
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     pattern = '<%sf'%length
     start = end
     end += struct.calcsize(pattern)
     self.MagnetData = struct.unpack(pattern, str[start:end])
     _x = self
     start = end
     end += 37
     (_x.MagOffsetFromMiddle, _x.fit_variance, _x.gauss_k, _x.RMS_error, _x.Mileage, _x.frame_variance, _x.MagnetCounterDebug, _x.MagnetCounterTrigger, _x.PolarityCode, _x.MagnetPolarity,) = _struct_6fIbIi.unpack(str[start:end])
     self.TimeOfIssue.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 13
0
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.header is None:
             self.header = std_msgs.msg.Header()
         if self.headerstamp is None:
             self.headerstamp = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 12
         (
             _x.header.seq,
             _x.header.stamp.secs,
             _x.header.stamp.nsecs,
         ) = _get_struct_3I().unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.header.frame_id = str[start:end].decode('utf-8')
         else:
             self.header.frame_id = str[start:end]
         _x = self
         start = end
         end += 20
         (
             _x.headerstamp.secs,
             _x.headerstamp.nsecs,
             _x.cellA,
             _x.cellB,
             _x.cellC,
         ) = _get_struct_2I3f().unpack(str[start:end])
         self.headerstamp.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.timeout is None:
             self.timeout = genpy.Time()
         end = 0
         start = end
         end += 4
         (self.request_id, ) = _get_struct_I().unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         pattern = '<%sI' % length
         start = end
         end += struct.calcsize(pattern)
         self.start_ids = numpy.frombuffer(str[start:end],
                                           dtype=numpy.uint32,
                                           count=length)
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         pattern = '<%sI' % length
         start = end
         end += struct.calcsize(pattern)
         self.end_ids = numpy.frombuffer(str[start:end],
                                         dtype=numpy.uint32,
                                         count=length)
         _x = self
         start = end
         end += 8
         (
             _x.timeout.secs,
             _x.timeout.nsecs,
         ) = _get_struct_2I().unpack(str[start:end])
         self.timeout.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
 def deserialize(self, str):
     """
 unpack serialized message in str into this message instance
 :param str: byte array of serialized message, ``str``
 """
     codecs.lookup_error("rosmsg").msg_type = self._type
     try:
         if self.timeStamp is None:
             self.timeStamp = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 8
         (
             _x.timeStamp.secs,
             _x.timeStamp.nsecs,
         ) = _get_struct_2I().unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.joint_uri = str[start:end].decode('utf-8', 'rosmsg')
         else:
             self.joint_uri = str[start:end]
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.unit = str[start:end].decode('utf-8', 'rosmsg')
         else:
             self.unit = str[start:end]
         start = end
         end += 8
         (self.value, ) = _get_struct_d().unpack(str[start:end])
         self.timeStamp.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 16
0
 def deserialize(self, str):
     """
 unpack serialized message in str into this message instance
 :param str: byte array of serialized message, ``str``
 """
     try:
         if self.header is None:
             self.header = std_msgs.msg.Header()
         if self.gps_time_s is None:
             self.gps_time_s = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 12
         (
             _x.header.seq,
             _x.header.stamp.secs,
             _x.header.stamp.nsecs,
         ) = _struct_3I.unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.header.frame_id = str[start:end].decode('utf-8')
         else:
             self.header.frame_id = str[start:end]
         _x = self
         start = end
         end += 32
         (
             _x.gps_time_s.secs,
             _x.gps_time_s.nsecs,
             _x.latitude_deg,
             _x.longitude_deg,
             _x.altitude_m,
         ) = _struct_2I3d.unpack(str[start:end])
         self.gps_time_s.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   try:
     if self.pts is None:
       self.pts = None
     if self.start_time is None:
       self.start_time = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 16
     (_x.action, _x.order, _x.traj_id,) = _get_struct_Iiq().unpack(str[start:end])
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     pattern = '<%sd'%length
     start = end
     end += struct.calcsize(pattern)
     self.knots = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     self.pts = []
     for i in range(0, length):
       val1 = geometry_msgs.msg.Point()
       _x = val1
       start = end
       end += 24
       (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
       self.pts.append(val1)
     _x = self
     start = end
     end += 24
     (_x.start_time.secs, _x.start_time.nsecs, _x.time_extra, _x.replan_to_global_time,) = _get_struct_2I2d().unpack(str[start:end])
     self.start_time.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 18
0
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.timeStamp is None:
             self.timeStamp = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 8
         (
             _x.timeStamp.secs,
             _x.timeStamp.nsecs,
         ) = _get_struct_2I().unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.joint_uri = str[start:end].decode('utf-8')
         else:
             self.joint_uri = str[start:end]
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.unit = str[start:end].decode('utf-8')
         else:
             self.unit = str[start:end]
         start = end
         end += 8
         (self.value, ) = _get_struct_d().unpack(str[start:end])
         self.timeStamp.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.stamps is None:
             self.stamps = None
         end = 0
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         self.stamps = []
         for i in range(0, length):
             val1 = genpy.Time()
             _x = val1
             start = end
             end += 8
             (
                 _x.secs,
                 _x.nsecs,
             ) = _get_struct_2I().unpack(str[start:end])
             self.stamps.append(val1)
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         self.platforms = []
         for i in range(0, length):
             start = end
             end += 4
             (length, ) = _struct_I.unpack(str[start:end])
             start = end
             end += length
             if python3:
                 val1 = str[start:end].decode('utf-8')
             else:
                 val1 = str[start:end]
             self.platforms.append(val1)
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 20
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   try:
     if self.stamp is None:
       self.stamp = genpy.Time()
     if self.centroid is None:
       self.centroid = geometry_msgs.msg.Point()
     end = 0
     _x = self
     start = end
     end += 41
     (_x.completed, _x.num_rb, _x.avg_real_dist, _x.stamp.secs, _x.stamp.nsecs, _x.centroid.x, _x.centroid.y, _x.centroid.z,) = _get_struct_B2i2I3d().unpack(str[start:end])
     self.completed = bool(self.completed)
     self.stamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 21
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   try:
     if self.stamp is None:
       self.stamp = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 8
     (_x.stamp.secs, _x.stamp.nsecs,) = _get_struct_2I().unpack(str[start:end])
     start = end
     end += 1206
     self.data = str[start:end]
     self.stamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 22
0
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   try:
     if self.map_load_time is None:
       self.map_load_time = genpy.Time()
     if self.origin is None:
       self.origin = geometry_msgs.msg.Pose()
     end = 0
     _x = self
     start = end
     end += 106
     (_x.map_load_time.secs, _x.map_load_time.nsecs, _x.resolution_xy, _x.resolution_z, _x.min_elevation, _x.max_elevation, _x.zero_elevation, _x.width, _x.height, _x.origin.position.x, _x.origin.position.y, _x.origin.position.z, _x.origin.orientation.x, _x.origin.orientation.y, _x.origin.orientation.z, _x.origin.orientation.w,) = _get_struct_2I4dh2I7d().unpack(str[start:end])
     self.map_load_time.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 23
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   try:
     if self.t is None:
       self.t = genpy.Time()
     if self.d is None:
       self.d = genpy.Duration()
     end = 0
     _x = self
     start = end
     end += 16
     (_x.t.secs, _x.t.nsecs, _x.d.secs, _x.d.nsecs,) = _struct_2I2i.unpack(str[start:end])
     self.t.canon()
     self.d.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 24
0
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   codecs.lookup_error("rosmsg").msg_type = self._type
   try:
     if self.map_load_time is None:
       self.map_load_time = genpy.Time()
     if self.origin is None:
       self.origin = geometry_msgs.msg.Pose()
     end = 0
     _x = self
     start = end
     end += 76
     (_x.map_load_time.secs, _x.map_load_time.nsecs, _x.resolution, _x.width, _x.height, _x.origin.position.x, _x.origin.position.y, _x.origin.position.z, _x.origin.orientation.x, _x.origin.orientation.y, _x.origin.orientation.z, _x.origin.orientation.w,) = _get_struct_2If2I7d().unpack(str[start:end])
     self.map_load_time.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 25
0
 def deserialize(self, str):
     """
 unpack serialized message in str into this message instance
 :param str: byte array of serialized message, ``str``
 """
     try:
         if self.stamp is None:
             self.stamp = genpy.Time()
         end = 0
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.name = str[start:end].decode('utf-8')
         else:
             self.name = str[start:end]
         _x = self
         start = end
         end += 14
         (
             _x.sex,
             _x.age,
             _x.seq,
             _x.stamp.secs,
             _x.stamp.nsecs,
         ) = _get_struct_2B3I().unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.frame_id = str[start:end].decode('utf-8')
         else:
             self.frame_id = str[start:end]
         self.stamp.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
 def deserialize(self, str):
   """
   unpack serialized message in str into this message instance
   :param str: byte array of serialized message, ``str``
   """
   try:
     if self.stamp is None:
       self.stamp = genpy.Time()
     if self.state is None:
       self.state = auto_smart_factory.msg.TrayState()
     end = 0
     _x = self
     start = end
     end += 23
     (_x.stamp.secs, _x.stamp.nsecs, _x.state.id, _x.state.occupied, _x.state.available, _x.state.package.id, _x.state.package.type_id, _x.action,) = _get_struct_3I2B2IB().unpack(str[start:end])
     self.state.occupied = bool(self.state.occupied)
     self.state.available = bool(self.state.available)
     self.stamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e) #most likely buffer underfill
Esempio n. 27
0
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.clock is None:
             self.clock = genpy.Time()
         if self.period is None:
             self.period = genpy.Duration()
         end = 0
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         start = end
         end += length
         if python3:
             self.text = str[start:end].decode('utf-8')
         else:
             self.text = str[start:end]
         _x = self
         start = end
         end += 34
         (
             _x.flag,
             _x.symbol,
             _x.ratio,
             _x.clock.secs,
             _x.clock.nsecs,
             _x.period.secs,
             _x.period.nsecs,
             _x.para,
         ) = _get_struct_2Bd2I2iq().unpack(str[start:end])
         self.flag = bool(self.flag)
         self.clock.canon()
         self.period.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 28
0
 def deserialize_numpy(self, str, numpy):
     """
 unpack serialized message in str into this message instance using numpy for array types
 :param str: byte array of serialized message, ``str``
 :param numpy: numpy python module
 """
     try:
         if self.time is None:
             self.time = genpy.Time()
         end = 0
         _x = self
         start = end
         end += 12
         (
             _x.time.secs,
             _x.time.nsecs,
             _x.index,
         ) = _struct_2Ii.unpack(str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         pattern = '<%sd' % length
         start = end
         end += struct.calcsize(pattern)
         self.pos = numpy.frombuffer(str[start:end],
                                     dtype=numpy.float64,
                                     count=length)
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         pattern = '<%sf' % length
         start = end
         end += struct.calcsize(pattern)
         self.std = numpy.frombuffer(str[start:end],
                                     dtype=numpy.float32,
                                     count=length)
         self.time.canon()
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  #most likely buffer underfill
Esempio n. 29
0
 def deserialize_numpy(self, str, numpy):
   """
   unpack serialized message in str into this message instance using numpy for array types
   :param str: byte array of serialized message, ``str``
   :param numpy: numpy python module
   """
   codecs.lookup_error("rosmsg").msg_type = self._type
   try:
     if self.timestamp is None:
       self.timestamp = genpy.Time()
     end = 0
     _x = self
     start = end
     end += 8
     (_x.timestamp.secs, _x.timestamp.nsecs,) = _get_struct_2I().unpack(str[start:end])
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     start = end
     end += length
     if python3:
       self.event_type = str[start:end].decode('utf-8', 'rosmsg')
     else:
       self.event_type = str[start:end]
     start = end
     end += 4
     (length,) = _struct_I.unpack(str[start:end])
     start = end
     end += length
     if python3:
       self.robot_name = str[start:end].decode('utf-8', 'rosmsg')
     else:
       self.robot_name = str[start:end]
     start = end
     end += 4
     (self.event_id,) = _get_struct_i().unpack(str[start:end])
     self.timestamp.canon()
     return self
   except struct.error as e:
     raise genpy.DeserializationError(e)  # most likely buffer underfill
Esempio n. 30
0
 def deserialize(self, str):
     """
 unpack serialized message in str into this message instance
 :param str: byte array of serialized message, ``str``
 """
     try:
         if self.stamp is None:
             self.stamp = None
         end = 0
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         pattern = '<%sq' % length
         start = end
         end += struct.calcsize(pattern)
         self.destination_id = struct.unpack(pattern, str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         pattern = '<%sd' % length
         start = end
         end += struct.calcsize(pattern)
         self.distance = struct.unpack(pattern, str[start:end])
         start = end
         end += 4
         (length, ) = _struct_I.unpack(str[start:end])
         self.stamp = []
         for i in range(0, length):
             val1 = genpy.Time()
             _x = val1
             start = end
             end += 8
             (
                 _x.secs,
                 _x.nsecs,
             ) = _get_struct_2I().unpack(str[start:end])
             self.stamp.append(val1)
         return self
     except struct.error as e:
         raise genpy.DeserializationError(e)  # most likely buffer underfill