Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Fixed bias reset when switching filters
Browse files Browse the repository at this point in the history
reset bias when switching to inertial navigation
  • Loading branch information
lorenzoferrini committed Jul 29, 2020
1 parent ee60c91 commit c532f7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/node_sage-husa.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ def uwb_callback(data):
filter.uwbCeck = np.zeros(4)

def activation_callback(data):
global filter
filter.mode = data.data
if data.data == 3:
self.x[6:9, :] = 0
else:
self.x[6:9, :] = 0.1
filter.x_[6:9, :] = 0


def model_callback(data):
Expand All @@ -93,7 +92,7 @@ def model_callback(data):
x[1] = data.pose[5].position.y
x[3] = data.twist[5].linear.x
x[4] = data.twist[5].linear.y
x[6:9] = 0.095
x[6:9] = 0.0
q[0] = data.pose[5].orientation.w
q[1] = 0
q[2] = 0
Expand Down
3 changes: 1 addition & 2 deletions src/shfaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, R=None, Q=None, P=None, x=None, q=None, window_width=12, a=0.
if Q is None:
Q = np.diag([0.06**2,0.06**2,0.06**2,0,0,0,0.1,0.1,0.1,0,0,0])
if P is None:
P = np.diag([0.05,0.05,0.05,0,0,0,0,0,0,0.1,0.1,0.1,0,0,0])
P = np.diag([0.05,0.05,0.05,0,0,0,0,0,0,0.01,0.01,0.01,0,0,0])
if x is None:
x = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
np.float) # position, velocity, acceleration bias, omega bias
Expand Down Expand Up @@ -159,7 +159,6 @@ def prediction(self, am, wm, t):
[np.zeros((3, 9), np.float), np.identity(3, np.float), np.zeros((3, 3), np.float)],
[np.zeros((3, 12), np.float), np.identity(3, np.float)]])
self.P_ = (F.dot(P.dot(F.T)) + self.lamb.dot(Q.dot(self.lamb.T)))
rospy.loginfo(x[6:9, :])
self.dx_ = F.dot(self.dx)
# self.innovation_ = push(self.innovation_, d)
self.k = self.k + 1
Expand Down
Binary file modified src/shfaf.pyc
Binary file not shown.

0 comments on commit c532f7a

Please sign in to comment.