Commit b6d9f23b authored by Bryant's avatar Bryant

The UASInterface now defines a systemCanReverse() function for indicating if...

The UASInterface now defines a systemCanReverse() function for indicating if the UAS is capable of commanding a reverse thrust.
parent f086840f
......@@ -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)
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment