mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.33k stars 3.64k forks source link

Display bounces around with mult-vehicle connection #12094

Closed JustThinkInC closed 1 week ago

JustThinkInC commented 1 week ago

Expected Behavior

Vehicles should be displayed normally. Selected vehicle should be a darker red. The image below (from this video) is an example of working a multi-vehicle display: image

Current Behavior

Rather than two vehicle icons, 1 icon that just bounces around all over the place. .gif below for reference.

Steps to Reproduce:

Please provide an unambiguous set of steps to reproduce the current behavior

  1. Start SITL (in my case using ardupilot/arducopter + MAVProxy)
  2. Create connection in QGC to each SITL instance (using TCP in my case)
  3. Connect
  4. Connection to each will succeed but icon will bounce between vehicles.

System Information

When posting bug reports, include the following information

Log Files and Screenshots

2024-11-15 02-00-43

PS: there is another issue https://github.com/mavlink/qgroundcontrol/issues/10279 from 2022 that sounds like this but no one has responded to it.

DonLakeFlyer commented 1 week ago

This happens when you have multiple vehicles with the same mavlink id. Give each vehicle a unique id.

DonLakeFlyer commented 1 week ago

Reopen issue if it still happens with correct unique ids.

JustThinkInC commented 1 week ago

Thanks @DonLakeFlyer but this still happens after giving each a vehicle unique ID using the SYSID_THISMAV (per the docs) but still have the issue. Screenshot confirming each vehicle has a different ID:

image

If it's of any relevance. Mission Planner (without changing ID) didn't have an issue, I understand it's a different program not maintained by the QGC team but just in case it helps 🙂

JustThinkInC commented 1 week ago

Upon investigating further it seems this is actually an issue with SITL (or the way I'm instantiating the instances). While the screenshot above shows instances having separate IDs, when I added a debug line in QGC to print out the vehicle id on connection, the IDs were the same. However, running with the swarm configuration of SITL resolves this. I am not sure why the first method of manually spawning different instances and setting the parameter manually didn't work. Leaving this comment in case someone else runs into this.

Edit: set parameter, save then restart the SITL instance and it should work. I wasn't restarting the instance, merely assumed that connecting after writing the param was sufficient. I used the MAVProxy GUI to edit and save the params. Hope this helps anyone else who runs into this.

DonLakeFlyer commented 1 week ago

I vaguely remember with ArduPilot SITL needing to start up the instances manually from the command line. Not using the normal python script. And specifying the individual vehicle ids on the command line.