-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b963ea3
commit e0801d6
Showing
11 changed files
with
344 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,46 @@ | ||
[Motors] | ||
# This section defines the mapping between PX4 and X-Plane motors. | ||
# Each line should be in the format "PX4_X = Y", where X is the PX4 motor number and Y is the corresponding X-Plane motor number. | ||
# CW/CCW of the px4 motors and xplane motors should match (FWD_RIGHT and BACK_LEFT: CCW) (FWD_LEFT and BACK_RIGHT: CW) | ||
PX4_1 = 4 | ||
PX4_2 = 1 | ||
PX4_3 = 3 | ||
PX4_4 = 2 | ||
; PX4-XPlane Configuration File | ||
; File Version: 1.0 | ||
; Date Created: November 10, 2023 | ||
; This file configures the mapping of motor and servo channels from PX4 to X-Plane. | ||
|
||
; General Instructions: | ||
; - Specify the configuration name for UI display. | ||
; - Set 'num_motors' for multirotors and provide motor mappings. | ||
; - For fixed-wing configurations, this section is a placeholder and currently not supported. | ||
; - Ensure the mappings correspond to your specific setup. | ||
; - Visit the GitHub repository (alireza787b/px4xplane) for more information and updates. | ||
|
||
; Configuration Name (Displayed in UI) | ||
config_name = Quadricopter Air Taxi | ||
|
||
; Actuve Configuration Type to Load from below | ||
active_config_type = Multirotor | ||
config_version= 1.0 | ||
|
||
|
||
[Multirotor] | ||
; Default configuration for a standard quadcopter. | ||
; Number of motors in your multirotor setup. | ||
num_motors = 4 ; Change this number based on your setup. | ||
|
||
; Motor Mappings: PX4 motor number = X-Plane motor number | ||
; The following is the default setup for a Quadricopter. You can modify these mappings as needed. | ||
; The Rotaion direction (CW & CCW) of motors should be compatible with PX4. | ||
motor1 = 1 | ||
motor2 = 2 | ||
motor3 = 3 | ||
motor4 = 4 | ||
;motor5 = | ||
;motor6 = | ||
;... up to motor16 | ||
|
||
[FixedWing] | ||
; Placeholder for future fixed-wing configurations. | ||
; This section is not yet supported but will be available in future updates. | ||
; Stay tuned for updates on the GitHub repository. | ||
|
||
; Additional notes: | ||
; - The version number at the top of this file helps track changes and compatibility. | ||
; - The configuration name helps users verify that the correct configuration is loaded in the UI. | ||
; - Detailed documentation and examples for various configurations are available in the GitHub repository. | ||
; - For any issues or feature requests, please open an issue on GitHub. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ConfigManager.h | ||
|
||
#ifndef CONFIGMANAGER_H | ||
#define CONFIGMANAGER_H | ||
|
||
#include <string> | ||
#include <map> | ||
|
||
class ConfigManager { | ||
public: | ||
static void loadConfiguration(); | ||
static int getPX4MotorFromXPlane(int xPlaneMotorNumber); | ||
static int getXPlaneMotorFromPX4(int px4MotorNumber); | ||
|
||
static std::string getConfigName(); | ||
static std::string getConfigVersion(); | ||
static std::string getConfigType(); | ||
|
||
private: | ||
static std::map<int, int> motorMappingsPX4toXPlane; | ||
static std::map<int, int> motorMappingsXPlanetoPX4; | ||
static std::string configName; | ||
static std::string configVersion; | ||
static std::string configType; // "Multirotor" or "FixedWing" | ||
|
||
static std::string getConfigFilePath(); | ||
}; | ||
|
||
#endif // CONFIGMANAGER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.