Closed TeoVal138 closed 1 year ago
I think that the equivalent to "guided" in PX4 is "offboard". Did you try the offboard plugin? Not sure if it works with Ardupilot though :thinking:. Worth trying with a simulator! :blush:
Hi Jonas, Thank you for the support 😊 I was trying with a simulator to use offboard but the "system.getOffboard().start()" method doesn't respond and "system.getOffboard().isActive()" is always set to false so I think it's off limits unfortunately. For a while I tried with the Shell plugin but I didn't find anything useful in the online forums, do you happen to know if I could actually use it to change the flight modes and if so what command should I use?
Calling offboard.start()
should just change the flight mode, see here:
_system_impl->set_flight_mode(FlightMode::Offboard)
which ends up translating that to an Ardupilot flight mode here:
make_command_ardupilot_mode(flight_mode, component_id);
which e.g. for a copter will translate to Guided
here:
case FlightMode::Offboard:
return ardupilot::CopterMode::Guided;
So I think it should work.
The problem is that at least the last part is not available in MAVSDK v1.4.16 (latest release, see here), only on the main
branch.
I see ~two~ three solutions for you (none of them ideal, unfortunately):
main
branch (where I believe it should work), but honestly I don't know how easy that will be. Could be quite straightforward, I think.Thank you Jonas I will try to follow your advice! 😊 So no other mavsdk-java plugin would allow me to switch modes right? I'm not just talking about the guided mode set but also about the other modes set
The MAVSDK plugins set the mode as required. For instance the mission plugin will set the mission mode, the action plugin will set the RTL, takeoff, land mode, etc.
Hello everyone, I'm developing an android mobile app with mavsdk-java to control my ardupilot drone, in this days I've been trying to set the guided mode in order to takeoff autonomously. Can you please tell me what can I do?
Many thanks in advance