-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
Phoenix uses a barometric pressure sensor to derive its altitude. This sensor is critical for knowing when to deploy the parachute.
Because the altimeter uses barometric pressure to derive altitude, there will be some noise and some error. Our goal here is to create a 'virtual' altimeter that, given the true position of the rocket in the simulation, outputs a noisy and less certain estimate.
This is essentially a one-dimensional version of #2. Unlike the virtual GPS, this sensor is not rate-limited.
Requirements
- Create a
VirtualBarometerclass- In its constructor, it should take...
long random_seed-- This is the seed of the random number generatordouble altitude_of_launch_site-- The altitude of the launch sitedouble noise-- The maximum magnitude of error.
- It should have a
double get_reported_altitude(double deltaTime)function that produces an estimate of altitude that is noisy based on the input parameters.- For any given
deltaTime1=deltaTime2, this function must have the conditionget_reported_altitude(deltaTime1)== get_reported_altitude(deltaTime2). In other words, calling this function multiple times for the same simulation step should produce the same result. It should only produce a different result every step.
- For any given
- In its constructor, it should take...
- While this virtual barometer should use randomness to simulate measurement noise, do note that **
rpl-simshould be deterministic between runs.` In other words, on a given machine, running the simulation with the same input parameters should always produce the same output.
Testing
This should be thoroughly unit tested. Determinism should also be something you should test for.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request