Observable UDP Socket

Hi, I’ve been trying to make RPLidar UDP version (S2E I think) work. And I’m not very happy with way I have to deal with something I never tough exist an “UDP Socket” you can track progress here: GitHub - antokhio/VL.Devices.RPLidar at feat/udp-lidar

So I’m looking for something like:

socket.OnRecive =+ ???
OnRecive.Where(packet => myPacket)…

I’m using .net Socket, anyone seen any examples or lib that does that?

UDPServer (Reactive) returns an Observable which should be what you’re looking for here.

This was prolly the first node I checked on the way… Sadly for whatever reason it does not receive anything…

When I was playing with this on C#, I noticed that there are two ways to initialize socket, one with “Bind” for TCP/IP and another one with “Connect” if you would like to connect to socket (The lidar in this case is a Server). Seems connect is not exposed.

Also when I try ReciveFrom in c# I had to specify the EndPoint and it was kinda necessary, otherwise it did not receive anything… Seems like IO.Socket needs few buffs to make it usable in this case.

Guess back to study source, prolly need to patch it somewhere a bit…

are there any official specs regarding how to talk to the rplidar via udp? if you could share a link we’d not need to guess things here.

that seems to establish connection

that the PDF protocol https://download-en.slamtec.com/api/download/rplidar-s2e-protocol/1.0?lang=en

@joreg so the code from above works decently and lidar connection is stable and working, I guess I’ll do PR on corelib to add UDPSocketClient to avoid extra C# code in the lidar repo, and then I can PR the lidar stuff

The updates to RPLidar UDP would be on same branch GitHub - antokhio/VL.Devices.RPLidar at feat/udp-lidar

@joreg a reminder…

it’s on the list but I’m afraid will take a bit more to review due to slow summer time

1 Like

please see my answer in the PR.

independently: i’d anyway say that since VL.Devices.RPLidar’s underlying library includes the code for the serial connection, it should also contain the code for the udp connection.