Skip to content

Commit

Permalink
Fixed python client QuaternionR class having bug to correctly invert …
Browse files Browse the repository at this point in the history
…the quaternion.
  • Loading branch information
WouterJansen committed Sep 18, 2019
1 parent dd8c327 commit 2cd28cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PythonClient/airsim/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def star(self):
return self.conjugate()

def inverse(self):
return self.star() / self.dot(self)
return self.from_numpy_array(self.star().to_numpy_array() / self.dot(self))

def sgn(self):
return self/self.get_length()
Expand All @@ -191,6 +191,9 @@ def get_length(self):

def to_numpy_array(self):
return np.array([self.x_val, self.y_val, self.z_val, self.w_val], dtype=np.float32)

def from_numpy_array(self, array):
return Quaternionr( array[0], array[1], array[2], array[3] )


class Pose(MsgpackMixin):
Expand Down

0 comments on commit 2cd28cf

Please sign in to comment.