Usage in FTC
The primary goal of building a visual pipeline in PaperVision is to generate reliable Java code that can be integrated directly into your FTC robot's OpMode. This process involves three main steps: Generation, Integration, and Data Access.
1. Code Generation and Integration
When you export your completed visual pipeline from the editor, it creates a standard Java class that extends OpenCvPipeline (often provided by the EasyOpenCV library).
Generate the File: The editor creates a
.javafile (e.g.,MyPaperVisionPipeline.java) that contains all the complex computer vision logic you designed visually.Add to Project: You must copy this generated file into the appropriate directory of your FTC robot's Android Studio project (typically under
TeamCodeor a similar folder).No Modification Needed: The beauty of this process is that you should not need to edit the generated file. All adjustments to thresholds, blurring, and filtering can be done in the visual editor and re-exported.

2. Instantiating the Pipeline in Your OpMode
Your robot's code (in your LinearOpMode or TeleOp) needs to initialize and start the pipeline. This involves setting up the camera and instructing it to use your custom class.
Example OpMode Setup (Java)
You will use an instance of OpenCvCamera (from EasyOpenCV) and set your pipeline class as the processor:
3. Data Access (Retrieving Targets)
Once the camera is streaming and the pipeline is running, the processFrame() method in your pipeline continually updates the lists of detected targets. You retrieve this data within your OpMode's main loop before making a movement decision.
You access the data using the public methods generated by the Export Targets nodes (e.g., getRotRectTarget, getRectTargets):
Last updated