QGroundControl 5.1.5 – Multi-vehicle waypoint handling and flight path visualization

Hi everyone,

I’m running a simulation with 10 PX4 SITL drones using QGroundControl 5.1.5 on Ubuntu. Each drone receives flight plans through a Python MAVSDK bridge using MQTT, and all drones are successfully receiving and executing their missions.

I have two questions:

1. Waypoint handling

When I try to remove all waypoints from a mission in QGroundControl, the waypoints from the previous mission seem to remain visible. How can I completely clear all waypoints and ensure that no waypoints from a previous or current mission are retained or displayed?

2. Simultaneous flight path visualization

In Fly View, I can see all the drone icons on the map, but only the currently selected (active) drone appears with full opacity, and its flight path is visible. The other drone icons appear faded, and I don’t see their flight trails. When I select a different drone, its icon becomes fully visible and its path appears.

Is this the expected behavior in QGroundControl 5.1.5? Does QGC natively support displaying the historical flight paths of multiple vehicles simultaneously, or would this require a code modification?

If code changes are needed, could you point me to the relevant component or source file responsible for rendering vehicle flight trails?

Thanks in advance for your help!

Interesting setup — 10 PX4 SITL vehicles with MQTT/MAVSDK mission delivery is a useful case for separating mission state from QGC visualization state.

For the waypoint issue, I would first distinguish four things:

  1. The locally edited plan in QGC.

  2. The mission actually stored on the PX4 vehicle.

  3. Any mission being re-uploaded by the MQTT/MAVSDK bridge.

  4. The mission currently displayed by QGC.

As a controlled test, I would isolate one SITL vehicle, temporarily stop mission uploads from the bridge, issue a mission clear operation, verify the MAVLink MISSION_ACK, and then request the mission list again.

If PX4 reports an empty mission but QGC still displays the old waypoints, that points toward a QGC-side display/state issue. If the mission reappears on PX4, I would investigate the bridge or another mission uploader.

For the flight trails, I would separate active-vehicle highlighting from actual trail-data availability.

A useful check would be whether the trail for an inactive vehicle is still being accumulated but hidden, or whether trail updates/rendering are bound to the currently active vehicle.

That distinction determines whether the solution is a QML visibility change or a deeper multi-vehicle trail-management change.

Could you clarify whether you need all 10 historical trajectories visible simultaneously in Fly View, including inactive vehicles, or only the current mission paths?

Also, does the waypoint issue occur with the MQTT/MAVSDK bridge disabled?

Those two answers would help narrow down the correct QGC component before recommending a

Thank you for the detailed and insightful response! I really appreciate your structured approach to isolating these QGC behaviors.

To address your questions and provide clarity on our exact setup and requirements:

1. Regarding the Waypoint / Mission Issue:

Even when the MQTT/MAVSDK bridge is completely disabled and I simply restart QGroundControl and PX4 SITL, the waypoints from the previous session/flight still reappear on the map. It seems QGC is automatically fetching stale mission data either from PX4’s persistent memory state or loading it from its local parameter/mission cache upon connection.

2. Regarding Telemetry Trails & Multi-Vehicle Visualization:

To clarify our goal: Yes, I need all 10 historical trajectories (telemetry trails) to be rendered simultaneously in real time in Fly View, regardless of which vehicle is currently selected as the “Active Vehicle”.

In our architecture, a high-level mission is partitioned among a fleet of 10 autonomous drones. All 10 drones operate with equal priority- there is no single “primary” drone. Currently, as all 10 drones navigate their paths, they all move visually on the map, but only the currently selected Active Vehicle draws its red flight trail. When I manually switch the active focus to another drone in the right panel, that newly selected drone starts rendering its trail, but the trails of the other 9 drones are not visible concurrently.

Summary / Core Requirements:

We are looking for a way to:

  1. Prevent old and new waypoints from automatically loading and displaying on the map, ensuring a clean Fly View.

  2. Ensure all 10 connected vehicles render their live flight trails simultaneously in parallel.

  3. Keep visual representation completely uniform across all vehicles (avoiding the faded/transparent look for non-active drones).

Any guidance on which specific QGC QML components or C++ trail-management services control these behaviors would be greatly appreciated!

Hi @sonis,

Thanks for the detailed clarification. I checked the current QGroundControl source, and two of the behaviors you described can be traced directly to the QML implementation.

1. Flight trails for all 10 vehicles

In src/FlyView/FlyViewMap.qml, the trajectory display currently uses a single MapPolyline (around lines 168–189).

Its path and update connections are tied to _activeVehicle.trajectoryPoints, so changing the active vehicle changes which trajectory is displayed.

For your fleet-wide visualization requirement, I would investigate replacing that single trajectory item with a MapItemView using:

QGroundControl.multiVehicleManager.vehicles

Each delegate could own a separate MapPolyline bound to that vehicle’s trajectoryPoints, including the point-added, last-point-updated and points-cleared signals.

This should allow independent trail rendering without changing the active vehicle.

2. Inactive vehicle transparency

In src/FlightMap/MapItems/VehicleMapItem.qml, the vehicle icon opacity is explicitly set to:

opacity: vehicle === _activeVehicle ? 1.0 : 0.5

That explains the faded appearance. For a fleet-oriented custom build, you could set it to 1.0 for every vehicle, or preferably introduce a configurable option.

3. Old mission waypoints

Since the behavior persists with your MQTT/MAVSDK bridge disabled, that removes one possible source of re-uploading, but it does not yet distinguish PX4 mission persistence from QGC-side state.

I would inspect MissionController and PlanMasterController next.

The decisive test would be to query the vehicle’s mission count after reconnecting, before clearing anything.

If PX4 still reports mission items, QGC may simply be displaying the mission stored on the vehicle. If PX4 reports no mission but Fly View still renders waypoints, the investigation should move toward QGC’s local mission/display state.

Relevant source files:

I would implement the multi-vehicle trail change as a small, isolated QML experiment first, then test it with your 10-vehicle SITL setup before considering a broader QGC contribution.

Best regards,
Yiğitcan Öztürk
PAMILANGA LTD

Hi Yiğitcan,

Thank you so much for taking the time to investigate this and for sharing such detailed and helpful guidance. I really appreciate the effort you put into examining the QGC source code and pointing me in the right direction. It genuinely means a lot!

I’m happy to share that I managed to resolve both the waypoint persistence issue and the inactive vehicle opacity issue. Unfortunately, I’m still struggling with the remaining issue: displaying all 10 vehicles’ flight trajectories simultaneously in Fly View, regardless of which vehicle is selected as the active vehicle.

Following your suggestion, I’ve been experimenting with replacing the single MapPolyline in src/FlyView/FlyViewMap.qml with a MapItemView bound to QGroundControl.multiVehicleManager.vehicles, so that each vehicle has its own trajectory polyline.

Here’s one of the implementations I’ve tried:

MapItemView {
    model: QGroundControl.multiVehicleManager.vehicles

    delegate: MapPolyline {
        id: vehicleTrajectoryPolyline
        line.width: 3
        line.color: "red"
        z: QGroundControl.zOrderTrajectoryLines
        visible: !pipMode

        readonly property var vehicleObj: object

        path: vehicleObj && vehicleObj.trajectoryPoints
              ? vehicleObj.trajectoryPoints.list()
              : []

        Connections {
            target: vehicleTrajectoryPolyline.vehicleObj
                    ? vehicleTrajectoryPolyline.vehicleObj.trajectoryPoints
                    : null
            ignoreUnknownSignals: true

            function onPointAdded(coordinate) {
                vehicleTrajectoryPolyline.addCoordinate(coordinate)
            }

            function onUpdateLastPoint(coordinate) {
                var count = vehicleTrajectoryPolyline.pathLength()
                if (count > 0) {
                    vehicleTrajectoryPolyline.replaceCoordinate(
                        count - 1, coordinate)
                }
            }

            function onPointsCleared() {
                vehicleTrajectoryPolyline.path = []
            }
        }
    }
}

I also investigated the C++ trajectory tracking in Vehicle.cc. I noticed that _trajectoryPoints->start() is normally called when _armed becomes true in _updateArmed(). To see whether this was affecting trajectory tracking for other vehicles, I added _trajectoryPoints->start() directly to the Vehicle constructor and rebuilt QGC.

The behavior I’m seeing is:

  • The original single-MapPolyline implementation works correctly, displaying the trajectory of whichever vehicle is currently active.

  • With the MapItemView implementation above, no trajectory lines appear at all, not even for the active vehicle.

  • I also experimented with Repeater and Instantiator, but encountered the same issue.

At this point, I’m unsure whether the problem lies in how the dynamic delegates are created or associated with the map, how trajectoryPoints is exposed and updated, or how MapPolyline handles its geometry inside these delegates.

Do you think the MapItemView approach should work with the existing QGC implementation, or is there something in the code above that might prevent the polylines from rendering? Would you recommend a different QML approach or a C++ modification to support simultaneous trajectory rendering for all vehicles?

Any further guidance would be greatly appreciated. Thank you again for your time and help!

Best regards,
Soni

Hi Soni,

Great to hear that you’ve resolved the waypoint persistence and inactive-vehicle opacity issues!

I checked the current QGroundControl source, and the existing vehicle MapItemView in FlyViewMap.qml uses the model role named object.

I would first simplify the trajectory delegate and explicitly bind that model role to each polyline. I would also avoid combining a continuously bound path property with imperative calls to addCoordinate() and replaceCoordinate().

As a first diagnostic, please try initializing each polyline from its vehicle’s trajectoryPoints.list() in Component.onCompleted, then update it only through the trajectory point signals.

I would not modify Vehicle.cc yet. The existing trajectory tracking is started when each vehicle transitions to the armed state, so the first thing to establish is whether each delegate receives the correct vehicle object and whether its trajectory list contains coordinates.

If the lines still do not appear, could you share the QML console warnings and confirm whether the delegate’s completion handler is executed once per vehicle?

That will help distinguish a model-role binding problem from a map-item rendering problem.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED

Hi Yiğitcan,

Thanks for the precise diagnostic suggestions!

I updated FlyViewMap.qml according to your snippet (removed the bound path property and handled initialization strictly in Component.onCompleted), and reverted Vehicle.cc back to its original state.

Here is what the QML console logs showed when starting up with two vehicles connected:

qml: TRAJ_DIAG: Delegate completed for vehicle: 2
qml: TRAJ_DIAG: Initial path length: 0
qml: TRAJ_DIAG: Delegate completed for vehicle: 3
qml: TRAJ_DIAG: Initial path length: 0

This confirms two important things:

  1. The MapItemView delegate and the object model role are working correctly — Component.onCompleted executes once per vehicle.

  2. The initial trajectory path length is 0.

However, when I arm both vehicles and fly them in SITL, no onPointAdded or onUpdateLastPoint logs appear in the console at all, and no trail lines are drawn on the map.

Since the delegates are being created as expected, it seems that trajectoryPoints is not emitting the pointAdded signal for the vehicles while they are in flight (or the signal connection is missing when they are not the active vehicle).

Do you have any suggestions on why trajectoryPoints might not be emitting points for all vehicles during flight?

Best regards, Soni

Hi Soni,

Thanks for running the diagnostics and sharing the results. This narrows the problem down considerably.

The logs confirm that the MapItemView delegates are created correctly for both vehicles, so I would leave the delegate structure unchanged for now.

I checked the current QGroundControl source again. In Vehicle.cc, Vehicle::_updateArmed() calls _trajectoryPoints->start() when the vehicle transitions to the armed state and _trajectoryPoints->stop() when it disarms.

Therefore, I would investigate whether the trajectory collection is actually running before changing the map rendering code further.

Could you try adding the following temporary diagnostics inside the MapPolyline delegate?

Connections {
    target: vehicleTrajectoryPolyline.vehicleObj
    ignoreUnknownSignals: true

    function onArmedChanged(armed) {
        console.log("TRAJ_DIAG: armedChanged",
                    vehicleTrajectoryPolyline.vehicleObj.id,
                    armed)
    }

    function onCoordinateChanged(coordinate) {
        console.log("TRAJ_DIAG: coordinateChanged",
                    vehicleTrajectoryPolyline.vehicleObj.id,
                    coordinate)
    }
}

Also, while both vehicles are flying, check whether their trajectoryPoints.list().length values increase.

This will help distinguish three cases:

  1. Coordinates do not update: investigate vehicle position telemetry.

  2. Coordinates update but trajectory lists remain empty: investigate the trajectory collection/start logic.

  3. Trajectory lists grow but pointAdded never fires in QML: investigate the signal connection or delegate target.

One additional check: please confirm that QGC reports both vehicles as armed, rather than only showing them as connected and moving.

I would avoid starting trajectory collection manually in the Vehicle constructor until we know which part of the existing lifecycle is failing.

If you share these results, we should be able to narrow the issue down to a specific code path rather than continuing to change the QML structure.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED

Hi Yiğitcan,

Thank you again for the clear diagnostic instructions. I ran the test with the exact Connections block and checked the list length periodically while flying two vehicles in SITL.

The results pinpoint the issue directly to Case 3:

Plaintext

qml: TRAJ_DIAG: Delegate completed for vehicle: 2
qml: TRAJ_DIAG: Delegate completed for vehicle: 3
...
qml: TRAJ_DIAG: list length check vehicle: 2 points count: 1
qml: TRAJ_DIAG: list length check vehicle: 3 points count: 1
...
qml: TRAJ_DIAG: list length check vehicle: 2 points count: 21
qml: TRAJ_DIAG: list length check vehicle: 3 points count: 16
...
qml: TRAJ_DIAG: list length check vehicle: 2 points count: 51
qml: TRAJ_DIAG: list length check vehicle: 3 points count: 33

Here is the exact breakdown of what we observed:

  1. Lifecycle & Arming: Both vehicles transition to the armed state properly, and C++ trajectory tracking runs as intended in the background without modifying Vehicle.cc.

  2. Trajectory Data Growth: trajectoryPoints.list().length increases continuously and simultaneously for both vehicles (reaching 51 and 33 points respectively).

  3. Missing QML Signal Emission / Reception: Despite the internal lists growing, the onPointAdded and onUpdateLastPoint signals never fired inside the Connections block targeting vehicleTrajectoryPolyline.vehicleObj.trajectoryPoints, and no trajectory lines appeared on the map.

Because the coordinates and the underlying trajectory list are undeniably updating, the bottleneck seems to be in how the delegate’s Connections attaches to vehicleObj.trajectoryPoints, or how TrajectoryPoints exposes its signals across dynamic delegates.

Given that we are confirmed to be in Case 3, what would you recommend to properly bridge the TrajectoryPoints signals or bind the path updates within the MapItemView delegate?

Thank you so much for your continuous guidance and invaluable help with this!

Best regards,

Soni

Hi Soni,

Excellent diagnostic work. These results narrow the problem down considerably.

Since both trajectory lists are growing independently, I would focus on the QML signal connection and map rendering path rather than changing the C++ trajectory collection logic.

I suggest the following approach.

1. Verify the actual signal source

First, confirm that vehicleObj.trajectoryPoints resolves to the expected QObject instance and that its pointAdded and updateLastPoint signals are declared and exposed to QML.

A growing list does not necessarily prove that these signals are being emitted.

2. Establish an explicit connection

Inside the trajectory delegate, try:

Connections {
    target: vehicleTrajectoryPolyline.vehicleObj
            ? vehicleTrajectoryPolyline.vehicleObj.trajectoryPoints
            : null

    ignoreUnknownSignals: false

    function onPointAdded() {
        console.log("TRAJ: pointAdded received")
        vehicleTrajectoryPolyline.refreshPath()
    }

    function onUpdateLastPoint() {
        console.log("TRAJ: updateLastPoint received")
        vehicleTrajectoryPolyline.refreshPath()
    }
}

This assumes the C++ signals have compatible signatures and refreshPath() is implemented on the delegate.

3. Implement an explicit path refresh

For diagnostic purposes, rebuild the map path from the current trajectory list whenever either signal is received.

Use the actual coordinate property exposed by your TrajectoryPoints implementation.

This will help establish whether the remaining problem is signal delivery or map rendering.

4. Test rendering independently

Since the lists already contain valid trajectory points, temporarily populate the MapPolyline using the existing list without relying on signals.

If the trajectory becomes visible, we can isolate the issue to notification or refresh handling.

If it remains invisible, check the MapItemView delegate structure, coordinate conversion, map item ownership, visibility, and polyline styling.

5. Verify delegate lifetime

Because this is a multi-vehicle configuration, ensure each delegate maintains its own vehicle reference and signal connection.

Also check whether the Connections target changes or becomes null when the active vehicle changes.

I would avoid modifying Vehicle.cc until these checks are complete.

Expected validation:

  • Both vehicles retain independent trajectory histories.

  • Each trajectory appears on the map.

  • New points update the correct vehicle’s polyline.

  • Switching the active vehicle does not interrupt either trajectory.

  • No QML signal or binding warnings occur.

The most useful next result would be whether manually rebuilding the polyline from the existing list makes both trajectories visible.

That will distinguish a signal propagation problem from a rendering problem.

Best regards,
Yiğitcan

Hi Yiğitcan,

Thank you so much for all your help and guidance! I managed to get it working, and I really appreciate your time and support.

Best regards,
Soni

Hi Soni,

Great to hear that you got it working!

Thanks for the update. I’m glad the guidance was helpful.

If you have a moment, it would be useful to share which configuration change or approach resolved the issue, so others facing the same problem can benefit from your experience.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED

Hi Yiğitcan,

Of course! Here is a summary of what resolved it:

The diagnostic logs from our test confirmed that C++ was collecting trajectory points properly (trajectoryPoints.list().length grew continuously during flight), but the QML Connections block inside the dynamic delegate was failing to intercept pointAdded / updateLastPoint.

Instead of relying on the imperative Connections approach, we moved to a lightweight polling mechanism directly inside each MapPolyline delegate:

QML

MapItemView {
    model: QGroundControl.multiVehicleManager.vehicles

    delegate: MapPolyline {
        id: trail
        property var vehicleObj: object
        line.width: 3
        line.color: "red"
        z: QGroundControl.zOrderTrajectoryLines
        visible: !pipMode

        Timer {
            interval: 500
            running: true
            repeat: true
            onTriggered: {
                if (trail.vehicleObj && trail.vehicleObj.trajectoryPoints) {
                    trail.path = trail.vehicleObj.trajectoryPoints.list()
                }
            }
        }
    }
}

Since TrajectoryPoints.cc already handles distance and heading decimation (2 m / 1.5°), refreshing path via the 500 ms timer has negligible overhead and reliably updates the trajectories for the entire fleet simultaneously without modifying C++ code.

Thanks again for pointing us in the right direction and helping isolate the issue!

Best regards,

Soni

Hi Soni,

Thank you for sharing the working solution and explaining the root cause so clearly!

It’s particularly useful that your diagnostics confirmed the C++ trajectory collection was functioning correctly, while the QML Connections mechanism inside the dynamic delegate was not reliably receiving the update signals.

Using a per-vehicle Timer to refresh each MapPolyline is a practical workaround, and I’m glad it resolved the simultaneous trajectory visualization issue.

One consideration for larger fleets or longer missions would be to monitor the cost of repeatedly retrieving and assigning the full trajectory list every 500 ms.

It may also be worth investigating the underlying QML signal connection behavior in the future, so that an event-driven update mechanism can be restored if needed.

Thanks again for documenting the solution. This should be very helpful to other QGroundControl developers working with multiple vehicles.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED