Skip to content

Commit

Permalink
Bug fixed: duplicated linear() call. (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Oct 5, 2024
1 parent bef35cb commit 2ab9c7c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions leads_arduino/accelerometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ class Acceleration(_Serializable):

def linear(self) -> _Self:
fg = rotation_matrix(self.yaw, self.pitch, self.roll).T @ _G
return Acceleration(self.yaw, self.pitch, self.roll, self.forward_acceleration + fg[0],
self.lateral_acceleration + fg[1], self.vertical_acceleration - fg[2])
return LinearAcceleration(self.yaw, self.pitch, self.roll, float(self.forward_acceleration + fg[0]),
float(self.lateral_acceleration + fg[1]), float(self.vertical_acceleration - fg[2]))


class LinearAcceleration(Acceleration):
@_override
def linear(self) -> _Self:
return self


class Accelerometer(_Device):
Expand Down

0 comments on commit 2ab9c7c

Please sign in to comment.