Repository navigation
Implements target_system lookup. Implements better target semantics. - #461
Conversation
|
Another proposal is that |
|
My first reaction (second to follow)
UPshot,
|
|
@tcr3dr Second thoughts ...
As an aside, the two reasons I wanted UDP was to be able to use the loopback address (simplify instructions) and to have consistency with main instructions on old SITL. I did test tcp connection to sitl via loopback at one point and it failed. However it seems to work now, so I'm thinking perhaps just using tcp is fine for the examples. Are there other reasons why we might want UDP? W.r.t the example, did you mean? |
|
@hamishwillee Using SITL with TCP means for more connection overhead we gain predictability. I'm inclined to want this in most examples; for real-world testing, UDP is more practical, but so are a number of other simulation variables (wind speed, battery depletion, real physics, etc.) Since examples are meant to be short and understandable, I prefer TCP.
We would! I'd want to be able to test this before adding it in, though, so I can say post-2.0.0 we should get back to it.
If you want two vehicle objects, you should connect to the same master. This particular scenario is for if you want to create i.e. udpout connections. Right now we have the scaffolding in place that will allow that down the line.
Yup. Right now I have a DK script that forwards to udpout:127.0.0.1:14550 for the Solo app in emulation. Works well!
Let's just document the source_system param, not the rest of this. You can still connect multiple vehicles to the same source address, which was necessary. |
|
Hi @tcr3dr That all makes sense - and agree. I will assume you'll create a tracking issue on watching for system id changes. Can you merge #461 first and then merge this on top of it? I can update the docs fairly easily after that (and more easily) than starting fresh. If that is too hard, I'll take a shot at merging fresh - just confirm which is best. Cheers |
|
Done. |
|
@tcr3dr Docs updated now. Please check the statements just on the connect() method for heartbeat_timeout and source_system. Mostly I want to check that |
|
This looks good! |
Implements target_system lookup. Implements better target semantics.
Exposing a
target_systemonconnect()is probably not what we want. Exposingsource_systemmight be, though.This does a bit of an overhaul over the MAVLink object in the backend to make sure we get this right. The
target_systemis loaded from the first heartbeat we get and fixed after that point. We also have some backend classes which we might expose eventually, but for now demonstrate the use of multiple target systems in one program. e.g.In one window,
in the next, and
Works to daisy chain a connection through DroneKit. This is obviously using undocumented features (MAVConnection directly) but demonstrates the logic should work if we expose it publicly later.