mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-12-17 01:38:02 +00:00
Added first simple GPS implementation
This commit is contained in:
18
demo.ipynb
18
demo.ipynb
@@ -88,12 +88,16 @@
|
||||
"source": [
|
||||
"from spatz.sensors.imu.wsen_isds import WSEN_ISDS_ACC, WSEN_ISDS_GYRO\n",
|
||||
"from spatz.sensors.pressure.ms5611_01ba03 import MS5611_01BA03\n",
|
||||
"from spatz.sensors.gps.erinome1 import Erinome_I\n",
|
||||
"\n",
|
||||
"press_sensor = simulation.add_sensor(MS5611_01BA03)\n",
|
||||
"\n",
|
||||
"# Use the offset argument to change the position of the imu in relation to the rocket's center of gravity.\n",
|
||||
"accelerometer = simulation.add_sensor(WSEN_ISDS_ACC, offset=0)\n",
|
||||
"gyro = simulation.add_sensor(WSEN_ISDS_GYRO, offset=0)"
|
||||
"gyro = simulation.add_sensor(WSEN_ISDS_GYRO, offset=0)\n",
|
||||
"\n",
|
||||
"# Add a GPS module to the simulation which returns the following data: [latitude, longitude, altitude (km)]\n",
|
||||
"gps_module = simulation.add_sensor(Erinome_I)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -171,10 +175,6 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from spatz.metrics import Metric\n",
|
||||
"\n",
|
||||
"metric = Metric()\n",
|
||||
"\n",
|
||||
"logger = simulation.get_logger()\n",
|
||||
"\n",
|
||||
"# Set verbose to False to disable the progress bar\n",
|
||||
@@ -183,16 +183,12 @@
|
||||
" press = press_sensor()\n",
|
||||
" acc = accelerometer()\n",
|
||||
" rot_rate = gyro()\n",
|
||||
" gps = gps_module()\n",
|
||||
"\n",
|
||||
" # Get the correct altitude data.\n",
|
||||
" alt = altitude()\n",
|
||||
"\n",
|
||||
" pred_alt = ...\n",
|
||||
" metric(alt, pred_alt)\n",
|
||||
"\n",
|
||||
" # TODO: Add your computation here.\n",
|
||||
"\n",
|
||||
"print('Score was:', metric.get_score())"
|
||||
" # TODO: Add your computation here."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user