Hesai Lidar Connection error

Hi there,

I’m writing customize dw driver for Hesai Lidar to work with sample_lidar_replay. By passing

./sample_lidar_replay --protocol=lidar.socket --params=protocol=udp,device=CUSTOM,ip=192.168.0.203,port=2369,decoder=libsample_lidar_plugin.so,scan-frequency=10

, it said

[08-10-2019 20:57:19] Driveworks exception thrown: DW_SAL_CANNOT_INITIALIZE: LidarSocket::checkDeviceData, 192.168.0.203:2369 has no data

. However, I’ve pretty sure that either the ip address and port is exactly match with Hesai Config. By passing

sudo tcpdump -i enp4s0 -n host 192.168.0.203 and port 2369

, I would get

21:56:20.526614 IP 192.168.0.203.10000 > 192.168.0.25.2369: UDP, length 1262

Therefore I’m confused why dwSAL_createSensor(&m_lidarSensor, params, m_sal) would throw error?

Thanks

Hi j5207,

Could you share ifconfig -a Output.
For lidar, is it possible to change ip address and port number for verification?

Dear j5207,
Did you check our webinar on using customer sensors with DW at [url]https://info.nvidia.com/using-custom-sensors-with-driveworks.html?ondemandrgt=yes[/url].

Hi,

Thanks for repsonse. Yes, I did attend the above webinar. However, the sample lidar plugin code doesn’t cover much details.
Here’s the output of ifconfig:

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:106 

can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING NOARP  MTU:16  Metric:1
          RX packets:4 errors:1 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:1 overruns:0 carrier:1
          collisions:0 txqueuelen:10 
          RX bytes:32 (32.0 B)  TX bytes:0 (0.0 B)
          Interrupt:107 

enP4p1s0  Link encap:Ethernet  HWaddr 00:04:4b:cb:cc:2c  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

enp4s0    Link encap:Ethernet  HWaddr 00:04:4b:cb:cc:2a  
          inet addr:192.168.0.25  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::204:4bff:fecb:cc2a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:224567823 errors:0 dropped:0 overruns:0 frame:0
          TX packets:102986 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:293599002460 (293.5 GB)  TX bytes:43420836 (43.4 MB)

eth0      Link encap:Ethernet  HWaddr 00:04:4b:cb:cc:27  
          inet addr:10.162.110.24  Bcast:10.162.111.255  Mask:255.255.254.0
          inet6 addr: fe80::204:4bff:fecb:cc27/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4164412 errors:0 dropped:120 overruns:0 frame:0
          TX packets:5812118 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:433278706 (433.2 MB)  TX bytes:491790051 (491.7 MB)
          Interrupt:82 

eth0:400  Link encap:Ethernet  HWaddr 00:04:4b:cb:cc:27  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:82 

eth0:900  Link encap:Ethernet  HWaddr 00:04:4b:cb:cc:27  
          inet addr:10.1.0.81  Bcast:10.1.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:82 

eth0.200  Link encap:Ethernet  HWaddr 00:04:4b:cb:cc:27  
          inet addr:10.42.0.28  Bcast:10.42.0.255  Mask:255.255.255.0
          inet6 addr: fe80::204:4bff:fecb:cc27/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:134905 errors:0 dropped:0 overruns:0 frame:0
          TX packets:125356 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6399974 (6.3 MB)  TX bytes:10556655 (10.5 MB)

hv0       Link encap:Ethernet  HWaddr 0a:86:4c:f8:e8:00  
          inet addr:192.168.10.4  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::886:4cff:fef8:e800/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1094 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:292 (292.0 B)  TX bytes:164386 (164.3 KB)
          Interrupt:11 

hv1       Link encap:Ethernet  HWaddr 0a:86:4c:f8:e9:00  
          inet addr:192.168.12.4  Bcast:192.168.12.255  Mask:255.255.255.0
          inet6 addr: fe80::886:4cff:fef8:e900/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1090 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:292 (292.0 B)  TX bytes:164137 (164.1 KB)
          Interrupt:12 

ip6gre0   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:1448  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ip6tnl0   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:1452  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:853 errors:0 dropped:0 overruns:0 frame:0
          TX packets:853 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:74685 (74.6 KB)  TX bytes:74685 (74.6 KB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I think the hesai lidar is using the enp4s0 interface. I also tried different sensor ip and port number, but I don’t think that is the problem. Previously I tested with Velodyne lidar, which works properly. I not sure why in Hesai does not work. I also tried to verify with wireshark, and I could see the UDP packets are transporting properly. Therefore, I’m confused why dwSAL_createSensor(&m_lidarSensor, params, m_sal) would throw error.

Thanks!

Dear J5207,

I think the enp4s0 interface you’re using is 10G ethernet port for external ethernet connection.
Please refer to Ethernet Network Topology in AV Configuration.
[url]DRIVE OS Linux

Could you please connect the lidar to DriveAGX J12 or J14 and re-try it? Thanks.

Hi,

Thanks for your response. Apologize for neglect the above info and I’ve changed my ethernet connection from external to J14. However, sadly, this doesn’t make any change. The output of

sudo tcpdump -i eth0:400

have output

17:43:29.163230 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.163243 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 529688, win 4186, options [nop,nop,TS val 3241014381 ecr 166374660], length 0
17:43:29.163308 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 530344:530804, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014381], length 460
17:43:29.163410 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 530804:530992, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014381], length 188
17:43:29.163472 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 530992:531204, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014381], length 212
17:43:29.163481 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.163496 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 530344, win 4186, options [nop,nop,TS val 3241014381 ecr 166374661], length 0
17:43:29.163674 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 530992, win 4186, options [nop,nop,TS val 3241014382 ecr 166374661], length 0
17:43:29.163695 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.163700 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 531204:531664, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014382], length 460
17:43:29.163803 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 531664:531852, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014382], length 188
17:43:29.164006 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 531664, win 4186, options [nop,nop,TS val 3241014382 ecr 166374661], length 0
17:43:29.164024 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.165605 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 531852:532120, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014382], length 268
17:43:29.165704 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 532120:532732, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014382], length 612
17:43:29.165729 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.165902 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 532120, win 4186, options [nop,nop,TS val 3241014384 ecr 166374661], length 0
17:43:29.165919 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.166180 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 532732:532936, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014384], length 204
17:43:29.166282 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.166297 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 532936:533148, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014384], length 212
17:43:29.166392 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 533148:533264, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014384], length 116
17:43:29.166460 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 533264:533532, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014384], length 268
17:43:29.166476 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 532936, win 4186, options [nop,nop,TS val 3241014384 ecr 166374661], length 0
17:43:29.166490 IP 192.168.1.203.10000 > 192.168.0.25.2369: UDP, length 1262
17:43:29.166569 IP 10.162.110.24.ssh > 10.162.110.21.52604: Flags [P.], seq 533532:533992, ack 109, win 331, options [nop,nop,TS val 166374661 ecr 3241014384], length 460
17:43:29.166596 IP 10.162.110.21.52604 > 10.162.110.24.ssh: Flags <li>, ack 533264, win 4186, options [nop,nop,TS val 3241014384 ecr 166374661], length 0

and when I run

./sample_lidar_replay --protocol=lidar.socket --params=protocol=udp,device=CUSTOM,ip=192.168.1.203,port=2369,decoder=libsample_lidar_plugin.so,scan-frequency=10

I still have

[11-10-2019 17:44:23] Driveworks exception thrown: DW_SAL_CANNOT_INITIALIZE: LidarSocket::checkDeviceData, 192.168.1.203:2369 has no data

Since we only have one E3579 Adaptor, one of the ethernet port is connecting to Hesai Lidar and another one is connecting to the internet. Not sure if this could cause some problem.

Thanks

Dear j5207,

Could you please unplug ethernet port and try to run the sample to see if the ethernet port is the problem? Thanks.

Hi SteveHV,

Seems the ethernet port is working properly. Is it possible to inform us more details about how dw initialize connection for the sensor? Why even though I could ping the sensor, still the initialization failed?

Thanks

Dear j5207,

Sorry for confusing you.
What I’m saying is that removed the internet connection and asked for a test.
BTW, according to the log, there are two IP and port 192.168.1.203.10000, 192.168.0.25.2369.
It seems that the test sample command has different port number ip=192.168.1.203,port=2369.
If the lidar is connected to 192.168.0.25.2369, could you change the IP/Port option and re-test it?

Hi,

Thanks for your suggestion. I’ve unplug the internet connection and this does not make a different. Right now I’ve changed the lidar destination ip to 192.168.1.200 which exactly match the ip address of eth0:400, and destination port as 2369. And I tried with bot 192.168.1.200/2369, 192.168.1.200/10000, 192.168.1.203/2369, 192.168.1.203/10000, none of these would work.

I verified with wireshark that 192.168.1.203:10000 is transmitting data successully to 192.168.1.200:2369

Dear j5207,

Can you please file a bug for this topic?
Please share bug ID, we will look into this issue.
Please login to https://developer.nvidia.com/drive with your credentials. Please check MyAccount->MyBugs->Submit a new bug to file bug. Thanks.

Bug# 2748925

Dear j5207

The lidar is sending its raw data on port 10000, but the interface that receives those packets is listening on port 2369.
It would be best to steup an explicit network interface for the lidar by doing the following:

1. Setup network interface explicitly for the lidar. recording to your tcp dump the lidar broadcasts udp messages to 192.168.0.25 => sudo ifconfig eth0:150 192.168.0.25
2. Check with wireshark if the UDP packets are coming in on eth0
3. Check with the sample application if the initialization goes through now 
   => ./sample_lidar_replay --protocol=lidar.socket --params=device=CUSTOM,ip=192.168.1.203,port=10000,protocol=udp,decoder=libsample_lidar_plugin.so,scan-frequency=10