Skip to main content

A Gym-compatible rocket simulator.

Project description

rocket_sim_6DOF

This is a Python Gym environment to simulate a 6 degrees of freedom rocket.

Features

  • full 6DOF rocket landing environment
  • realistic dynamics equation modeled on a rigid body assumption
  • interactive 3D visualization through PyVista
  • actuators available:
    1. thruster
    2. fins
  • Wandb logging wrapper

Continuous action space

The environment employes a continuous action space, with the engine allowed to throttle between maxThrust and minThrust. The thrust was normalized to lie in the range [-1, +1] as best practice for convergence of the algorithms suggest. The engine is gimbaled by two angles $\delta_y$ and $\delta_z$ around two hinge points, respectively moving the engine around the z and y axis.

Aerodynamic fins control

Research question:

  • Is there a reduction in fuel consumption when the thruster is aided by fins? Quantify it.

Actuator description

  • Pitch plane ( x - z ) corresponding to i={1,2}:

    • Diagram of the angles

    • Position vector of the fin i in body coordinates:

      $$ \vec{x}^{B,i} = \begin{bmatrix} x_{fin}^i \ \pm r_{base} \ 0 \end{bmatrix} $$

  • Yaw plane ( x - y ) corresponding to i={3,4}:

    • Diagram of the angles

    • Position vector of the fin i in body coordinates: $$\vec{x}^{B,i} = \begin{bmatrix}x_{fin}^i \ 0 \ \pm r_{base}\end{bmatrix}$$

Actuator control definition (x-y)

To compute the force generated by the fin i in body axis we have to:

  1. Neglecting wind, we can compute the air velocity of the center of mass of the vehicle as:

    $$ \vec{v}^B_{air} = R_{I \rightarrow B}\vec{v}^I$$

  2. Compute the velocity vector at each fin location i (denoted by its position vector in body coordinates $\vec{x}^{B,i}$), taking into account the rotation of the rocket:

    $$ \vec{v}^{B,i}{air} = \vec{v}^B{air} + \vec{\omega}^B \times \left[ \vec{x}^{B,i} - \vec{x}^{B,CG}\right] $$

  3. Compute the aerodynamic angles at the location of each fin i:

    • x-z plane aerodynamic angle:

      $$\alpha^i = \arctan 2 \left[ \frac{v_z^{B,i}}{v_x^{B,i}} \right]$$

    • x-y plane aerodynamic angle:

      $$ \beta^i = \arcsin \left[ \frac{v_y^{B,i}}{||\vec{v}^{B,i}||} \right] $$

  4. Input the angle of deflection from the longitudinal axis of the fin $\beta_{fin,i}$ (i.e. the control input).

  5. Compute the angle of attack $AoA$ of each fin i:

    • Yaw plane ( x - y ): $$AoA_i = -\beta_{fin,i} - \beta^i$$

    • Pitch plane ( x - z ): $$AoA_i = \beta_{fin,i} - \alpha^i$$

  6. Compute the aerodynamic pressure $$q=\frac{1}{2}\rho(x)||\vec{\vec{v}^{B,i}_{air}}||$$

  7. Compute the normal force coefficient $C_f$:

    $$ C_f(AoA_i)=\bar{C_f} \sin{AoA_i} $$

  8. Compute the aerodynamic force at each fin i:

    • Yaw plane ( x - y ):

      $$ \vec{F}^B_{fin,i} = qS_{fin}C_f\left(AoA_i\right) \begin{bmatrix} \sin{\beta_{fin,i}} & \cos{\beta_{fin,i}} & 0 \end{bmatrix}^T$$

    • Pitch plane ( x - z ):

      $$ \vec{F}^B_{fin,i} = qS_{fin}C_f\left(AoA_i\right) \begin{bmatrix} -\sin{\beta_{fin,i}} & 0 & \cos{\beta_{fin,i}} \end{bmatrix}^T$$

  9. Compute the aerodynamic torque for each fin i:

    $$ M^i = \left[ \vec{x}^{B,i} - \vec{x}^{B,CG}\right] \times \vec{F}^B_{fin,i} $$

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rl_rocket_sim-0.0.3.tar.gz (667.5 kB view details)

Uploaded Source

Built Distribution

rl_rocket_sim-0.0.3-py2.py3-none-any.whl (28.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file rl_rocket_sim-0.0.3.tar.gz.

File metadata

  • Download URL: rl_rocket_sim-0.0.3.tar.gz
  • Upload date:
  • Size: 667.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for rl_rocket_sim-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8f6d9b93f49024a0ac56fc60da4d9fecce7bc91b46c06386453d1fcbdabfbdaf
MD5 b5d6457f350f86f0d09f9f9ddff2392c
BLAKE2b-256 4f73897ac2b85d37928565dcdcd3cc36820d9543be01c25a0f1874dea9f17675

See more details on using hashes here.

File details

Details for the file rl_rocket_sim-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for rl_rocket_sim-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1a5c86dfc4d67dfa92b4266f62d10ea2e3c91cc212e88027474dfbaf6c59ebc1
MD5 692342e5cb90025872d3281bc5e49149
BLAKE2b-256 daa16e4c7159e3f1895afea238d26d85ed37081512b50e196ae4bfccd348efdf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page