-
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.
- Loading branch information
Gabriele
committed
Jan 30, 2024
1 parent
815c5d6
commit a334b7b
Showing
16 changed files
with
693 additions
and
465 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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: WebKit | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: Left | ||
AlignOperands: true | ||
AlignTrailingComments: false | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: false | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BraceWrapping: | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterObjCDeclaration: false | ||
AfterStruct: true | ||
AfterUnion: true | ||
BeforeCatch: false | ||
BeforeElse: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeBraces: Custom | ||
BreakBeforeInheritanceComma: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: true | ||
BreakConstructorInitializers: BeforeComma | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 100 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeCategories: | ||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' | ||
Priority: 2 | ||
- Regex: '^(<|"(gtest|gmock|isl|json)/)' | ||
Priority: 3 | ||
- Regex: '.*' | ||
Priority: 1 | ||
IncludeIsMainRegex: '(Test)?$' | ||
IndentCaseLabels: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBlockIndentWidth: 4 | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 10 | ||
PenaltyBreakBeforeFirstCallParameter: 1000 | ||
PenaltyBreakComment: 10 | ||
PenaltyBreakString: 10 | ||
PenaltyExcessCharacter: 100 | ||
PenaltyReturnTypeOnItsOwnLine: 5 | ||
PointerAlignment: Left | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Cpp11 | ||
TabWidth: 4 | ||
UseTab: Never |
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 was deleted.
Oops, something went wrong.
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,57 @@ | ||
/** | ||
* @file JetUKFModel.h | ||
* @author Gabriele Nava | ||
* @date 2024 | ||
*/ | ||
#ifndef JET_UKF_MODEL_H | ||
#define JET_UKF_MODEL_H | ||
|
||
#include "UKFModel.h" | ||
|
||
/** | ||
* @class JetUKFModel | ||
* @brief Inherit and overwrite methods of the UKFModel class to implement | ||
* the prediction and observation models for jet thrust estimation. | ||
*/ | ||
class JetUKFModel : public UKFModel | ||
{ | ||
public: | ||
/** | ||
* @brief Construct a JetUKFModel object with inputs. | ||
* @param dt discretization time step. | ||
*/ | ||
JetUKFModel(const double& dt); | ||
|
||
/** | ||
* @brief Update the process model. | ||
* @return None. | ||
*/ | ||
void updateProcessModel(const Eigen::Ref<Eigen::VectorXd> u); | ||
|
||
/** | ||
* @brief Get the system state at next time instant using the prediction model. | ||
* @param x State at the current time instant; | ||
* @return State at the next time instant. | ||
*/ | ||
Eigen::VectorXd computePredictionFromModel(const Eigen::Ref<Eigen::VectorXd> x) override; | ||
|
||
/** | ||
* @brief Get the observed variables from the current state. The observed variables are | ||
* the ones to be compared with the available measurements. | ||
* @param x State at current time instant; | ||
* @return Observed variables. | ||
*/ | ||
Eigen::VectorXd computeObservationFromModel(const Eigen::Ref<Eigen::VectorXd> x) override; | ||
|
||
double m_dt; | ||
|
||
// state model parameters | ||
Eigen::Matrix2d m_A; | ||
Eigen::Vector2d m_B; | ||
Eigen::VectorXd m_u; | ||
|
||
// measurement model parameters | ||
Eigen::Vector2d m_h; | ||
}; | ||
|
||
#endif /* end of include guard JET_UKF_MODEL_H */ |
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
/** | ||
* @file JetUKFModel.cpp | ||
* @author Gabriele Nava | ||
* @date 2024 | ||
*/ | ||
#include <JetUKFModel.h> | ||
|
||
JetUKFModel::JetUKFModel(const double& dt) | ||
: m_dt(dt) | ||
{ | ||
// for jet engines, implemented a simple kinematic model | ||
m_A << 1.0, m_dt, 0.0, 1.0; | ||
m_B << std::pow(m_dt, 2) / 2, m_dt; | ||
|
||
// measurements are the observed thrusts | ||
m_h << 1.0, 0.0; | ||
} | ||
|
||
void JetUKFModel::updateProcessModel(const Eigen::Ref<Eigen::VectorXd> u) | ||
{ | ||
m_u = u; | ||
} | ||
|
||
Eigen::VectorXd JetUKFModel::computePredictionFromModel(const Eigen::Ref<Eigen::VectorXd> x) | ||
{ | ||
return (m_A * x + m_B * m_u); | ||
} | ||
|
||
Eigen::VectorXd JetUKFModel::computeObservationFromModel(const Eigen::Ref<Eigen::VectorXd> x) | ||
{ | ||
return m_h.transpose() * x; | ||
} |
Oops, something went wrong.