-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Ardupilot mission handling and vehicle type checking #1562
Conversation
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.
Nice! Just a nitpick for a switch 😇
src/core/system_impl.cpp
Outdated
_ap_mode = to_ap_mode_from_custom_mode<APRoverMode>(heartbeat.custom_mode); | ||
break; | ||
default: | ||
_ap_mode = to_ap_mode_from_custom_mode<APCopterMode>(heartbeat.custom_mode); |
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.
_ap_mode = to_ap_mode_from_custom_mode<APCopterMode>(heartbeat.custom_mode); | |
_ap_mode = to_ap_mode_from_custom_mode<APCopterMode>(heartbeat.custom_mode); | |
break; |
src/core/system_impl.h
Outdated
Auto_Rotate = 26, | ||
Auto_RTL = 27, | ||
Turtle = 28 | ||
}; |
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.
What about moving these enums to a separate header file like https://github.com/mavlink/MAVSDK/blob/main/src/core/px4_custom_mode.h?
src/core/system_impl.h
Outdated
@@ -50,6 +50,52 @@ class SystemImpl : public Sender { | |||
Stabilized, | |||
}; | |||
|
|||
// Enumeration representing the available modes for the Arudpilot rover autopilot. | |||
enum class APRoverMode { |
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.
Usually we try the convention to lowercase acronyms like so: ApRoverMode
, however, I assume you copied them from somewhere, so then maybe it's better leave em as is.
Heya, sorry about the number of changes. Had a chat with Seb and we decided on hiding the ardupilot mode behind flight_mode, so now I translate back and forth from it. |
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.
Looks good to me.
Any objections @JonasVautherin? Nevermind.
Adds support to mission_raw to upload, start missions and clear missions when the autopilot is ArduPilot.
Further adds support to grab the vehicle type from the HEARTBEAT message, and to use this to determine what the correct mode command is for a ArduPilot vehicle, since this depends on the type.