Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12650 per packet instead of 12608 #7

Open
Crear12 opened this issue May 24, 2020 · 2 comments
Open

12650 per packet instead of 12608 #7

Crear12 opened this issue May 24, 2020 · 2 comments

Comments

@Crear12
Copy link

Crear12 commented May 24, 2020

3.4 Lidar Data Format
By default UDP data is forwarded to Port 7502. Lidar data packets consist of 16 azimuth blocks and are always 12608 Bytes in length. The packet rate is dependent on the output mode. Words are 32 bits in length and little endian.

However, I got confused that when I tried to unpack the packets from pacp files saved by Ouster Studio, every packet was 12650 instead of 12608.
with PcapReader(pcap_path) as pcap_reader:
for pkt in pcap_reader:
unpack(bytes(pkt))

struct.error: unpack requires a buffer of 12608 bytes

@rsiemens
Copy link
Owner

Hey thanks for writing in.

I'm not familiar with Ouster Studio, but It sounds like the data they are providing may be adding the IMU packet with the LIDAR packet. unpack only unpacks the LIDAR packet there is currently no support for the IMU packet (see related #8). Or they are wrapping the LIDAR packet in their own packet which adds some book keeping data for their software.

Might try just taking the last 12608 bytes out of the packet and seeing if that works.

@Crear12
Copy link
Author

Crear12 commented May 27, 2020

Hi thanks for your respond,
Actually, at first I thought that the first 42 might be header and directly used [-12608:]. But I am not sure whether it is correct. I tried simply judging it by the unpacked frame ID, but it looked strange.
'''
with PcapReader(pcap_path) as pcap_reader:
for pkt in pcap_reader:
for i in range(42):
print(i,GetFrameID(bytes(pkt)[i:12608+i]))

36 [317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317]
37 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
38 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
39 [36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704]
40 [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159]
41 [33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536, 33536]
'''
[40:12648] ([-12609:-1]) seems to be more appropriate rather than [41:12649] ([-12608:])

Now I'm working on drawing the 3D points to verify and will post the result ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants