Skip to content

Commit 30d15bf

Browse files
refactor bias_gyro
1 parent f01be8e commit 30d15bf

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/smsfusion/_smoothing.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,11 @@ def bias_gyro(self, degrees: bool = False) -> NDArray:
208208
Gyroscope bias estimates for each of the N time steps where the smoother has
209209
been updated with measurements.
210210
"""
211-
x = self.x
212-
if x.size == 0:
213-
return np.array([])
211+
if self.x.size == 0:
212+
return np.empty((0, 3))
213+
214214
bg = self.x[:, 13:16]
215-
if degrees:
216-
bg = (180.0 / np.pi) * bg
217-
return bg
215+
return np.degrees(bg) if degrees else bg
218216

219217
def euler(self, degrees: bool = False) -> NDArray:
220218
"""

0 commit comments

Comments
 (0)