How to use SetROICommand and SetViewModeCommand in FlightPlan

Hello,

I want to set Drone’s orientation by SetROICommand and SetViewModeCommand, such as heading yaw to next waypoint.

I tried the following FlightPlan.

        QGC WPL 120
        0   0       3       22      15.00000        0.000000        0.000000        0.000000        0.0000000       0.000000        5.000000       1
        1   0       3       201     3.000000        0.000000        0.000000        0.000000        48.878500       2.367700        15.00000       1
        2   0       3       50000   2.000000        1.000000        0.000000        0.000000        0.0000000       0.000000        0.000000       1
        3   0       3       16      0.000000        0.000000        0.000000        0.000000        48.878500       2.367700        37.75000       1
        4   0       3       201     3.000000        0.000000        0.000000        0.000000        48.878500       2.367600        15.00000       1
        5   0       3       50000   2.000000        4.000000        0.000000        0.000000        0.0000000       0.000000        0.000000       1
        6   0       3       16      0.000000        0.000000        0.000000        90.00000        48.878500       2.367600        31.34000       1
        7   0       3       201     3.000000        0.000000        0.000000        0.000000        48.878500       2.367800        15.00000       1
        8   0       3       50000   2.000000        7.000000        0.000000        0.000000        0.0000000       0.000000        0.000000       1
        9   0       3       16      0.000000        0.000000        0.000000        180.0000        48.878500       2.367800        31.34000       1

But it don’t work…
The behavior is that VIEW_MODE_TYPE still looks like ABSOLUTE.

Is there a mistake in how to use it?

Thanks.

Hello,

In your FlightPlan you have three SetViewModeCommand (50000) commands that set the view mode to ROI (2). These commands also have a ROI index as their second parameter.
You should specify the ROI index as 0 as the there are no ROIs with index 1, 4 or 7.

Try for example:

        QGC WPL 120
        0   0       3       22      15.00000        0.000000        0.000000        0.000000        0.0000000       0.000000        5.000000       1
        1   0       3       201     3.000000        0.000000        0.000000        0.000000        48.878500       2.367700        15.00000       1
        2   0       3       50000   2.000000        0.000000        0.000000        0.000000        0.0000000       0.000000        0.000000       1
        3   0       3       16      0.000000        0.000000        0.000000        0.000000        48.878500       2.367700        37.75000       1
        4   0       3       201     3.000000        0.000000        0.000000        0.000000        48.878500       2.367600        15.00000       1
        5   0       3       50000   2.000000        0.000000        0.000000        0.000000        0.0000000       0.000000        0.000000       1
        6   0       3       16      0.000000        0.000000        0.000000        90.00000        48.878500       2.367600        31.34000       1
        7   0       3       201     3.000000        0.000000        0.000000        0.000000        48.878500       2.367800        15.00000       1
        8   0       3       50000   2.000000        0.000000        0.000000        0.000000        0.0000000       0.000000        0.000000       1
        9   0       3       16      0.000000        0.000000        0.000000        180.0000        48.878500       2.367800        31.34000       1

(In the example given, commands with index 2, 5 and 8 - all of them SetViewModeCommand - were changed comparing to your FlightPlan)

Georges

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.