FIRST-Tech-Challenge / SkyStone

FTC SDK
https://www.firstinspires.org/robotics/ftc/what-is-first-tech-challenge
275 stars 1.04k forks source link

(v5.3) Unable to convince Vuforia to generate RGB565 frames #214

Closed KokeCacao closed 4 years ago

KokeCacao commented 4 years ago

Error Message: FTC Unable to convince Vuforia to generate RGB565 frames!

Using:

Relevant Error Log:

01-27 11:41:10.433 16020 16716 D Uvc     : [NativeVuforiaWebcam.h:515] NativeVuforiaWebcam::supportsExposureValue()...
01-27 11:41:10.433 16020 16716 D Uvc     : [NativeVuforiaWebcam.h:515] ...NativeVuforiaWebcam::supportsExposureValue()
01-27 11:41:10.433 16020 16716 D Uvc     : [NativeVuforiaWebcam.h:579] NativeVuforiaWebcam::supportsFocusValue()...
01-27 11:41:10.434 16020 16716 D Uvc     : [NativeVuforiaWebcam.h:579] ...NativeVuforiaWebcam::supportsFocusValue()
01-27 11:41:10.438 16020 16716 I AR      : ObjectTracker: This device doesn't support model targets extended tracking, extended tracking will be turned off
01-27 11:41:10.438 16020 16716 E Vuforia : CameraDevice.getInstance.init() failed
01-27 11:41:10.440 16020 16716 E Vuforia : enableConvertFrameToBitmap(): internal error: setFrameFormat(1) failed
01-27 11:41:10.441 16020 16716 E Vuforia : enableConvertFrameToBitmap(): internal error: setFrameFormat(8) failed
01-27 11:41:10.441 16020 16716 V RobotCore: thread: ...terminating 'LinearOpMode main'
01-27 11:41:10.444 16020 16648 E EventLoopManager: Event loop threw an Exception
01-27 11:41:10.444 16020 16648 E EventLoopManager: java.lang.RuntimeException: Unable to convince Vuforia to generate RGB565 frames!
01-27 11:41:10.445 16020 16648 E EventLoopManager:  at org.firstinspires.ftc.robotcore.internal.tfod.VuforiaFrameGenerator.<init>(VuforiaFrameGenerator.java:44)
01-27 11:41:10.445 16020 16648 E EventLoopManager:  at org.firstinspires.ftc.robotcore.internal.tfod.TFObjectDetectorImpl.<init>(TFObjectDetectorImpl.java:130)
01-27 11:41:10.446 16020 16648 E EventLoopManager:  at org.firstinspires.ftc.robotcore.internal.system.ClassFactoryImpl.createTFObjectDetector(ClassFactoryImpl.java:87)
01-27 11:41:10.447 16020 16648 E EventLoopManager:  at org.firstinspires.ftc.robotcontroller.external.samples.ConceptTensorFlowObjectDetectionWebcam.initTfod(ConceptTensorFlowObjectDetectionWebcam.java:167)
01-27 11:41:10.447 16020 16648 E EventLoopManager:  at org.firstinspires.ftc.robotcontroller.external.samples.ConceptTensorFlowObjectDetectionWebcam.runOpMode(ConceptTensorFlowObjectDetectionWebcam.java:94)
01-27 11:41:10.448 16020 16648 E EventLoopManager:  at com.qualcomm.robotcore.eventloop.opmode.LinearOpMode$LinearOpModeHelper$1.run(LinearOpMode.java:305)
01-27 11:41:10.448 16020 16648 E EventLoopManager:  at com.qualcomm.robotcore.util.ThreadPool.logThreadLifeCycle(ThreadPool.java:737)
01-27 11:41:10.448 16020 16648 E EventLoopManager:  at com.qualcomm.robotcore.eventloop.opmode.LinearOpMode$LinearOpModeHelper.run(LinearOpMode.java:300)
01-27 11:41:10.449 16020 16648 E EventLoopManager:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
01-27 11:41:10.449 16020 16648 E EventLoopManager:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
01-27 11:41:10.450 16020 16648 E EventLoopManager:  at com.qualcomm.robotcore.util.ThreadPool$ThreadFactoryImpl$1.run(ThreadPool.java:793)
01-27 11:41:10.451 16020 16648 E EventLoopManager:  at java.lang.Thread.run(Thread.java:818)
01-27 11:41:10.451 16020 16648 V RobotCore: RobotCoreException in EventLoopManager: EventLoop Exception in loop(): RuntimeException - Unable to convince Vuforia to generate RGB565 frames!
01-27 11:41:10.451 16020 16648 V RobotCore: EventLoopManager state is EMERGENCY_STOP
01-27 11:41:10.451 16020 16648 V RobotCore: Robot Status: EMERGENCY STOP
01-27 11:41:10.451 16020 16648 D RobotCore: system telemetry: key=$System$Error$ msg="User code threw an uncaught exception: RuntimeException - Unable to convince Vuforia to generate RGB565 frames!"
01-27 11:41:10.452 16020 16648 I FtcEventLoop: ======= TEARDOWN =======
01-27 11:41:10.458 16020 16648 D Uvc     : [NativeVuforiaWebcam.cpp:241] Java_org_firstinspires_ftc_robotcore_internal_vuforia_externalprovider_VuforiaWebcam_nativePreVuforiaDeinit()...
01-27 11:41:10.458 16020 16648 D Uvc     : [NativeVuforiaWebcam.h:246] NativeVuforiaWebcam::preVuforiaDeinit()...
01-27 11:41:10.458 16020 16648 D Uvc     : [NativeVuforiaWebcam.h:246] ...NativeVuforiaWebcam::preVuforiaDeinit()
01-27 11:41:10.458 16020 16648 D Uvc     : [NativeVuforiaWebcam.cpp:241] ...Java_org_firstinspires_ftc_robotcore_internal_vuforia_externalprovider_VuforiaWebcam_nativePreVuforiaDeinit()
01-27 11:41:10.458 16020 16648 D Vuforia : Vuforia.deinit()...
01-27 11:41:10.460 16020 16650 V Robocol : sending CMD_STREAM_CHANGE(629), attempt: 0
01-27 11:41:10.461 16020 16650 V Robocol : sending CMD_NOTIFY_ROBOT_STATE(630), attempt: 0
01-27 11:41:10.461 16020 16650 V Robocol : sending CMD_STREAM_CHANGE(632), attempt: 0
01-27 11:41:10.463 16020 16648 D Vuforia : ...Vuforia.deinit()
01-27 11:41:10.463 16020 16648 D Uvc     : [NativeVuforiaWebcam.cpp:258] Java_org_firstinspires_ftc_robotcore_internal_vuforia_externalprovider_VuforiaWebcam_nativePostVuforiaDeinit()...
01-27 11:41:10.463 16020 16648 D Uvc     : [NativeVuforiaWebcam.cpp:258] ...Java_org_firstinspires_ftc_robotcore_internal_vuforia_externalprovider_VuforiaWebcam_nativePostVuforiaDeinit()
01-27 11:41:10.464 16020 16648 V NativeVuforiaWebcam: destroy(pointer=0xb8e5b190)
01-27 11:41:10.464 16020 16648 D Uvc     : [NativeVuforiaWebcam.cpp:203] Java_org_firstinspires_ftc_robotcore_internal_vuforia_externalprovider_VuforiaWebcam_nativeReleaseVuforiaWebcam()...
01-27 11:41:10.464 16020 16648 D UvcVuforiaWebcam: [NativeVuforiaWebcam.cpp:206] NativeVuforiaWebcam cref remaining=1
01-27 11:41:10.464 16020 16648 D Uvc     : [NativeVuforiaWebcam.cpp:203] ...Java_org_firstinspires_ftc_robotcore_internal_vuforia_externalprovider_VuforiaWebcam_nativeReleaseVuforiaWebcam()
01-27 11:41:10.475 16020 16648 I RobotCore: ******************** STOP - OPMODE /storage/emulated/0/FIRST/matchlogs/Match-0-Concept:_TensorFlow_Object_Detection_Webcam.txt ********************
01-27 11:41:10.478 16020 16648 I RobotCore: Pruning old logs deleting Match-0-Concept:_TensorFlow_Object_Detection_Webcam.txt
01-27 11:41:10.485 16020 16750 I RobotCore: saving match logcat to /storage/emulated/0/FIRST/matchlogs/Match-0-Concept:_TensorFlow_Object_Detection_Webcam.txt
01-27 11:41:10.485 16020 16750 I RobotCore: logging command line: exec logcat -d -T '1-27 11:41:8.000' -f /storage/emulated/0/FIRST/matchlogs/Match-0-Concept:_TensorFlow_Object_Detection_Webcam.txt -n4 -v threadtime UsbRequestJNI:S UsbRequest:S art:W ThreadPool:W System:W ExtendedExtractor:W OMXClient:W MediaPlayer:W dalvikvm:W  *:V
01-27 11:41:10.516 16020 16191 V SoundInfo: construct(0x0a0e262a)
01-27 11:41:10.584 16020 16190 D ExtendedUtils: extended extractor not needed, return default
01-27 11:41:10.615 16020 16756 E OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
01-27 11:41:10.647 16020 16750 I RobotCore: Done running exec logcat -d -T '1-27 11:41:8.000' -f /storage/emulated/0/FIRST/matchlogs/Match-0-Concept:_TensorFlow_Object_Detection_Webcam.txt -n4 -v threadtime UsbRequestJNI:S UsbRequest:S art:W ThreadPool:W System:W ExtendedExtractor:W OMXClient:W MediaPlayer:W dalvikvm:W  *:V
01-27 11:41:10.647 16020 16750 I RobotCore: exiting match logcat for /storage/emulated/0/FIRST/matchlogs/Match-0-Concept:_TensorFlow_Object_Detection_Webcam.txt

Things I have tried:

Other Relevant Posts:

KokeCacao commented 4 years ago

Full Error From the Robot Controller: https://pastebin.com/03XKfCVW Full Error From the Driver Station: https://pastebin.com/8GJaCN5B

KokeCacao commented 4 years ago

Ref: robotControllerLog_robot.txt robotControllerLog_driver.txt

ssysm commented 4 years ago

Have you tried connecting the USB Camera directly to the phone and see if it works? Some USB Hub isn't fast enough to handle the camera data.

KokeCacao commented 4 years ago

Have you tried connecting the USB Camera directly to the phone and see if it works? Some USB Hub isn't fast enough to handle the camera data.

The problem is solved! Thank you so much!

Solution

I tested with a couple of USB hubs and found out some works on the Android phone and some are not. Specifically: This one on Amazon does not work although it says "high speed."

According to the documentation, a good USB hub should have Supports a data transfer rate of 480Mbps.

I am purchasing this one since I can't use the recommended USB hub due to incompatibility with USB-C

Ways to test camera on Android phone

(for future ref)

  1. Download the app "USB Camera - Connect EasyCap or USB WebCam"
  2. Test it by directly plug WebCam into Andoid phone without extra power.