-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the ability to get the currently connected autopilot type. #2224
Conversation
Shouldn't the mission plugin compose the right mission and expose a higher-level interface to the user? 🤔 |
Sorry that I didn't initially indicate what exactly I was using. To load the mission I use mission_raw. Without adding one point for the Ardupilot mission, the mission will not load. Here is my method for converting and adding mission points. If there is any simpler implementation of loading a mission simultaneously for Ardupilot and PC4, then I will be happy to hear from you :)
|
I agree with @JonasVautherin that it generally should not be required that different code runs based on the autopilot. The idea is that Mavsdk is abstracting that away. However, I don't mind exposing the information as such about what autopilot is connected. |
enum class Autopilot { | ||
Unknown, | ||
Px4, | ||
ArduPilot, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to include the existing Autopilot enum instead of duplicating it.
Thank you for your comments. I will think more abot how i can implement mission upload for Ardupilot and PX4 at the same time. After all, @JonasVautherin said that MAVSDK itself should provide such an opportunity. However, after several tests, I found out that it is still necessary to compose a mission simultaneously for these types of autopilot as indicated in my example of my convertToMissionItems function. Since I tried to use ready-made tools provided in mission_raw. But I haven't been in MAVLINK and MAVSDK for long, so I'll think about it a little more. Yes. As @julianoes said, it would be nice to know which autopilot is currently connected. |
The mission plugin (instead of mission_raw) should do just that. But we need somebody to contribute the Ardupilot side, I think 😊 |
I've only been studying MAVLINK for a few months. But since I mostly develop for Ardupilot, I will try to help as much as I can and to the best of my knowledge. :) |
@Zvereman I'm happy to merge this if you fix my inline comment. |
Yes. Sure. Just was too busy on my work ^_^ |
Huh, what happened here? |
Sorry. Mr. @julianoes Got a lot of things to do :) But I still intend to offer a few of my ideas. As soon as I have enough time, I will open another pull request. If you're wondering what I mean, here's my fork in the public repository. |
No worries, thanks for the note. I'll see if I can add it before you. |
Done: #2236 What you probably missed is that autopilot.h needs to become a public header file and therefore needs to move. |
Sometimes you need to get the type of connected autopilot into your program. For example, in order to correctly compose a mission for Ardupilot and PX4 at the same time.
Here's a small example of use.