Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Virtual Altimeter #6

Open
daftcube opened this issue Apr 6, 2024 · 0 comments · May be fixed by #21
Open

Create Virtual Altimeter #6

daftcube opened this issue Apr 6, 2024 · 0 comments · May be fixed by #21
Assignees
Labels
enhancement New feature or request

Comments

@daftcube
Copy link
Contributor

daftcube commented Apr 6, 2024

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 VirtualBarometer class
    • In its constructor, it should take...
      • long random_seed -- This is the seed of the random number generator
      • double altitude_of_launch_site -- The altitude of the launch site
      • double 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 condition get_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.
  • While this virtual barometer should use randomness to simulate measurement noise, do note that **rpl-sim should 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.

@daftcube daftcube added the enhancement New feature or request label Apr 6, 2024
@taanishr taanishr self-assigned this Apr 6, 2024
@taanishr taanishr linked a pull request Oct 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants