Giter Club home page Giter Club logo

eocv-sim's Introduction

Java CI with Gradle Run on Repl.it

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:

  • Windows x64 (tested)
  • Windows x32 (untested)
  • MacOS x64 (tested)
  • Linux x64 (tested for Ubuntu 20.04)

Installation

Recommended installation method (IntelliJ IDEA)

No complicated setup is required, straight up importing the project into IntelliJ IDEA:

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

    JDK 9 is the minimum required one, although it's not available for download so 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

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

    You can download it from the JetBrains webpage (https://www.jetbrains.com/idea/download/)
    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"



      Alternatively, if you already had another project opened, go to File > New > Project from Version Control...

    2. Another window will show up for cloning and importing a repository into IntelliJ

      1. In the "URL" field, enter: https://github.com/serivesmejia/EOCV-Sim.git
      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".


      4. After that, click on the "Clone" button, located at the bottom right and the cloning process will begin...


      5. After the cloning finishes, the project should automatically import and you'll have something like this:


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

  1. 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:2.1.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>2.1.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

  • This is the 8th release for EOCV-Sim

    • Changelog:

      • Removed "Java memory" message in the title since it's practically useless for the end user
      • Updated to Gradle 7.0 for Java 16+ support (#25)
    • Bugfixes:

      • Fixed JVM crashing error caused by releasing all mats in a MatRecycler finalization (#26)
      • Improved memory usage by deleting unused BufferedImageRecyclers, memory is now slightly freed when allocating or recycling buffered images of different sizes (which means that the memory usage is reduced a little bit when zooming in the viewport)
  • This is the 7th release for EOCV-Sim

    • Changelog:

      • Pipelines now have a timeout all of the three methods so that the main loop doesn't get compromised due to a "stuck" pipeline (using kotlin coroutines)
      • processFrame has a timeout of 4.2 seconds
      • init is executed in the same scope as processFrame, when it has to be called, the timeout is doubled (16.4)
      • When either processFrame or init methods timeout, the sim automatically falls back to the default pipeline and discards any frame that the old timeouted pipeline could return.
      • onViewportTapped is still called from the U.I Thread, but it now has a timeout of 4.2 seconds too
      • Added EnumField which handles the type Enum (accepts all classes of type enum, including the ones declared by the user)
      • Major improvements to the variable tuner, added new features for color picking, tuning with sliders, configuration... See usage explanation for further details.
      • GUI improvement: Dropped some external dialogs in favor of simple "popups" for more practicality
      • Internals:
        • Continued rewrite to kotlin
        • Splitted visualizer class components into different classes
        • Improved EventHandler doOnce listeners
  • This is the 6th release for EOCV-Sim

    • Changelog:

      • Added support for VideoSources! You can now input your pipeline with a moving video (*.avi format is the most supported and tested, other codecs might depend on the OS you're using)
      • Added support for video recording, accessible at the bottom of the pipeline selector. Save format is AVI
      • Added a new TunableField type: RectField, which handles the OpenCV type "Rect" (might be useful for rect pipelines 👀)
      • Improved uncaught exception handling and added a crash report generator
      • Added support for more themes from FlatLaf
      • Added new config option to change the output video recording size
      • Added support for EOCV's TimestampedOpenCvPipeline
      • Internals:
        • Major rewrite to kotlin! (Still mostly Java but that might change soon)
        • A bit of code cleaning and restructuring
  • This is the 5th release for EOCV-Sim.

    • Bugfixes:

      • Fixes UnsupportedOperationException with the TaskBar API in some operating system
  • This is the 4th release for EOCV-Sim.

    • Bugfixes:

      • Fixes ArrayIndexOutOfBoundsException when initial value of a boolean field was true which would make the sim enter into a frozen state.
  • This is the 3rd release for EOCV-Sim.

    • Changelog:

      • Gradle is now used as the main build system
      • Added variable tuner for public non-final supported fields in the pipeline, accessible on the bottom part of the image viewport.
      • Pipeline pause and resume option to save resources, pauses automatically with image sources for one-shot analysis
      • Top Menu bar containing new features/convenient shortcuts:
        • Save Mat to disk option in File submenu
        • Restart feature in File submenu
        • Shortcut for creating input sources under File -> New -> Input Source
        • Settings menu under Edit submenu
        • "About" information screen under Help submenu
        • Appereance themes via the FlatLaf library, selectable in the settings window
      • Telemetry now is passed to the pipeline via the constructor rather than an instance variable, check usage explaination for further details
      • Mat visualizing into the viewport is now handled in another thread to improve performance
      • Pipeline FPS are now capped at 30
      • Zooming viewport is now supported, using mouse wheel while holding Ctrl key
    • Bugfixes:

      • Removed call to the gc in the main loop due to performance issues
      • Fixed BufferedImage mem leak by recycling previously used buffered images and trying to flush them
      • Some internal code cleaning & reestructuration
      • Fixed issues with native lib loading (mostly on Mac) with the OpenCV package provided by OpenPnP
  • This is the 2rd release for EOCV-Sim.

    • Changelog:

      • Added a Telemetry implementation displayed in the UI. Replicates the FTC SDK one, it can be used directly in pipelines.
      • Added an option to define the CameraSource resolution when creation.
      • Added MacOS support (thnx Noah)
      • Changed default resolution to 320x280 everywhere since it is the most commonly used in EOCV
      • Native libs are now downloaded by the simulator from another GitHub repo to avoid bloating the repository with heavy files
      • Java libraries, such as classgraph, opencv and gson are now delivered in compiled jars to improve compile times
    • Bug fixes:

      • Fixed a bug where the InputSources would return a BGR Mat instead of RGB, which is the type EOCV gives.
      • Regarding the last point, the visualizer now expects for the given mats to be RGB
      • Improved general IO error handling everywhere, from file accessing to input sources reading, so that the simulator doesn’t enter in a freeze state if any IO related operation fails
      • Improved multi threading handling for changing pipelines and inputsources.
      • Fixed issue in Linux where the buttons would be moved to an incorrect position when resizing out and then trying to resize back to the original size
  • Initial EOCV-Sim release.

eocv-sim's People

Contributors

henopied avatar jiceberg avatar lukasmwerner avatar puravdatta-sudo avatar serivesmejia avatar shaunsingh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.