serivesmejia / EOCV-Sim

FTC Library EasyOpenCV simulator for testing vision pipelines in a computer
MIT License
12 stars 8 forks source link
easyopencv ftc opencv sim simulator

Java CI with Gradle Run on Repl.it

EOCV-Sim has been migrated to a new repo in the DeltaCV organization

DO NOT USE THIS REPO AS IT'S NO LONGER UPDATED, ALL FUTURE UPDATES WILL BE MADE IN THE NEW AFOREMENTIONED REPO

DO NOT FOLLOW THE INSTRUCTIONS BELOW EITHER, THIS README IS KEPT FOR HISTORIC PURPOSES

Welcome!

EOCV-Sim (EasyOpenCV Simulator) is a straightforward way to test your pipelines in a simple user interface directly in your computer, simulating the EasyOpenCV library & a bit of FTC SDK structure, allowing you to simply copy paste directly your pipeline code once you want to transfer it onto your robot!

If you'd like to learn how to use the simulator, you can find a complete usage explaination here

Compatibility

Since OpenCV in Java uses a native library, which is platform specific, the simulator is currently limited to the following platforms:

Installation

1) Download & install the Java Development Kit if you haven't already:

JDK 8 is the minimum required one, any JDK above that version will probably work fine.
You can download it from the Oracle webpage, and here is a step by step video of the installation process

Recommended method

1) Make sure you have downloaded a JDK as mentioned above

2) Go to the releases page on this repo and find the latest version (or click here)

3) Download the jar file, named EOCV-Sim-X.X.X-all.jar, available at the bottom on the "assets" section

4) Choose and install an IDE/text editor

The recommended text editor is VS Code, with the Java Extension Pack. EOCV-Sim provides direct support for it, for creating a "VS Code Workspace" from a template, although it can also be imported into IntelliJ IDEA since it's just a normal Gradle project.

  This installation method provides the benefit of "runtime compiling", which means that the user pipelines are compiled and loaded on the fly and therefore the changes made in code can be reflected immediately, as opposed to the [old IntelliJ IDEA method](#altenative-installation-method-intellij-idea) in which the simulator had to be closed, compiled and then opened again to apply the smallest change made in a pipeline. Plus, VS Code is a lightweight editor which provides Java syntax highlighting and IntelliSense with the Java Extension Pack, making development of pipelines easy with tools like code completion.

 You can download and install VS Code from the [Visual Studio page](https://code.visualstudio.com/). The [Java Extension Pack](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) can be installed from the [VS Code extension marketplace](https://code.visualstudio.com/docs/introvideos/extend).

 Here's a [tutorial video](https://www.youtube.com/watch?v=KwnavHTOBiA) explaining how to download and install VS Code & the Java Extension Pack

5) Running EOCV-Sim

For running the sim, simply double click the jar file downloaded from the releases page, or it can also be executed from the command line:

     java -jar "EOCV-Sim-X.X.X-all.jar"
 When running on Linux (distros such as Ubuntu, Linux Mint, etc) or Unix-like secure operating systems, it might prohibit you to run it by double clicking the file from a file explorer. This can be fixed by giving execute permissions to the jar file with the following command
 ```bash
 chmod +x EOCV-Sim-X.X.X-all.jar
 ```

Now the sim should be running without any issues! If you find any problem feel free to open an issue, and check the usage explanation for more details about how to use the simulator (and VS Code).

Altenative installation method (IntelliJ IDEA)

No complicated setup is required for this method either, it's straight up importing the EOCV-Sim project into IntelliJ IDEA:

*The downside of this method is that this repo has grown to a considerable amount of space, due to a bloated history, and takes some time to clone, and also builds can be slower depending on your device.

1) Make sure you have downloaded a JDK as mentioned here

2) Download & install IntelliJ IDEA Community IDE if you haven't already:

You can download it from the JetBrains webpage
Here is another great step by step video for IntelliJ installation.

3) Clone and import the project:

  1) Open IntelliJ IDEA and in the main screen click on "Get from Version Control"<br/>

        <img src='doc/images/eocvsim_screenshot_installation_1.png' width='399' height='249'><br/><br/>
     Alternatively, if you already had another project opened, go to File > New > Project from Version Control...<br/><br/>
        <img src='doc/images/eocvsim_screenshot_installation_2.png' width='419' height='76'>

  2) Another window will show up for cloning and importing a repository into IntelliJ<br/>

     1) In the "URL" field, enter: ```https://github.com/serivesmejia/EOCV-Sim.git```<br/>
     2) The directory can be changed, but it will be automatically filled so it's not necessary.
     3) Make sure the "Version control" is set to "Git".<br/><br/>
        <img src='doc/images/eocvsim_screenshot_installation_3.png' width='50%' height='50%'><br/>
     4) After that, click on the "Clone" button, located at the bottom right and the cloning process will begin...<br/>    
        <img src='doc/images/eocvsim_screenshot_installation_4.png' width='50%' height='50%'><br/>
     5) After the cloning finishes, the project should automatically import and you'll have something like this:<br/><br/>
        <img src='doc/images/eocvsim_screenshot_installation_5.png' width='75%' height='75%'><br/>

And you're ready to go! Refer to the usage explanation for further details on how to utilize the simulator.

From the command-line

1) Clone EOCV-Sim repo and cd to the cloned folder

 git clone https://github.com/serivesmejia/EOCV-Sim.git
 cd EOCV-Sim

*Or it can also be manually downloaded as a ZIP file from GitHub

2) Run EOCV-Sim through gradle:

 gradlew runSim

*On some command lines (like Windows PowerShell) you might need to execute "./gradlew" instead

And that's it! You might need to wait a bit for gradle to download all the dependencies but EOCV-Sim will open eventually.

From repl.it

1) Click here to go to repl.it, you might require to create an account if you haven't already. Once you do that, it will automatically create a new project and start cloning the EOCV-Sim repo.

2) After the cloning is finished, click on the green "Run" button at the top and EOCV-Sim should start.

*Please note that this method is not widely supported and you might run into some issues or lack of some functionality.

Adding EOCV-Sim as a dependency

Gradle

   repositories {
       maven { url 'https://jitpack.com' } //add jitpack as a maven repo 
   }

   dependencies {
      implementation 'com.github.serivesmejia:EOCV-Sim:3.0.0' //add the EOCV-Sim dependency
   }

Maven

Adding the jitpack maven repo

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

Adding the EOCV-Sim dependecy

    <dependency>
        <groupId>com.github.serivesmejia</groupId>
        <artifactId>EOCV-Sim</artifactId>
        <version>3.0.0</version>
    </dependency>

Contact

For any quick troubleshooting or help, you can find me on Discord as serivesmejia#8237 and on the FTC discord server. I'll be happy to assist you in any issue you might have :)

For bug reporting or feature requesting, use the issues tab in this repository.

Change logs

v3.0.0 - Compiling on the fly! Yay!

v2.2.1 - JVM crashing hotfix

v2.2.0 - Variable Tuner Upgrade

v2.1.0 - Video Update

v2.0.2 - TaskBar hotfix

v2.0.1 - BooleanField hotfix

v2.0.0 - Major Update

v1.1.0 - Telemetry Update

v1.0.0 - Initial Release