I’m certain the system ID’s are distinct. One vehicle is of ID 10 the other has 11. The messages definitely have the same component IDs though. No easy way to fix that :/. Though, in theory, shouldn’t that not matter so long as the fully-qualified (SYSID + Component ID combo) addresses are distinct? If it’s worth anything, I’m testing this on my simulation cluster, so it’s the SITL autopilot. I don’t think that should change anything.
The reason I went with MAVLink Router as opposed to MAVLink Server is that Router comes with an option for message filtering by message and source ID. I don’t want to saturate my wireless connection to the boat with a bunch of IMU messages!
I’ve found (after posting of course) that this extension does not entirely work as expected. While it prevents the system IDs from getting swapped, each Autopilot treats the messages sent by the other (including ATTITUDE and GLOBAL_POSITION_INT) as its own in the EKF. This–of course–causes each vehicle’s EKF to totally destabilize.
The messages are routed cleanly and show up under their own system IDs. Here’s MAVLink2Rest on the Pi simulating a ROV. The simulated ROV has an ID of 11, and the simulated boat (running my extension) has a simulated ID of 10.
Looking at the MAVLink Inspector graphs for the ATTITUDE topic, it seems like the individual streams are not conflated at the MAVLink level. The steam from systems 10 and 11 show different, unmixed data. The Autopilot is just eating both of them for some reason.
While writing this response, I think I’ve figured out what’s going on and I’m not thrilled about it. Referencing the Ardupilot documentation, specifically [the detailed theory of MAVLink routing]( MAVLink Routing in ArduPilot — Dev documentation ) we see the following:
The ATTITUDE and GLOBAL_POSITION_INT messages lack a target_system field, so Ardupilot eats them without regard to their origin. The ArduRover firmware has a SYSID_ENFORCE parameter which sounded really promising, but it unfortunately does not appear to work. Looking at the source, I cannot figure out why. Regardless, this option is not present at all in ArduSub.
I’d really love to keep MAVLink data routed over MAVLink with out any contrivances or repackaging, but that seems to be rather difficult under these circumstances. Maybe I can use custom message types, but those are a chore and a half in my experience. I might just have to write a little script to spit the GPS and attitude data over UDP.
Update: I think GLOBAL_POSITION_INT is harmless? It contains enough information to get my job done. Once I stopped forwarding ATTITUDE messages the situation seemingly resolved.