Skip to main content

OrLab is a Python module designed for interacting and scripting with OpenRocket, with enhanced capabilities for simulations and computational workflows.

Project description

orlab

orlab is a Python module designed to simplify interaction and scripting with OpenRocket from Python. It leverages JPype to bridge Python and Java, enabling seamless control over OpenRocket's functionalities. Currently, it supports access to simulation capabilities given an .ork file, with the goal of future expansion to enable more sophisticated computational engineering workflows.

This project is an evolution of the original orhelper library, which hasn't been maintained recently and is limited in scope. orlab updates the compatibility with OpenRocket 23.09, reorganizes the code for better structure, and plans to incorporate additional features.

Table of Contents

Prerequisites

Before installing orlab, ensure you have the following installed on your system:

  • OpenRocket version 23.09
  • Adoptium JDK 21 LTS or higher
  • Python version 3.6 or higher

Installation

  1. Clone the Repository

    git clone https://github.com/CameronBrooks11/orlab.git
    cd orlab
    
  2. Install the Package

    Install orlab using pip:

    pip install .
    

    For development purposes, you can install in editable mode:

    pip install -e .
    
  3. Download OpenRocket JAR

    If you haven't already, download the OpenRocket .jar file:

    • Direct Download: OpenRocket-23.09.jar

    • Using wget on Linux:

      wget https://github.com/openrocket/openrocket/releases/download/release-23.09/OpenRocket-23.09.jar
      
  4. Set the CLASSPATH Environment Variable

    Ensure that the CLASSPATH includes the path to the OpenRocket .jar file. This step is only necessary if the .jar file is not located in the current directory.

    export CLASSPATH=/path/to/OpenRocket-23.09.jar
    

    Replace /path/to/ with the actual directory path where the .jar file is located.

Setting Up the JDK

Linux

  1. Install Adoptium JDK 21 LTS

    Download and install the Adoptium JDK from the official website. Check the option to set / override JAVA_HOME, unless you have a specific reason not to in which you will need to define MANUAL_JVM_PATH in your code.

  2. Set the JAVA_HOME Environment Variable

    If JPype doesn't automatically detect the JDK, manually set the JAVA_HOME environment variable:

    • Find Installation Directory:

      Locate where Adoptium JDK is installed, e.g., /usr/lib/jvm/adoptium-21.

    • Edit ~/.bashrc:

      Open the .bashrc file with your preferred text editor:

      nano ~/.bashrc
      
    • Add the Following Line:

      export JAVA_HOME="/usr/lib/jvm/adoptium-21"
      
    • Apply Changes:

      source ~/.bashrc
      

Windows

  1. Install Adoptium JDK 21 LTS

    Download and install the Adoptium JDK from the official website.

  2. Set Environment Variables

    • Open Environment Variables Settings:

      Navigate to Control Panel > System > Advanced system settings > Environment Variables.

    • Add JAVA_HOME:

      • Click on New under System variables.
      • Set Variable name to JAVA_HOME.
      • Set Variable value to the path where Adoptium JDK is installed, e.g., C:\Program Files\Eclipse Adoptium\jdk-21.
    • Update PATH:

      • Select the Path variable and click Edit.
      • Click New and add %JAVA_HOME%\bin.
    • Apply and Close:

      Click OK to apply the changes.

Usage

After installation and setup, you can start using orlab to interact with OpenRocket. Refer to the examples/ directory for sample scripts demonstrating various functionalities.

For more detailed information and advanced usage, consult the OpenRocket Wiki on Scripting with Python and JPype.

Development

If you wish to contribute or modify orlab, follow these steps:

  1. Clone the Repository

    git clone https://github.com/yourusername/orlab.git
    cd orlab
    
  2. Install Dependencies in Editable Mode

    pip install -e .
    
  3. Make Your Changes

    Modify the codebase as needed. Ensure that your changes are well-documented and tested.

  4. Run Tests

    (Assuming tests are set up)

    pytest
    
  5. Submit a Pull Request

    Push your changes to a forked repository and submit a pull request for review.

Credits

  • The original orhelper project by SilentSys
    • Richard Graham for the original script: Source
    • @not7cd for initial organization and cleanup: Source
  • All contributors to the OpenRocket project over the years

Feel free to contribute, report issues, or suggest enhancements!

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

orlab-0.2.5.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orlab-0.2.5-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file orlab-0.2.5.tar.gz.

File metadata

  • Download URL: orlab-0.2.5.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for orlab-0.2.5.tar.gz
Algorithm Hash digest
SHA256 58511eb60541aa51cdbd97ffbace32813df6a4ca7351597b1f0757950cc53945
MD5 1b823d638876ef5fb078f849a852af7f
BLAKE2b-256 86124cc6207b0690516df8d9f314d77e58e64259a4339fa868e0ee7b9888ac75

See more details on using hashes here.

File details

Details for the file orlab-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: orlab-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for orlab-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1999ecc502473755e2c4b52676866cf74837c0ff55b9854260ce6c14df81800f
MD5 5af635e0e52e8d883cb53dc0ce0cf80b
BLAKE2b-256 ba07d4fdb5605ca3c46f3fac1c99d7d8b5e1898c0098778a887c5b9ce01a7dc8

See more details on using hashes here.

Supported by

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