Flying drone with VIO and GPS

Hi,

I have an issuse to fly drone with VIO and GPS. Am I able to set proper value of the mask EKF_AID_MASK to turn off the GPS signal during the flight and navigate only by VIO system or on the other hand to fly drone with GPS with deacitvated the vision system. I want to deactivate GPS or VIO during the flight of the drone.
If yes what would be the EKF_AID_MASK value ? Or maybe there is other solution to my issue.

Any hints or help would be appreciated.

Greets
Błażej

1 Like

Hi!
EKF_AID_MASK for GPS + VIO I gess

+ 1

In flight you can’t change EKF_AID_MASK, because it change only be reboot vechile.

MAVSDK have Failure plugin by using it you can do something like this:

failure.inject(SensorVio, Ok, int32_t instance);
failure.inject(SensorGps, Off, int32_t instance);

failure.inject(SensorVio, Off, int32_t instance);
failure.inject(SensorGps, Ok, int32_t instance);

I think it can do by Mavlink console in QGC like “gps stop” / “gps run”.

If you check my solution, and it help, please tell me about it.

I’m sometimes working with tasks like this, but this task I didn’t try yet.

Hi!
I tried Failure plugin, it didn’t want to work.
I’m trying to use serial control message, with MavlinkPassthrough plugin MAVSDK C++. I think it wil be work, but I have no result, yet.

In main, couldn’t you set EKF2_GPS_CTRL to zero?

Wow, it’s so simple? Big thanks!

Directly set EKF2_GPS_CTRL to zero by Param plugin imposible.

But posible to set EKF2_AID_MASK. But what about [this]?(Parameter Reference | PX4 User Guide (main)):
image

I see that it work:

auto get = param->get_param_int(“EKF2_AID_MASK”);
std::cout << “int_32:\t” << get.second << std::endl;
param->set_param_int(“EKF2_AID_MASK”,24);
get = param->get_param_int(“EKF2_AID_MASK”);
std::cout << “int_32:\t” << get.second << std::endl;
param->set_param_int(“EKF2_AID_MASK”,1);
get = param->get_param_int(“EKF2_AID_MASK”);
std::cout << “int_32:\t” << get.second << std::endl;

image

But this will need to be checked when the drone is in flight.

I’ll tell you when I check.

Cheked with Gazemo, look pretty good. :blush:

Why won’t mavsdk allows EKF2_GPS_CTRL to be set? Perhaps it is not in the version of PX4 you are using?

Because setting EKF2_GPS_CTRL to zero is the “right” think to do what you want in main as far as I know. So if it is in the version of PX4 you are using, worth finding out why MAVSDK won’t set it.

Don’t know why :cry:

Device: PX4 FMU V5X (Pixhawk 5x Holybor)
Flight Stack: PX4 Pro Stable Release v1.13.2 (px4_fmu-v5x-default.px4) (last)
MAVSDK v1.4.0

        auto get = param->get_param_int("EKF2_GPS_CTRL");
        std::cout <<"1.1) Result get:\t"<< get.first <<"\tint_32:\t" << get.second << std::endl;

        auto set = param->set_param_int("EKF2_GPS_CTRL",0);
        std::cout <<"2.1) Result set:\t"<< set << std::endl;

        get = param->get_param_int("EKF2_GPS_CTRL");
        std::cout <<"2.2) Result get:\t"<< get.first <<"\tint_32:\t" << get.second << std::endl;

        set = param->set_param_int("EKF2_GPS_CTRL",1);
        std::cout <<"3.1) Result set:\t"<< set << std::endl;

        get = param->get_param_int("EKF2_GPS_CTRL");
        std::cout <<"3.2) Result get:\t"<< get.first <<"\tint_32:\t" << get.second << std::endl;

Always Result = Timeout.

EK2_GPS_CTRL no in QGC

You may have made a mistake in your suggestion to set EKF2_GPS_CTRL to zero, because ‘0’ is not turning off GPS:

image

But thanks a lot for the tips anyway. :partying_face:

Hi, my main purpose was navigating the drone with fusion of GPS and VIO system. I want to start flying the drone using fusion of GPS and VIO. I want to use VIO as backup in case of GPS noise. I don’t want to land the drone and change the ekf2_aid_mask and continue the flight with the mask set for vio.
Is there any solution to my problem?

Now I am testing the vio system in the simulation. The drone is flying with VIO with EKF_AID_MASK = 24. From starting the flight to landing the drone is using only VIO system.

The EKF_AID_mask values that was shown in previous reply don’t have bitmask 0: use GPS set bit to 1. Does it mean that I don’t have to use bitmask 0 to use GPS with VIO?

And me again! :slight_smile:

“set to true to use GPS” it is mean bitmask = 1.

If you whant to use GPS + VIO bitmask = 25.

But there are promblem if you feed PX4 by pose from VIO, it can conflict with pose from GPS, and drone can crushed.
So if you use GPS + VIO you can feed PX4 speed from VIO. (I read about it on this forum. Don’t remember where exatly :frowning: ) And then PX4 fusing data correctly.

Any way if you testing in the simulation use EKF2_AID_MASK = 25.

Hi @Artem_Borisov, I’m also facing same issue in my pixhawk device EKF2_GPS_CTRL paramater is not listing. Did you get any luck to solve this error.