ouster.sdk.util.parsing module¶
R/W implementation of packet parsing.
Doesn’t rely on custom C++ extensions (just numpy). Provides writable view of packet data for testing and development.
- tohex(data)[source]¶
Makes a hex string for debug print outs of buffers.
Selects the biggest devisor of np.uint32, np.uint16 or np.uint8 for making a hex output of the provided data. (clunky but usefull for debugging)
- Return type:
str- Parameters:
data (bytes | bytearray | memoryview | ndarray)
- frame_to_packets(lf, info)[source]¶
Converts LidarFrame to a lidar_packet buffers
- Parameters:
lf (
LidarFrame) – LidarFrame; if LidarFrame has RAW_HEADERS field, packet headers are recreated to how they were in the original packetsinfo (
SensorInfo) – metadata of the lf frame
- Return type:
List[Union[LidarPacket,ZonePacket,ImuPacket]]- Returns:
A set of lidar packets that will produce the same LidarFrame if passed through the FrameBatcher again (less fields data)
- packets_to_frame(packets, info, *, fields=None)[source]¶
Batch buffers that belongs to a single frame into a LidarFrame object. :rtype:
LidarFrame- Parameters:
packets (List[LidarPacket | ZonePacket | ImuPacket])
info (SensorInfo)
fields (List[FieldType] | None)
- Return type:
- cut_raw32_words(lf)[source]¶
- Return type:
- Parameters:
lf (LidarFrame)