openftc / easyopencv Goto Github PK
View Code? Open in Web Editor NEWFinally, a straightforward and easy way to use OpenCV on an FTC robot!
Finally, a straightforward and easy way to use OpenCV on an FTC robot!
RC has begun to crash consistently a few seconds after init an op mode. Code for the op mode and pipeline are below, followed by the error message. We have a competition in a few days, so any help is appreciated.
int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName());
this.webcam = OpenCvCameraFactory.getInstance().createWebcam(hardwareMap.get(WebcamName.class, "Webcam 1"), cameraMonitorViewId);
this.webcam.setPipeline(new Pipeline(telemetry));
this.webcam.setMillisecondsPermissionTimeout(2500); // Timeout for obtaining permission is configurable. Set before opening.
this.webcam.openCameraDeviceAsync(new OpenCvCamera.AsyncCameraOpenListener()
{
@Override
public void onOpened()
{
webcam.startStreaming(1280, 720, OpenCvCameraRotation.UPRIGHT);
}
@Override
public void onError(int errorCode) {telemetry.addData("ErrorCode", errorCode);}
});
telemetry.update();
public class Pipeline extends OpenCvPipeline {
Scalar blueLower = new Scalar(100,0,0);
Scalar blueUpper = new Scalar(255,150,150);
Mat output = new Mat();
Mat processed1 = new Mat();
Mat processed2 = new Mat();
Telemetry tel;
Pipeline(Telemetry telemetry) {
this.tel = telemetry;
}
@Override
public Mat processFrame(Mat input)
{
output = input.clone();
return output;
}
}
V/Robocol: sending CMD_RECEIVE_FRAME_CHUNK(6743), attempt: 0
V/Robocol: sending CMD_RECEIVE_FRAME_CHUNK(6744), attempt: 0
D/AndroidRuntime: Shutting down VM
V/Robocol: sending CMD_RECEIVE_FRAME_CHUNK(6745), attempt: 0
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.qualcomm.ftcrobotcontroller, PID: 1377
java.lang.AbstractMethodError: abstract method "boolean com.qualcomm.robotcore.util.GlobalWarningSource.shouldTriggerWarningSound()"
at com.qualcomm.robotcore.util.RobotLog.getGlobalWarningMessage(RobotLog.java:457)
at com.qualcomm.ftccommon.UpdateUI$Callback.refreshTextErrorMessage(UpdateUI.java:260)
at com.qualcomm.ftccommon.UpdateUI$Callback$2.run(UpdateUI.java:125)
at android.os.Handler.handleCallback(Handler.java:755)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
V/RobotCore: thread: ...terminating 'opmode loop()'
E/ThreadPool: exception thrown in thread pool; ignored
E/ThreadPool: exception thrown in thread pool; ignored
E/ThreadPool: java.lang.AbstractMethodError: abstract method "boolean com.qualcomm.robotcore.util.GlobalWarningSource.shouldTriggerWarningSound()"
E/ThreadPool: at com.qualcomm.robotcore.util.RobotLog.getGlobalWarningMessage(RobotLog.java:457)
E/ThreadPool: java.lang.AbstractMethodError: abstract method "boolean com.qualcomm.robotcore.util.GlobalWarningSource.shouldTriggerWarningSound()"
E/ThreadPool: at com.qualcomm.robotcore.eventloop.EventLoopManager.refreshSystemTelemetry(EventLoopManager.java:388)
E/ThreadPool: at com.qualcomm.robotcore.eventloop.EventLoopManager.packetReceived(EventLoopManager.java:236)
E/ThreadPool: at com.qualcomm.robotcore.util.RobotLog.getGlobalWarningMessage(RobotLog.java:457)
V/RobotCore: thread: ...terminating 'RecvLoopRunnable.run()'
E/ThreadPool: exception thrown in thread pool; ignored
E/ThreadPool: at org.firstinspires.ftc.robotcore.internal.network.NetworkConnectionHandler$RecvLoopCallbackChainer.packetReceived(NetworkConnectionHandler.java:744)
E/ThreadPool: at org.firstinspires.ftc.robotcore.internal.network.RecvLoopRunnable$PacketProcessor.run(RecvLoopRunnable.java:106)
E/ThreadPool: at com.qualcomm.robotcore.eventloop.EventLoopManager.refreshSystemTelemetry(EventLoopManager.java:388)
E/ThreadPool: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/ThreadPool: java.lang.AbstractMethodError: abstract method "boolean com.qualcomm.robotcore.util.GlobalWarningSource.shouldTriggerWarningSound()"
E/ThreadPool: at com.qualcomm.robotcore.eventloop.EventLoopManager$EventLoopRunnable$1.run(EventLoopManager.java:262)
E/ThreadPool: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/ThreadPool: at com.qualcomm.robotcore.util.ThreadPool.logThreadLifeCycle(ThreadPool.java:737)
E/ThreadPool: at com.qualcomm.robotcore.util.RobotLog.getGlobalWarningMessage(RobotLog.java:457)
E/ThreadPool: at com.qualcomm.robotcore.util.ThreadPool$ThreadFactoryImpl$1.run(ThreadPool.java:793)
E/ThreadPool: at com.qualcomm.robotcore.eventloop.EventLoopManager$EventLoopRunnable.run(EventLoopManager.java:246)
E/ThreadPool: at java.lang.Thread.run(Thread.java:761)
V/ThreadPool: container(0x032f08c2: ReceiveLoopService) added id=109 TID=0 count=4
E/ThreadPool: at com.qualcomm.robotcore.eventloop.EventLoopManager.refreshSystemTelemetry(EventLoopManager.java:388)
V/ThreadPool: container(0x032f08c2: ReceiveLoopService) removed id=66 TID=1480 count=4
I/Process: Sending signal. PID: 1377 SIG: 9
Hi,
I am using the sample programs to test webcam interface. I have encountered some issues summarizing below. I am testing with two webcams and the phonecam.
Using MultipleCameraExampleOpenCvAlongsideVuforia:
screen 1 (Vuforia) screen 2 (EasyOpenCV)
webcam 1 (ok) phonecam (ok)
webcam 1 (ok) webcam 2 (blue screen)
phonecam (ok) webcam 2 (ok)
Using MultipleCameraExample:
screen 1 (EasyOpenCV) screen 2 (EasyOpenCV)
webcam 1 (ok) phonecam (ok)
phonecam (ok) webcam 1 (ok)
webcam 2 (ok) webcam 1 (blue screen)
webcam 1 (ok) webcam 2 (blue screen)
I also observed that the phone would die after I ran the program a few times. I then use the MultipleCameraExample.java but enable one camera only. I put StartStreaming() and StopStreaming() in a loop with delays in between. If I used the phonecam, the loop could run forever until I stopped it. However, when I used a webcam, the loop would stop after 4 iterations.
Following the link in the install instructions leads to a 404, and the file is not in the opencv repo
Hey,
In v1.1 of the project, our initialization of a webcam always "blue screens" and fails to load the webcam's image. Please let me know what supporting documentation I need to submit to help solve this issue.
I currently have code like this that runs on initialization:
int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName()); // code makes it up to here
WebcamName webcamName = hardwareMap.get(WebcamName.class, RobotMap.Vision.WEBCAM); // crashes on this line
OpenCvCamera camera = OpenCvCameraFactory.getInstance().createWebcam(webcamName, cameraMonitorViewId);
camera.openCameraDeviceAsync(new OpenCvCamera.AsyncCameraOpenListener() {
@Override
public void onOpened() {
camera.startStreaming(1280, 720, OpenCvCameraRotation.UPRIGHT);
camera.setViewportRenderer(OpenCvCamera.ViewportRenderer.GPU_ACCELERATED);
camera.setPipeline(new SimplePipeline());
}
@Override
public void onError(int errorCode) {}
});
However, this code keeps crashing the OpMode with no error reported on the driver station. There are some errors reported in logcat:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/firstinspires/ftc/robotcore/internal/opmode/OpModeManagerImpl;
at org.openftc.easyopencv.LIFO_OpModeCallbackDelegate.getInstance(LIFO_OpModeCallbackDelegate.java:42)
at org.openftc.easyopencv.OpenCvCameraBase.<init>(OpenCvCameraBase.java:110)
at org.openftc.easyopencv.OpenCvWebcamImpl.<init>(OpenCvWebcamImpl.java:102)
at org.openftc.easyopencv.OpenCvCameraFactoryImpl.createWebcam(OpenCvCameraFactoryImpl.java:101)
at org.firstinspires.ftc.teamcode.Robot.initCamera(Robot.java:76)
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.firstinspires.ftc.robotcore.internal.opmode.OpModeManagerImpl" on path: DexPathList[[zip file "/data/app/com.qualcomm.ftcrobotcontroller-2/base.apk"],nativeLibraryDirectories=[/data/app/com.qualcomm.ftcrobotcontroller-2/lib/arm, /data/app/com.qualcomm.ftcrobotcontroller-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
I'm using FTCLib, so I followed the instructions here to install FTCLib and EOCV. Any help is appreciated. This is being run on a REV Control Hub with a USB Logitech webcam (using Android Studio).
Is it possible to use Vuforia with OpenCV on one camera simultaneously or should I resort to switching between the two? It would be nice to be able to pass in the Vuforia frames into OpenCV like TensorFlow does, but it doesn't look possible.
If not, then is it possible to make both a Vuforia and OpenCV instance off of one camera? I'm not sure...
We just encountered an interesting issue with EasyOpenCV. After redownloading from Android Studio, we get the "An error occurred while loading the OpenCV native library. Any OpenCV-enabled opmodes will crash" error on the driver hub. Following this, the app will immediately restart and then EOCV will proceed to work fine. It happens every time we download (which has been slowing down development a lot since we need to wait for two app restarts essentially). The correct .so file is in the FIRST folder, and I verified EOCV does in fact work after the second restart. I can try to get an error log, but I don't see anything noteworthy when it crashes. I don't know if this is related, but we used the EOCV Apriltag plugin, and most of the time when the app restarts and that error isn't thrown, the camera doesn't open correctly and the apriltag pipeline freezes. This is all on v1.5.1
instead of automatically creating a default file save path, we could potentially have the file path be an option you can pass in the constructor to use, and if not have a default save path that could be used by a constructor that takes no arguments.
We are utilizing 2 Webcams and are using the sample code you provided for a single Webcam since we only use one of the webcams in each auto program. The very first time we try to run an auto program with the EasyOpenCV tied to it, it gives us the following error:
Error: User code threw an uncaught exception: OpenCvCameraException - startStreaming() called, but camera is not opened.
I have attached a picture of the error as well.
Once the error pops up, we can try to rerun the auto program and then it runs just fine. It just occurs the first time it is plugged into the robot and ran or when the robot is restarted. I looked online for the same error and noticed someone on Reddit had the same issue. I reached out to them and they suggested adding "Try Catch" statement which would return telemetry saying the camera hasn't started as opposed to the program crashing. We would then have to just stop and restart the program instead. I have checked our code and we do have the camera opening before we stream. I haven't tried this "Try Catch" statement yet either.
TLDR; the leakDetection() in OpenCvPipeline.java is not quite correct, the garbage collection offset calculation is wrong.
We found during our competition last weekend, this memory leak warning came up while sitting in init() for exceptionally long times. Today I let it sit for about 25 minutes, and it claimed over 20GB of RAM was leaked. I believe the Control Hubs only have 1GB of RAM, so there's no way this is possible.
Looking at the Profiler in Android Studio shows the garbage collector is actually doing its job, and never exceeding ~400MB.
So looks like the garbage collection offset in that code is not correct, needs to be updated.
My team is trying to use EasyOpenCV to detect the different images on our signal sleeve cone. We had the example up and running ~6 weeks ago but have had trouble getting it working again. Every time we try and run an EasyOpenCV enabled op mode the Control Hub crashes and throws the exception "FATAL EXCEPTION: LinearOpMode main Process: UnsatisfiedLinkError: dlopen failed: library "libopencv_java4.so" not found. " We moved the library into our FIRST Folder on the internal storage, so I am unsure as to why we still receive this exception.
Hello, I haven't been here in a while.
I'm installing EasyOpenCV on SDK 1.7.1 with a fully up-to-date Control Hub.
I added the external library through OnBotJava, as the guide said.
Building works both via the web and via ftc_http, but when running the code I get the following exception, and the robot controller crashes:
java.lang.ClassNotFoundException: com.qualcomm.robotcore.wifi.WifiDirectAssistant$1
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at org.firstinspires.ftc.robotcore.internal.opmode.ClassManager.classNamesToClasses(ClassManager.java:214)
at org.firstinspires.ftc.robotcore.internal.opmode.ClassManager.processAllClasses(ClassManager.java:257)
at com.qualcomm.ftccommon.ClassManagerFactory.processAllClasses(ClassManagerFactory.java:94)
at org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity.onCreate(FtcRobotControllerActivity.java:356)
at android.app.Activity.performCreate(Activity.java:6709)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
The error is thrown by the createWebcam
function on the 3rd line below. The first two lines run without error.
OpenCvCameraFactory factory = OpenCvCameraFactory.getInstance();
WebcamName camera = hardwareMap.get(WebcamName.class, "Webcam 1");
OpenCvCamera ocvCam = factory.createWebcam(camera);
I've already removed the old .so file from the control hub, added the new one and replaced the robot controller application with the original one.
When using EasyOpenCV with OnBotJava, how should the .aar file be uploaded to OnBotJava? In the same way .java classes are uploaded or in a different way?
As a new FTC competitor, I find the instructions unclear and kindly ask the maintainers to improve them.
This issue is similar to issue#12. Using 2 webcams, we are also getting error "Startstreaming() Called, but Camera is Not Opened!" (which, once occurs requires restarting the robot) - see picture of error below:
However, in our case the streaming/pipelines from both webcams works fine immediately after restarting the robot controller. But if we stop the op mode and then press "INIT" on the driver's station phone (without restarting the robot), we get this error. We are using 2 Logitech C270 webcams plugged directly into a Control Hub - one into the USB2.0 port and one into the USB3.0 port. We are using 320 X 240 resolution on both webcams. The driver's station is on a MOTO E5.
This is our code:
Code in declarations:
OpenCvCamera Cam1;
OpenCvCamera Cam2;
SideDeterminationPipeline pipeline1;
RingDeterminationPipeline pipeline2;
Code in public void runOpMode();
int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName());
int[] viewportContainerIds = OpenCvCameraFactory.getInstance()
.splitLayoutForMultipleViewports(
cameraMonitorViewId, //The container we're splitting
2, //The number of sub-containers to create
OpenCvCameraFactory.ViewportSplitMethod.VERTICALLY); //Whether to split the container vertically or horizontally
Cam1 = OpenCvCameraFactory.getInstance().createWebcam(hardwareMap.get(WebcamName.class, "Webcam 1"), viewportContainerIds[0]);
Cam2 = OpenCvCameraFactory.getInstance().createWebcam(hardwareMap.get(WebcamName.class, "Webcam 2"), viewportContainerIds[1]);
pipeline1 = new SideDeterminationPipeline();
pipeline2= new RingDeterminationPipeline();
Cam1.setPipeline(pipeline1);
Cam2.setPipeline(pipeline2);
Cam1.openCameraDeviceAsync(new OpenCvCamera.AsyncCameraOpenListener()
{
@Override
public void onOpened()
{
Cam1.startStreaming(320,240, OpenCvCameraRotation.UPRIGHT);
}
});
Cam2.openCameraDeviceAsync(new OpenCvCamera.AsyncCameraOpenListener()
{
@Override
public void onOpened()
{
Cam2.startStreaming(320,240, OpenCvCameraRotation.UPRIGHT);
}
});
Note - when using only 1 webcam we are able to stop the op mode and re-INIT/restart without having to restart the robot. So this is only an issue when using 2 webcams. However we need 2 webcams and would really prefer to not have to restart the robot for every run.
Thanks in advance for any assistance!
-Steve
I tried a clean version of both the app master and the EasyOpenCV sdk's and I get an error where the script release-aar.gradle isn't a thing. It's apparently located in the ftc_app-master folder.
I've been trying to get EasyOpenCV to work on my Webcam(Microsoft Lifecam HD 3000) but I keep getting an error saying that the resolution that I'm asking for does not work. My code is here, and I don't know what is wrong. According to this document, the resolution that I am using should be the correct one.
Thank you in advance for your help.
It seems that setZoom is only available for OpenCvInternalCamera, not OpenCvWebcam.
Possible to add the support for OpenCvWebcam?
Thanks.
We are trying to use EasyOpenCV on a Moto G5 Plus running Android 7.0 . The libOpenCvNative.so file was copied using the ADB PUSH command to the /sdcard/FIRST folder. On starting the Robot Controller app we are getting the following error - " libOpenCvNative.so is corrupted - libOpenCvNative.so is present in the FIRST on the internal storage. However, the MD5 checksum, does not match what is expected. Any OpenCV-enabled OpModes will likely crash. Delete and re-download the file."
Running the following command using adb shell -
md5sum libOpenCvNative.so
returns
07a377983266cb64bd649bb233452970 libOpenCvNative.so
Any hints to what may be causing this ?
Hi I am a relatively new programmer in FTC and I am trying to implement EOCV for this year. We are running a control hub with an external webcam and most tutorials/code are for using the phone's camera. I checked through the javadocs and I am a little confused. I managed to type up some code for the initialization of the pipeline and webcam instances but it is not working. Is there compatibility with a external webcam? Here is my code. . Thank you!
Disconnecting and reconnecting a webcam works correctly when running an OpMode that uses the webcam from Vuforia.
Perhaps this is something I just need to cleanup, but when I move OpenCV from 1.5.2 to 1.5.3 my FTC project won't build with a ton of duplicate class errors. I tried clean project, grade sync, but that wasn't enough....
I'm trying to modify and recompile the EasyOpenCV library. I've already cloned the repo and got gradle to behave. However, it seems like the JNI is not being recognized properly.
I see the following error Class 'OpenCvSwitchableWebcamImpl' must either be declared abstract or implement abstract method 'shouldTriggerWarningSound()' in 'GlobalWarningSource'
Also, in the C++, OpenCV doesn't seem to be recognized. For example, in vuforia_passthrough_jni.cpp
, I have the error 'opencv2/core.hpp' file not found
.
How do you get constant streaming to work on the camera?
When stopping an OpMode that uses Vuforia and OpenCV on the same camera the robot controller occassionally crashes.
This is the only part of the stack trace that throws an error:A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x28 in tid 2388 (RenderThread)
, but I've included the whole breakdown stack trace if it's related: https://pastebin.com/azhih4H8
Although our pipeline is leaking memory, this error happens intermittently and only started in the last week (our code has been leaking memory from the pipeline for ~2 months) so I'm not 100% sure memory leakage is related.
As far as I'm aware this is a camera related issue but it may be something deeper? An issue with the Control Hub? (See this StackOverflow post)
lib is corrupted is in the error title.
I've followed the example for installing your project but am getting the above error message and app crashes. I'm on mac if that makes any different and used 'android file transfer' to move the file into the folder on the device. Has anyone see this message?
I pulled the file from here OpenCV-Repackaged/doc/native_libs/armeabi-v7a/
I've tried the master and 453 branches and get the same error.
Hello!
First of all many, many thanks for the solution!
My Camera Stream image is rotated to the left by 90 degrees. I have not changed (not that ambitious) any statement in the code from this repository except to envelope it into an Autonomous OpMode that works with the default TFOD signal sleeve detection where the Camera Stream is upright. Similarly, I dropped in the AprilTags example in the same Autonomous OpMode and the Camera Stream is upright.
Is there any easy fix to ensuring that the default camera view is upright when using the code from this repository? (As you can well imagine, I would prefer to stay within my job grade and not get into Easy Mat operations with the frames!). Thanks again. The entire community (those who want the extra 10 points) owe you a big one. Don't hesitate to let us know how we send some recognition (tangible or intangible) your way.
Kind regards.
P.S. Using Logitech C920 webcam.
I don't know why, but Android Studio doesn't recognize .getResources() and .getPackageName() but this only happens to me, to my buddy, with the exact same project it works perfectly fine.
Here's the code:
int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName());
Hello,
Need help to explicitly declare camera resolution with the current EasyOpenCV (libOpenCvAndroid453.so) library. The error message is:
Robot Status: EMERGENCY STOP To attempt recovery, please restart the robot. Error: User code threw an uncaught exception: OpenCvCameraException - Camera does not support requested resolution! Supported resolutions are [1920x1080],[1280x720], [3840x2160],[2592x1944],[2048x1536], [1600x1200],1280x960],[1024x768],[800x600], [640x480],[640x360]
The camera model is MOKOSE that supports up to [3840x2160]. TFOD (Concept and custom TFLite models) OpModes work fine with this camera. Any suggestions on how to work around this issue (or do I have to fall back to the Logitech C920 which works flawlessly).
The C920 generally has a detection issue at the initial step (under varied lighting conditions - so ambient lighting is not the culprit). The first detection - CMY or AprilTag signal sleeve is not always detected right away. Changing the frame view enables the detection and thereafter it is reliably solid. Of course, I'm not seeking help with this separate issue.
Is it possible to explicitly set the camera resolution during OpMode initialization to overcome the resolution error message? Thanks.
Kind regards.
Hi! I'd like to start off by saying I've loved using EasyOpenCV in FTC and I appreciate the work that you did to make the experience of creating computer vision pipelines on our robots so convenient and easy. This post is really more of a question, but I did not know of any better way to contact the developer of EOCV, so I am posting this as an issue.
I ran some benchmarks on one of my team's REV Control Hubs using a pipeline that simply returns the reference to the input frame, and these are the results:
Camera: Logitech C270
1280x720: 7.5 FPS (Theoretical max. 55)
640x360: 30 FPS (Theoretical max. 200)
I was at first confused about this, but then looked through the EOCV examples and read this quote:
"Keep in mind that the SDK's UVC driver (what OpenCvWebcam uses under the hood) only supports streaming from the webcam in the uncompressed YUV image format. This means that the maximum resolution you can stream at and still get up to 30FPS is 480p (640x480). Streaming at e.g. 720p will limit you to up to 10FPS and so on and so forth."
Based on this quote and some further research, I thought that streaming in uncompressed YUV format results in a non-CPU bottleneck which limits the FPS of the pipeline. My knowledge of this subject is limited and my intuition about the Control Hub's processing power is not great, but I suspected that this was due to a USB bandwidth limitation. I would appreciate it if you could confirm this or provide an alternative explanation.
If the camera stream is limited by communication bandwidth, I was wondering if you knew of any way to get the frames in a compressed format that would not cause such a bottleneck. I have been unable to find anything that would work on the Control Hub so far but I will keep searching.
I understand that finding a solution to this problem may be far too difficult and not worth the time investment considering that cameras are used exclusively to solve problems when having high FPS and resolution is not necessary (determining the randomized game scenario in the init phase through location of an object on the field).
I just didn't want to accept that this is the best that can be done in terms of performance because I wanted to experiment more with computer vision in the context of FTC and beyond using our robot hardware. I wanted to see if I could do something more than just a simple pipeline that does color filtering and averaging over the binary activations in submats of the filtered image. I find vision-based perception to be one of the most interesting aspects of robotics. Thank you for your time.
Frank
Bad News Bots #7584
There is a potential for a deadlock between onNewFrame()
and stopStreaming()
. Not obvious with autoclosing because autoclose happens in another thread.
So we have been having a memory leak issue for the past month during our qualifiers when we Initialize and let the program sit there for about 2 minutes. The exact error message we got is attached below. But today when we tried to recreate the error by letting it run in INIT continuously it took over an hour before it errored out. During competitions, we consistently got this error after 1-2 minutes every match even after restarting the phones before each one. When we asked around and searched online the only solution was to use the release function which we did.
The links to our autonomous codes are below:
https://github.com/Critical-Overload/CO_SkyStone_App/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AASkystoneSideBlue.java
Thank you,
Adrian
Programmer for Critical Overload 12828
In my code, I have it move, and then switch pipelines in between move steps. Sometimes, it is fine, but sometimes it causes a noticeable delay (>5 seconds). Do I need to put it on another thread? Thanks for the help.
In the newest version of the Control Hub's firmware, the app does not like to load when using EasyOpenCV, and seems to end up making either the Control Hub itself or the app bootloop, I'm not completely sure which. It's caused by removing "arm64-v8a"
in the Gradle config.
After installing EasyOpenCV, I tried to run it on my phone, but it crashes immediately after initialization. I am trying to run InternalCameraExample.java. When I check the Logcat, the error seems to be :
java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.core.Mat.n_Mat(int, int, int) (tried Java_org_opencv_core_Mat_n_1Mat and Java_org_opencv_core_Mat_n_1Mat__III) at org.opencv.core.Mat.n_Mat(Native Method) at org.opencv.core.Mat.<init>(Mat.java:39)
From this, I assume the problem is that the libOpenCvNative.so file is not being read by the robot controller for some reason. I have followed the instructions for the installation of EasyOpenCV as listed in the ReadME. The libOpenCvNative.so file is in the FIRST folder on the driver station.
Currently, our team is waiting to get new Moto E5's, so I am testing this using my personal Samsung galaxy s10e as the robot controller with a ZTE speed as the driver station. Thank you in advance for your help.
in your instructions
connect Controller to your computer with a USB cable, put it into MTP mode, and drag 'n drop the file.
i cannot find a way to put the rev control into mtp mode .
no reference is found in the web
The Robot Controller app stops when running the code below. On the monitor a pop up says FTC Robot Controller has stopped
. There are no errors on the Driver Station and no errors in the debugger within Android Studio. I copied the webcamExample
OpMode, and when run it exhibits the same behavior; the FTC Robot Controller crashes on that line. This could be an implementation error on my end...
webcam = OpenCvCameraFactory.getInstance().createWebcam( hardwareMap.get( WebcamName.class, "webcam1"), cameraMonitorViewId);
Thanks for any and all help!
We need a way to set the camera exposure (i.e. brightness of the image) on the internal camera. Currently, it seems that the OpenCvInternalCamera
API does not contain something we can use to do this (it only has settings like flashlight). Is there a workaround?
Today I came across an error with the EasyOpenCV library. It seems to cause the OpMode to not report itself as alive which leads to the shutdown of the app. I have attached a copy of the Robot Log Here:
RobotLog.txt
As a temporary measure, I have removed all code that depends on EasyOpenCV and commented out the line:
implementation 'org.openftc:easyopencv:1.5.1'
in my TeamCode build. gradle which has fixed the problem.
I am running on Rev Control Hub and the Driver Hub with SDK version 7.1
Not an issue per se but a request for guidance. When installing OpenCV under Android Studio, while using the Rev Control Hub rather than an Android Phone, what is the correct way to deposit the native library libOpenCvAndroid453.so into the FIRST folder? The Rev device manager doesn't really expose the file structure of the Control Hub, so it's unclear where the library should go or how to get it there. TIA!
Adding the line implementation 'org.openftc:easyopencv:1.5.0
to dependencies causes errors upon rebuilding/syncing gradle.
Error:
* Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'FTC14133-2021-2022'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133) at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:136) at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71) at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62) at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:43) at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:277) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35) at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:100) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:310) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:310) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:291) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249) at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:723) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:150) at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:41) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:67) at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:46) at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64) at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71) at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40) at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:226) at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:164) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149) at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:125) at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:71) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213) at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67) at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:53) at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:47) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:66) at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32) at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:90) at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44) at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:59) at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:58) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30) at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:34) at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53) at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:33) at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:28) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55) at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64) at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37) at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54) at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67) at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50) at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36) at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method implementation() for arguments [org.openftc:easyopencv:1.5.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. at org.gradle.internal.metaobject.AbstractDynamicObject$CustomMissingMethodExecutionFailed.<init>(AbstractDynamicObject.java:190) at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:184) at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:86) at build_8ppo7k0n5x89yfl7w21ytit3o$_run_closure4.doCall(C:\Users\pszymanowski\StudioProjects\FTC14133-2021-2022\build.gradle:44) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71) at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105) at org.gradle.api.internal.project.DefaultProject.dependencies(DefaultProject.java:1230) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:484) at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196) at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98) at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:34) at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:135) at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163) at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:84) at build_8ppo7k0n5x89yfl7w21ytit3o.run(C:\Users\pszymanowski\StudioProjects\FTC14133-2021-2022\build.gradle:38) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91) ... 140 more
Hey, I tried your sample code and it's showing an error when I init saying that the viewport container that the user specified does not exist... How do I fix this problem?
I am trying to install EasyOpenCV on a control hub. When I try to build it, the following error appears:
Building........................BUILD FAILED
org/firstinspires/ftc/teamcode/autonomous/RED.java(9:23): ERROR: package org.opencv.core does not exist
org/firstinspires/ftc/teamcode/autonomous/RED.java(14:26): ERROR: package org.opencv.imgproc does not exist
org/firstinspires/ftc/teamcode/autonomous/RED.java(15:30): ERROR: package org.openftc.easyopencv does not exist
I followed all of the instructions in the README file, and I did copy the .so
file to the FIRST
folder.
Are there special steps that need to be taken for a control hub?
The release notes of https://github.com/FIRST-Tech-Challenge/FtcRobotController for FTC SDK 8.0 say they break EasyOpenCV.
The instructions specify use of the 32 bit armeabi-v7a .so file, but OpenCV-Repackaged has both versions in docs/native-libs, both files are available. We are shifting to eocv from an old hard-to-maintain pre-eocv home grown vuforia/opencv/camera loading manager.
In our existing stuff, we had built and were using opencv as 64 bit.
Is it possible to use the 64 bit arm64-v8a .so?
Thanks
I'm trying to setup EasyOpenCV for FTC but I've ran into some issues. When pressing on the INIT button for an autonomous op mode which uses EasyOpenCV, the driver station stalls for a few seconds and then turns gray, as if it was disconnected from the control hub. Then, the control hub light starts blinking blue and the wifi network disappears. The only way to reconnect is to restart the control hub. (I'm using ftc_http to build to OnBotJava)
libOpenCvNative.so
to sdcard/FIRST
on the control hubsdcard/FIRST/java/lib
as discussed in #9We used EasyOpenCV last year but for some unknown reason it has stopped working since then. I'm aware that OnBotJava isn't supported by EasyOpenCV, but I was hoping someone would know how to fix this issue.
(I've tried downgrading everything to last year's version, including the robot controller, easyopencv, opencv-repackaged, and even the control hub firmware, to no avail)
In the above documentation section, I suggest mentioning how to exit the preview. Something like this:
"Select Camera Stream
again to close the preview and continue the OpMode."
Log:
I/RobotCore: ******************** START - OPMODE TeamElementDemo ********************
I/RobotCore: Attempting to switch to op mode TeamElementDemo
V/ThreadPool: container(0x0c3ec91a: LinearOpMode) added id=157 TID=0 count=1
V/RobotCore: thread: 'LinearOpMode main' starting...
I/System.out: OpenCvCameraBase ctor: EasyOpenCV version 1.5.1
I/System.out: startRecordingPipeline()
V/Robocol: sending CMD_NOTIFY_INIT_OP_MODE(186), attempt: 0
V/Robocol: sending CMD_STREAM_CHANGE(187), attempt: 0
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
Chrome build fingerprint:
7.0
42
### ### ### ### ### ### ### ### ### ### ### ### ###
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1c in tid 4516 (LinearOpMode ma)
Code:
OpenCvWebcam webcam = OpenCvCameraFactory.getInstance().createWebcam(hardwareMap.get(WebcamName.class, "Webcam 1"));
// Record for easier debugging
webcam.startRecordingPipeline(
new PipelineRecordingParameters.Builder()
.setBitrate(4, PipelineRecordingParameters.BitrateUnits.Mbps)
.setEncoder(PipelineRecordingParameters.Encoder.H264)
.setOutputFormat(PipelineRecordingParameters.OutputFormat.MPEG_4)
.setFrameRate(30)
.setPath("/Pictures/pipeline_rec.mp4")
.build());
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.