mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-12-16 17:28:04 +00:00
Major rework using rocketpy
This commit is contained in:
30
spatz/sensors/imu/h3lis100dl.py
Normal file
30
spatz/sensors/imu/h3lis100dl.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import numpy as np
|
||||
|
||||
from typing import List, AnyStr
|
||||
from numpy.core.numeric import identity as identity
|
||||
from numpy.typing import ArrayLike, NDArray
|
||||
|
||||
from spatz.dataset import Dataset
|
||||
from spatz.simulations.data_source import DataSource
|
||||
from spatz.logger import Logger
|
||||
from spatz.sensors import Accelerometer, CoordSystem
|
||||
from spatz.transforms import Transform
|
||||
|
||||
|
||||
class H3LIS100DL(Accelerometer):
|
||||
def __init__(self, dataset: DataSource, logger: Logger, orientation=np.identity(3), offset: float = 0, transforms: List[Transform] = []):
|
||||
super().__init__(dataset, logger, CoordSystem.RIGHT_HANDED, orientation, offset, transforms)
|
||||
|
||||
def _get_name(self) -> AnyStr:
|
||||
return "H3LIS100DL"
|
||||
|
||||
def _sensor_specific_effects(self, x: ArrayLike) -> ArrayLike:
|
||||
# The sensor only measures values between -100g and +100g and in g/LSB.
|
||||
g = 9.81
|
||||
x = np.floor(np.clip(x, -100*g, +100*g) / g)
|
||||
|
||||
return x
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user