Skip to content

Commit 63f5ee7

Browse files
committed
Merge branch 'smoothing-experimental' of https://github.com/4Subsea/smsfusion-python into smoothing-experimental
2 parents a1f1be2 + 3f405bf commit 63f5ee7

11 files changed

Lines changed: 28 additions & 74 deletions

File tree

.github/pull_request_template.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
### This PR is related to user story DLAB-
2-
31
## Description
42
Provide a short description about the work that has been done.
53

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
python-version: ["3.10", "3.11"]
16+
python-version: ["3.11", "3.12", "3.13"]
1717

1818
steps:
1919
- uses: actions/checkout@v4
@@ -36,4 +36,4 @@ jobs:
3636

3737
- name: Build documentation
3838
run: hatch run docs:build
39-
if: ${{ (matrix.python-version == '3.10') && (matrix.os == 'ubuntu-latest')}}
39+
if: ${{ (matrix.python-version == '3.12') && (matrix.os == 'ubuntu-latest')}}

.github/workflows/deploy_public.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v4
3737

38-
- name: Set up Python 3.10
38+
- name: Set up Python 3.12
3939
uses: actions/setup-python@v5
4040
with:
41-
python-version: "3.10"
41+
python-version: "3.12"
4242

4343
- name: Install dependencies
4444
run: |

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ authors = [
99
]
1010
description = "Sensor fusion algorithms and utilities for SMS Motion"
1111
readme = "README.md"
12-
requires-python = ">=3.10"
12+
requires-python = ">=3.11"
1313
classifiers = [
14-
"Programming Language :: Python :: 3.10",
1514
"Programming Language :: Python :: 3.11",
15+
"Programming Language :: Python :: 3.12",
16+
"Programming Language :: Python :: 3.13",
1617
"License :: OSI Approved :: MIT License",
1718
"Operating System :: OS Independent",
1819
]

src/smsfusion/_ins.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any
3+
from typing import Any, Self
44

55
import numpy as np
66
from numba import njit
@@ -451,7 +451,7 @@ def update(
451451
f_imu: ArrayLike,
452452
w_imu: ArrayLike,
453453
degrees: bool = False,
454-
) -> "StrapdownINS": # TODO: Replace with ``typing.Self`` when Python > 3.11:
454+
) -> Self:
455455
"""
456456
Update the INS states by integrating the *strapdown navigation equations*.
457457
@@ -956,7 +956,7 @@ def update(
956956
head_degrees: bool = True,
957957
g_ref: bool = False,
958958
g_var: ArrayLike | None = None,
959-
) -> "AidedINS": # TODO: Replace with ``typing.Self`` when Python > 3.11
959+
) -> Self:
960960
"""
961961
Update/correct the AINS' state estimate with aiding measurements, and project
962962
ahead using IMU measurements.
@@ -1198,7 +1198,7 @@ def update(
11981198
degrees: bool = False,
11991199
pos_var: ArrayLike = np.array([1e6, 1e6, 1e6]),
12001200
vel_var: ArrayLike = np.array([1e2, 1e2, 1e2]),
1201-
) -> "VRU": # TODO: Replace with ``typing.Self`` when Python > 3.11
1201+
) -> Self:
12021202
"""
12031203
Update/correct the VRU's state estimate with pseudo aiding measurements
12041204
(i.e., zero velocity and zero position with corresponding variances), and
@@ -1333,7 +1333,7 @@ def update(
13331333
head_degrees: bool = True,
13341334
pos_var: ArrayLike = np.array([1e6, 1e6, 1e6]),
13351335
vel_var: ArrayLike = np.array([1e2, 1e2, 1e2]),
1336-
) -> "AHRS": # TODO: Replace with ``typing.Self`` when Python > 3.11
1336+
) -> Self:
13371337
"""
13381338
Update/correct the AHRS' state estimate with pseudo aiding measurements
13391339
(i.e., zero velocity and zero position with corresponding variances), and

src/smsfusion/benchmark/_benchmark.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def benchmark_pure_attitude_beat_202311A(
351351
Generate a benchmark with pure attitude for performance testing of INS/AHRS/VRU
352352
sensor fusion algorithms.
353353
354-
The benchmark scenario is 20 minutes long. It generates Euler angles
354+
The benchmark scenario is 30 minutes long. It generates Euler angles
355355
(roll, pitch, and yaw), and the corresponding accelerometer and
356356
gyroscope signals. Note that the generated motion is pure rotations.
357357
@@ -395,7 +395,7 @@ def benchmark_pure_attitude_beat_202311A(
395395
Passive rotations mean that the frame itself is rotating, not the object
396396
within the frame.
397397
"""
398-
duration = 1200.0 # 20 minutes
398+
duration = 1800.0 # 30 minutes
399399
amplitude = np.radians(np.array([0.0, 0.0, 0.0, 5.0, 5.0, 5.0]))
400400
mean = np.radians(np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
401401
phase = np.radians(np.array([0.0, 0.0, 0.0, 0.0, 45.0, 90.0]))
@@ -418,7 +418,7 @@ def benchmark_pure_attitude_chirp_202311A(
418418
Generate a benchmark with pure attitude for performance testing of INS/AHRS/VRU
419419
sensor fusion algorithms.
420420
421-
The benchmark scenario is 20 minutes long. It generates Euler angles
421+
The benchmark scenario is 30 minutes long. It generates Euler angles
422422
(roll, pitch, and yaw), and the corresponding accelerometer and
423423
gyroscope signals. Note that the generated motion is pure rotations.
424424
@@ -463,7 +463,7 @@ def benchmark_pure_attitude_chirp_202311A(
463463
Passive rotations mean that the frame itself is rotating, not the object
464464
within the frame.
465465
"""
466-
duration = 1200.0 # 20 minutes
466+
duration = 1800.0 # 30 minutes
467467
amplitude = np.radians(np.array([0.0, 0.0, 0.0, 5.0, 5.0, 5.0]))
468468
mean = np.radians(np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
469469
phase = np.radians(np.array([0.0, 0.0, 0.0, 0.0, 45.0, 90.0]))
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_benchmark.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,12 @@ def test_pure_translation(self):
302302

303303
def test_benchmark_pure_attitude_beat_202311A():
304304
signature_signal, _, _ = benchmark.BeatSignal(0.1, 0.01)(
305-
np.arange(0.0, 1200.0, 1.0 / 10.24)
305+
np.arange(0.0, 1800.0, 1.0 / 10.24)
306306
)
307307

308308
t, euler, acc, gyro = benchmark.benchmark_pure_attitude_beat_202311A()
309309

310-
assert len(t) == int(1200 * 10.24)
310+
assert len(t) == int(1800 * 10.24)
311311
assert euler.shape == (len(t), 3)
312312
assert acc.shape == (len(t), 3)
313313
assert gyro.shape == (len(t), 3)
@@ -317,12 +317,12 @@ def test_benchmark_pure_attitude_beat_202311A():
317317

318318
def test_benchmark_pure_attitude_chirp_202311A():
319319
signature_signal, _, _ = benchmark.ChirpSignal(0.25, 0.01)(
320-
np.arange(0.0, 1200.0, 1.0 / 10.24)
320+
np.arange(0.0, 1800.0, 1.0 / 10.24)
321321
)
322322

323323
t, euler, acc, gyro = benchmark.benchmark_pure_attitude_chirp_202311A()
324324

325-
assert len(t) == int(1200 * 10.24)
325+
assert len(t) == int(1800 * 10.24)
326326
assert euler.shape == (len(t), 3)
327327
assert acc.shape == (len(t), 3)
328328
assert gyro.shape == (len(t), 3)

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

0 commit comments

Comments
 (0)