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 Fluid Generator class #304

Closed
DFriend01 opened this issue May 3, 2023 · 0 comments · Fixed by #328 · May be fixed by UBCSailbot/boat_simulator#79
Closed

Create Fluid Generator class #304

DFriend01 opened this issue May 3, 2023 · 0 comments · Fixed by #328 · May be fixed by UBCSailbot/boat_simulator#79
Assignees
Labels
enhancement New feature or request sim Boat Simulator team

Comments

@DFriend01
Copy link
Contributor

DFriend01 commented May 3, 2023

Purpose

To implement the Python class that perform the fluid simulation for wind and current. See this confluence page for more details.

Description

Refer to the FluidGenerator class, found in boat_simulator/nodes/physics_engine/fluid_generation.py, which you will use to implement this issue.

The class named FluidGenerator has the following properties:

  • Class Attributes:
    • generator is the random number generator used to generate the fluid velocity. Take a look at the VectorGenerator and MVGaussianGenerator generator classes in boat_simulator/common/generators.py.
    • velocity is a 2D numpy array representing the fluid velocity.
  • Class Methods
    • FluidGenerator is a constructor that accepts the random number generator as an argument.
    • next is a function that accepts no arguments and updates the fluid simulator by generating the next velocity vector.
    • velocity is a property function that returns the most recently generated velocity vector.
    • speed is a property function that returns the fluid's speed derived from the velocity (magnitude).
    • direction is a property function that returns the direction of the fluid velocity, following the [-180, 180) convention. Use the bound_to_180 function from boat_simulator/common/utils.py.

Tests

Add your unit tests to tests/unit/nodes/physics_engine/. You will use the pytest API for testing, which is already installed.

Once complete, make a pull request to the main branch.

Resources

@DFriend01 DFriend01 added the enhancement New feature or request label May 3, 2023
@DFriend01 DFriend01 assigned stevenxu27 and unassigned stevenxu27 Oct 21, 2023
@stevenxu27 stevenxu27 self-assigned this Oct 21, 2023
@eomielan eomielan changed the title Create Fluid Simulation classes Create Fluid Simulation class Feb 4, 2024
@eomielan eomielan changed the title Create Fluid Simulation class Create Fluid Generator class Feb 4, 2024
@patrick-5546 patrick-5546 added the sim Boat Simulator team label Mar 9, 2024
@DFriend01 DFriend01 transferred this issue from UBCSailbot/boat_simulator Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sim Boat Simulator team
Projects
Archived in project
4 participants