Skip to content

Create Virtual Altimeter #6

@daftcube

Description

@daftcube

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions