forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rectoring choise of firmware to json setting
- Loading branch information
Showing
20 changed files
with
340 additions
and
502 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
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
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,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#ifndef msr_airlib_vehicles_MultiRotorParamsFactory_hpp | ||
#define msr_airlib_vehicles_MultiRotorParamsFactory_hpp | ||
|
||
#include "vehicles/configs/RosFlightQuadX.hpp" | ||
#include "controllers/MavLinkDroneController.hpp" | ||
#include "controllers/Settings.hpp" | ||
#include "vehicles/configs/PX4QuadX.hpp" | ||
|
||
|
||
namespace msr { namespace airlib { | ||
|
||
class MultiRotorParamsFactory { | ||
public: | ||
static std::unique_ptr<MultiRotorParams> createConfig(const std::string& vehicle_name) | ||
{ | ||
//read settings and override defaults | ||
Settings& settings = Settings::singleton(); | ||
if (!settings.isLoadSuccess()) | ||
throw std::runtime_error("Cannot load settings.json"); | ||
|
||
Settings child; | ||
settings.getChild(vehicle_name, child); | ||
|
||
std::unique_ptr<MultiRotorParams> config; | ||
|
||
if (vehicle_name == "Pixhawk") { | ||
config.reset(new Px4QuadX(child)); | ||
} else if (vehicle_name == "RosFlight") { | ||
config.reset(new RosFlightQuadX(child)); | ||
} else | ||
throw std::runtime_error(Utils::stringf("Cannot create vehicle config because vehicle name '%s' is not recognized", vehicle_name.c_str())); | ||
|
||
return config; | ||
} | ||
}; | ||
|
||
}} //namespace | ||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.