Skip to content

Commit 41f7bf5

Browse files
enh: update default values for SMS Motion Gen 2 noise parameters to latest official (#87)
1 parent a80c8e0 commit 41f7bf5

4 files changed

Lines changed: 8 additions & 53 deletions

File tree

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from ._constants import (
2-
ERR_ACC_MOTION1,
32
ERR_ACC_MOTION2,
4-
ERR_GYRO_MOTION1,
53
ERR_GYRO_MOTION2,
64
P0,
75
)
86

97
__all__ = [
10-
"ERR_ACC_MOTION1",
118
"ERR_ACC_MOTION2",
12-
"ERR_GYRO_MOTION1",
139
"ERR_GYRO_MOTION2",
1410
"P0",
1511
]
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
import numpy as np
22

3-
ERR_ACC_MOTION1 = {
4-
"N": 0.004, # (m/s^2)/sqrt(Hz)
5-
"B": 0.0007, # m/s^2
6-
"tau_cb": 50.0, # s
7-
}
8-
9-
ERR_GYRO_MOTION1 = {
10-
"N": 0.00009, # (rad/s)/sqrt(Hz)
11-
"B": 0.00003, # rad/s
12-
"tau_cb": 50.0, # s
13-
}
3+
P0 = np.eye(12) * 1e-6
144

5+
# Noise and bias parameters for SMS Motion Gen 2
156
ERR_ACC_MOTION2 = {
167
"N": 0.0007, # (m/s^2)/sqrt(Hz)
178
"B": 0.0005, # m/s^2
@@ -20,8 +11,6 @@
2011

2112
ERR_GYRO_MOTION2 = {
2213
"N": 0.00005, # (rad/s)/sqrt(Hz)
23-
"B": 0.00003, # rad/s
14+
"B": 0.00005, # rad/s
2415
"tau_cb": 50.0, # s
2516
}
26-
27-
P0 = np.eye(12) * 1e-6

tests/test_constants.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,6 @@
44
from smsfusion import constants
55

66

7-
def test_ERR_ACC_MOTION1():
8-
err_expect = {
9-
"N": 0.004,
10-
"B": 0.0007,
11-
"tau_cb": 50.0,
12-
}
13-
14-
err_out = constants.ERR_ACC_MOTION1
15-
16-
assert set(err_out.keys()) == set(err_expect.keys())
17-
18-
for key_i in err_expect:
19-
assert err_out[key_i] == approx(err_expect[key_i])
20-
21-
22-
def test_ERR_GYRO_MOTION1():
23-
err_expect = {
24-
"N": 0.00009,
25-
"B": 0.00003,
26-
"tau_cb": 50.0,
27-
}
28-
29-
err_out = constants.ERR_GYRO_MOTION1
30-
31-
assert set(err_out.keys()) == set(err_expect.keys())
32-
33-
for key_i in err_expect:
34-
assert err_out[key_i] == approx(err_expect[key_i])
35-
36-
377
def test_ERR_ACC_MOTION2():
388
err_expect = {
399
"N": 0.0007,
@@ -52,7 +22,7 @@ def test_ERR_ACC_MOTION2():
5222
def test_ERR_GYRO_MOTION2():
5323
err_expect = {
5424
"N": 0.00005,
55-
"B": 0.00003,
25+
"B": 0.00005,
5626
"tau_cb": 50.0,
5727
}
5828

tests/test_noise.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ def test__init__default(self):
122122
assert noise._seed is None
123123

124124
def test__init__constants(self):
125-
noise = NoiseModel(**sf.constants.ERR_ACC_MOTION1)
126-
assert noise._N == sf.constants.ERR_ACC_MOTION1["N"]
127-
assert noise._B == sf.constants.ERR_ACC_MOTION1["B"]
128-
assert noise._tau_cb == sf.constants.ERR_ACC_MOTION1["tau_cb"]
125+
noise = NoiseModel(**sf.constants.ERR_ACC_MOTION2)
126+
assert noise._N == sf.constants.ERR_ACC_MOTION2["N"]
127+
assert noise._B == sf.constants.ERR_ACC_MOTION2["B"]
128+
assert noise._tau_cb == sf.constants.ERR_ACC_MOTION2["tau_cb"]
129129
assert noise._K is None
130130
assert noise._tau_ck is None
131131
assert noise._bc == 0.0

0 commit comments

Comments
 (0)