diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 64a133b77329d757351bbdd5335274d94e98066c..dcdfc2f58738ed24bada535c4aa95e2bb321e0ac 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -528,6 +528,40 @@ public: paramManager = manager; } int getSystemType(); + + /** + * @brief Returns true for systems that can reverse. If the system has no control over position, it returns false as + * @return If the specified vehicle type can + */ + bool systemCanReverse() const + { + switch(type) + { + case MAV_TYPE_GENERIC: + case MAV_TYPE_FIXED_WING: + case MAV_TYPE_ROCKET: + case MAV_TYPE_FLAPPING_WING: + + // System types that don't have movement + case MAV_TYPE_ANTENNA_TRACKER: + case MAV_TYPE_GCS: + case MAV_TYPE_FREE_BALLOON: + default: + return false; + case MAV_TYPE_QUADROTOR: + case MAV_TYPE_COAXIAL: + case MAV_TYPE_HELICOPTER: + case MAV_TYPE_AIRSHIP: + case MAV_TYPE_GROUND_ROVER: + case MAV_TYPE_SURFACE_BOAT: + case MAV_TYPE_SUBMARINE: + case MAV_TYPE_HEXAROTOR: + case MAV_TYPE_OCTOROTOR: + case MAV_TYPE_TRICOPTER: + return true; + } + } + QString getSystemTypeName() { switch(type) diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 639d20ead73fac6f6e025f0b1f07b094e7c5235f..7da51f01e3e2e6d0e96ae8dad41e218634fcc8cc 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -242,6 +242,11 @@ public: /** @brief Get the type of the system (airplane, quadrotor, helicopter,..)*/ virtual int getSystemType() = 0; + /** @brief Indicates whether this system is capable of controlling a reverse velocity. + * Used for, among other things, altering joystick input to either -1:1 or 0:1 range. + */ + virtual bool systemCanReverse() const = 0; + virtual QString getSystemTypeName() = 0; /** @brief Get the type of the autopilot (PIXHAWK, APM, UDB, PPZ,..) */ virtual int getAutopilotType() = 0;