Skip to content

Commit

Permalink
Remove unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
teubert committed Oct 23, 2023
1 parent a2e6d05 commit a8ce3ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/progpy/mixture_of_experts.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def best_model(self, x, _excepting=[]):
tuple[str, PrognosticsModel]: The name and model for the model with the highest score. If two models are tied, the first one will be returned in the order they were passed to the constructor.
"""
# Identify best model
best_value = -1
best_value: float = -1
for i, (key, _) in enumerate(self.parameters['models']):
if key in _excepting:
continue # Skip excepting
Expand Down Expand Up @@ -286,7 +286,3 @@ def performance_metrics(self, x):
performance_metrics_seen |= new_performance_metrics

return pm

name, m = self.best_model(x)
x_i = m.StateContainer({key: x[name + '.' + key] for key in m.states})
return m.performance_metrics(x_i)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np

SQRT2_2: float = np.sqrt(2.0) / 2.0

def rotorcraft_cam(n, length, b, d, constrained=False):
"""
Generate control allocation matrix (CAM) to transform rotor's angular velocity into thrust and torques around three main body axes.
Expand All @@ -28,7 +30,7 @@ def rotorcraft_cam(n, length, b, d, constrained=False):
optional = {}
if n == 8 and not constrained:
l_b = length * b
l_b_sq2o2 = l_b * np.sqrt(2.0) / 2.0
l_b_sq2o2 = l_b * SQRT2_2
# This CAM is assuming there's no rotor pointing towards the drone forward direction (x-axis)
# See Dmitry Luchinsky's report for details (TO BE VERIFIED)
Gamma = np.array([[b, b, b, b, b, b, b, b],
Expand Down

0 comments on commit a8ce3ff

Please sign in to comment.