forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple_flight controller code complete
- Loading branch information
Showing
17 changed files
with
344 additions
and
143 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
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
52 changes: 52 additions & 0 deletions
52
AirLib/include/firmwares/simple_flight/firmware/ConstantOutputController.hpp
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,52 @@ | ||
|
||
#pragma once | ||
|
||
#include "interfaces/CommonStructs.hpp" | ||
#include "interfaces/IBoardClock.hpp" | ||
#include "interfaces/IAxisController.hpp" | ||
#include "common/common_utils//Utils.hpp" | ||
#include "Params.hpp" | ||
#include <memory> | ||
|
||
namespace simple_flight { | ||
|
||
class ConstantOutputController : public IAxisController { | ||
public: | ||
ConstantOutputController(TReal update_output = TReal(), TReal reset_output = TReal()) | ||
: update_output_(update_output), reset_output_(reset_output) | ||
{ | ||
} | ||
|
||
virtual void initialize(unsigned int axis, const IGoal* goal, const IStateEstimator* state_estimator) override | ||
{ | ||
axis_ = axis; | ||
unused(goal); | ||
unused(state_estimator); | ||
} | ||
|
||
virtual void reset() override | ||
{ | ||
IAxisController::reset(); | ||
output_ = reset_output_; | ||
} | ||
|
||
virtual void update() override | ||
{ | ||
IAxisController::update(); | ||
output_ = update_output_; | ||
} | ||
|
||
virtual TReal getOutput() override | ||
{ | ||
return output_; | ||
} | ||
|
||
private: | ||
unsigned int axis_; | ||
TReal update_output_; | ||
TReal reset_output_; | ||
TReal output_; | ||
}; | ||
|
||
|
||
} //namespace |
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.