Generated new simulation

This commit is contained in:
dario 2024-07-21 19:05:10 +02:00
parent 43bc71c742
commit 8b12d6e400
9 changed files with 7061 additions and 1957 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -18,17 +18,12 @@ class BMI088(IMU):
class BMI088Gyro(Gyroscope): class BMI088Gyro(Gyroscope):
def __init__(self, dataset: Dataset, logger: Logger, offset: float = 0, transforms: List[Transform] = []): def __init__(self, dataset: Dataset, logger: Logger, orientation=np.identity(3), transforms: List[Transform] = []):
super().__init__(dataset, logger, offset, transforms) super().__init__(dataset, logger, orientation, transforms)
def _get_name(self) -> AnyStr: def _get_name(self) -> AnyStr:
return 'BMI088' return 'BMI088'
def _get_data(self) -> ArrayLike:
rots = self._dataset.fetch_values(['roll_l', 'pitch_l', 'yaw_l'])
return rots
def _sensor_specific_effects(self, x: ArrayLike) -> ArrayLike: def _sensor_specific_effects(self, x: ArrayLike) -> ArrayLike:
return x return x

View File

@ -23,9 +23,6 @@ class MS5611(PressureSensor):
def _sensor_specific_effects(self, x: ArrayLike | float) -> ArrayLike | float: def _sensor_specific_effects(self, x: ArrayLike | float) -> ArrayLike | float:
t = self._dataset.get_time() t = self._dataset.get_time()
# Transform from Pa to hPa
x /= 1e2
noisy = self.__noise(t, x) # self.__pad_noise(t, x) if self._dataset.get_phase() == Phase.ONPAD else self.__flight_noise(t, x) noisy = self.__noise(t, x) # self.__pad_noise(t, x) if self._dataset.get_phase() == Phase.ONPAD else self.__flight_noise(t, x)
# Log the noise added to the pressure measurements. # Log the noise added to the pressure measurements.

View File

@ -0,0 +1,53 @@
import numpy as np
from typing import Literal
from numpy.typing import NDArray
from spatz.simulations.csv_source import CSVSource
class ASTOSSource(CSVSource):
def __init__(self, path: str, interpolation: Literal['linear'] = 'linear') -> None:
super().__init__(path, 'time', interpolation)
def get_length(self) -> float:
pass
def get_position(self) -> NDArray:
return self.fetch_values(['x', 'y', 'z'])
def get_velocity(self, frame: Literal['global', 'local']) -> NDArray:
if frame == 'local':
pass
return self.fetch_values(['vx', 'vy', 'vz'])
def get_acceleration(self, frame: Literal['global', 'local']) -> NDArray:
if frame == 'local':
pass
return self.fetch_values(['ax', 'ay', 'az'])
def get_attitude(self) -> NDArray:
pass
def local_to_global(self) -> NDArray:
pass
def global_to_local(self) -> NDArray:
pass
def get_angular_velocity(self) -> NDArray:
pass
def get_static_pressure(self) -> float:
pass
def get_longitude(self) -> float:
pass
def get_latitude(self) -> float:
pass
def get_altitude(self) -> float:
pass

File diff suppressed because one or more lines are too long