Updated sensors and added empty logger for speedup

This commit is contained in:
dario
2024-06-13 22:16:22 +02:00
parent 382cb9aad4
commit c0ccd93acf
14 changed files with 5080 additions and 5035 deletions

View File

@@ -1,12 +1,16 @@
import cProfile
import numpy as np
import tqdm
import math
import matplotlib.pyplot as plt
from spatz.simulation import Simulation
from spatz.simulations.rocketpy import RocketPyCSV
from spatz.sensors.pressure.ms5611 import MS5611
from spatz.sensors.imu.wsen_isds import WSEN_ISDS_ACC, WSEN_ISDS_GYRO
from spatz.sensors.imu.h3lis100dl import H3LIS100DL
from spatz.sensors.gps.erinome1 import Erinome_I
from spatz.observer import Observer
simulation = Simulation().load(RocketPyCSV('nominal_wind.csv'))
@@ -15,13 +19,20 @@ barometer = simulation.add_sensor(MS5611)
# Orientation matrix of the WSEN-ISDS IMU on the rocket.
orientation = np.array([
[ 1, 0, 0],
[ 0, 0, -1],
[ 0, -1, 0]
[ 0, 1, 0],
[ 0, 0, 1],
[-1, 0, 0]
])
accelerometer = simulation.add_sensor(WSEN_ISDS_ACC, orientation=orientation)
gyroscope = simulation.add_sensor(WSEN_ISDS_GYRO)
orientation = np.array([
[0, 1, 0],
[0, 0, -1],
[1, 0, 0]
])
high_g = simulation.add_sensor(H3LIS100DL)
erinome = simulation.add_sensor(Erinome_I)
for i in tqdm.tqdm(range(5000)):
@@ -30,7 +41,7 @@ for i in tqdm.tqdm(range(5000)):
acc = accelerometer()
omegas = gyroscope()
g = high_g()
gps = erinome()
df = simulation.get_logger().get_dataframe()
df.to_csv('dummy2.csv')