-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
core: more than one vehicle on one UDP port #497
Conversation
This adds support to command multiple drones that connect e.g. on the UDP port 14540.
Is it right that:
And why is it limited to UDP connections? |
We can, but we don't have to. You can also have multiple drones sending to the same UDP port but from different remote ports.
For now, yes. @bkueng was voting not to do that because it might cause problems (depending on how the autopilot handles it) but in theory messages with target system IDs should just fall off the autopilot if they don't match.
Right 🤔.
For TCP, as far as I know, you have to have one listen port per drone, so per connection. |
Right. But I mean we still receive all the heartbeats of all the drones, don't we? My concern is that this may not scale for a swarm (does it really work to receive the heartbeats from 50 drones, and send each message to all of them everytime?). So is this here to support only "a few drones" (like 3-5)? Because in this case, why not doing it at the higher level, using multiple instances of the SDK (which would work for TCP, too)? |
Maybe? 😄 yes, maybe we need to implement directing the messages and a configuration option to disable it.
The idea here was that you can provide one UDP port and the different drones don't need to know that they have each another SDK instance listening for them but they can all send their mavlink stuff to a default port and will be heard. |
The drones never know the implementation detail, do they? Be it one SDK instance or multiple ones. In the end, there is a discovery mechanism (the drones broadcast on 14540), and then there is a point-to-point connection between the GS and the drone (the GS is connected to ip:port pairs). In our case we kind of mix the discovery with the pairing, but both exist. I am saying that because I see two different applications:
And this is kind of in-between, isn't it? I mean, we can also merge that already and see later how it evolves. |
I guess that's true but there is no mechanism to move the port to somewhere else after the discovery.
If the 3 drones are in the same network and connect to the same port, the SDK could be handy. If you insist, we can throw the multi drone stuff out, I guess.
Not sure how it would scale to 1000. I know that mavlink system IDs run out at 255, so that's a limit anyway. |
I don't know how the connection works, you're right 😅. My point is that if I know (without discovery) that there is a drone on 192.168.1.44:14557, I should be able to connect to it, right? Without a need for 14540 anywhere. Maybe I'm wrong, and I need to study it in more detail, too.
Let's merge it for now. I guess my point is that at some point we should probably have a bigger discussion about those applications.
For "real" broadcast, we could imagine having a system were we don't set the system ID. E.g. GNSS satellites broadcast to the whole world, but don't know all the devices listening to them. And that kind of application is maybe not in the scope of the SDK, btw. But when we get feature requests for "swarm" control, I'm not always sure what the purpose is exactly. |
No! The drone connects to 14550 (or 14540), and the ground station listens. At least that's what the mavlink specs says.
I never know. Unless it's for the Intel show, I can see the purpose of that. |
The drone opens port 14556, and broadcasts on 14550. Or 14557 and 14540. But way you want to connect mavros to the drone and you don't receive the broadcast (or you tell mavros to listen on 14541 |
So you're saying MAVROS is not up to spec then. |
Not sure. If I remember correctly, when the broadcast did not work, I could connect mavros to the px4 (by giving the 14557 address to mavros) instead of connecting the px4 to mavros (i.e. by using the mavlink interface But maybe I'm just wrong. Let's forget it for now =). |
AFAIK the MAVLink spec says nothing about what ports connect to what. By convention, PX4 defines this set of standard ports. I believe ArduPilot use the same convention. Offboard APIs are expected to listen at 14540. The linked simulation page above shows the various relationships as confirmed by inspection and testing. It took a lot of work, and I am now fairly confident it is accurate. |
I'm referring to Lorenz's words then. And the port is also listed in https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers 😄 |
Hardly canonical - that just says Upshot, I'm always right :-) |
You should fix it ;) |
…e-on-udp-port core: more than one vehicle on one UDP port
This adds support to command multiple drones that connect e.g. on the UDP port 14540.