Computer Vision library for FTC based on OpenCV, featuring beacon color and position detection, as well as an easy-to-use VisionOpMode
format and many additional detection features planned in the future.
git clone --depth=1 https://github.com/lasarobotics/ftcvision
.ftc-visionlib
and opencv-java
folders into your existing robot controller app.Project
mode selected in the project browser window (so you can see all of the files in your project).settings.gradle
file and append the following two lines:
include ':opencv-java'
include ':ftc-visionlib'
AndroidManifest.xml
file in your app's FTCRobotController/src/main
folder.uses-permission
tag in AndroidManifest.xml
just below the <mainfest ...>
tag and just before the application
tag:
<uses-permission android:name="android.permission.CAMERA" android:required="true" />
FTCRobotController/build.release.gradle
AND TeamCode/build.release.gradle
files and insert the following lines under dependencies
into both files:
compile project(':ftc-visionlib')
compile project(':opencv-java')
VisionSample.java
, located in [vision-root]/ftc-robotcontroller/src/main/java/com/qualcomm/ftcrobotcontroller/opmodes
) from the FTCVision directory into a folder within the TeamCode
directory (where your place any other opmode).@Autonomous
) in order to get them to work for your version of the SDK.VisionOpMode
!ftc-cameratest
into the root of your project. Then, add include ':ftc-cameratest'
to your settings.gradle
in the root of your project. To run the camera test app, click the green "Sync Project with Gradle Files" button to update your project, then select ftc-cameratest
from the dropdown next to the run button.When installing via Git submodule, every person cloning your repo will need to run git submodule init
and git subomodule update
for every new clone. However, you also get the advantage of not copying all the files yourself and you can update the project to the latest version easily by navigating inside the ftc-vision
folder then running git pull
.
git submodule init
git submodule add https://github.com/lasarobotics/ftcvision ftc-vision
ftc-vision
folder and thus directories will need to be modified. Once you get to the step that modifies settings.gradle
, add the following lines:
project(':opencv-java').projectDir = new File('ftc-vision/opencv-java')
project(':ftc-visionlib').projectDir = new File('ftc-vision/ftc-visionlib')
project(':ftc-cameratest').projectDir = new File('ftc-vision/ftc-cameratest') <- only if you want to enable the camera testing app
VisionOpMode
!git clone --depth=1 https://github.com/lasarobotics/ftcvision
.ftc-robotcontroller
. Then, modify the FtcOpModeRegister
appropriately to add your custom OpModes.VisionOpMode
!This library is complete as of World Championship 2016. If you have any questions or would like to help, send a note to smo-key
(contact info on profile) or open an issue. Thank you!
Documentation for the stable library is available at http://ftcvision.lasarobotics.org.
Yes! FTCVision can detect a beacon 0.5-4 feet away with 90% accuracy in 0.2 seconds. Here are some pictures. :smiley:
OpMode
scheme created so that the robot controller does not need to be modified to use the app.