View Single Post
  #27   Spotlight this post!  
Unread 21-02-2016, 19:59
s-taylor s-taylor is offline
Scott Taylor
FRC #1735 (Green Reapers)
Team Role: Mentor
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Auburn, MA
Posts: 22
s-taylor has a spectacular aura abouts-taylor has a spectacular aura about
Re: GRIP with USB Camera

Hi, all.

My problem is similar to others in the thread, but not quite the same.
I can get GRIP 1.2.0 running just fine on my laptop, using the MS Lifecam 3000 USB. it publishes to NetworkTables on the RIO, and then the DS is able to act upon it to control the robot as expected.

So far, so good.

But when trying to deploy the GRIP to the robot (so it can run headless on the RIO), I get this error:
Code:
/usr/local/frc/JRE//bin/java -Xmx50m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -jar '/home/lvuser/grip.jar' '/home/lvuser/project.grip'
Loading Dependency Injection Framework
Jun 05, 2015 8:40:12 PM java.util.logging.LogManager$RootLogger log
CONFIG: Configuration done.
Jun 05, 2015 8:40:12 PM java.util.logging.LogManager$RootLogger log
CONFIG: GRIP Version: 1.2.0
platform: /Linux/arm/
Jun 05, 2015 8:40:17 PM edu.wpi.grip.core.Main start
INFO: Loading file /home/lvuser/project.grip
Jun 05, 2015 8:40:19 PM edu.wpi.grip.core.Main start
INFO: SUCCESS! The project is running in headless mode!
Jun 05, 2015 8:40:19 PM edu.wpi.grip.core.PipelineRunner$1 startUp
INFO: Pipeline Starting
OpenCV Error: Assertion failed (ssize.area() > 0) in resize, file /home/javacpp-presets/opencv/cppbuild/linux-frc/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3208
VIDEOIO ERROR: V4L/V4L2: VIDIOC_S_CROP
Jun 05, 2015 8:40:19 PM edu.wpi.grip.core.Step runPerformIfPossible
WARNING: The CV resize operation did not perform correctly.
java.lang.RuntimeException: /home/javacpp-presets/opencv/cppbuild/linux-frc/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp:3208: error: (-215) ssize.area() > 0 in function resize

	at org.bytedeco.javacpp.opencv_imgproc.resize(Native Method)
	at edu.wpi.grip.generated.opencv_imgproc.Resize.perform(Resize.java:58)
	at edu.wpi.grip.core.Operation.perform(Operation.java:61)
	at edu.wpi.grip.core.Step.runPerformIfPossible(Step.java:139)
	at edu.wpi.grip.core.PipelineRunner.runPipeline(PipelineRunner.java:196)
	at edu.wpi.grip.core.PipelineRunner.access$200(PipelineRunner.java:32)
	at edu.wpi.grip.core.PipelineRunner$1.runOneIteration(PipelineRunner.java:76)
	at com.google.common.util.concurrent.AbstractScheduledService$ServiceDelegate$Task.run(AbstractScheduledService.java:189)
	at com.google.common.util.concurrent.Callables$3.run(Callables.java:100)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Note no startup errors prior to the ssize.area() error.
I do start GRIP from RobotInit as specified:

Code:
        /* Run GRIP in a new process */
       try {
            new ProcessBuilder("/home/lvuser/grip").inheritIO().start();
        } catch (IOException e) {
            e.printStackTrace();
        }
I've tried rebooting the RIO prior to deploying, just in case some other instance of GRIP was already running.

I also made sure the CameraServer is not running.

I'm GUESSING that the camera isn't sending any images to the first pipeline stage (resize)... but there's insufficient debug info in the log to tell me what might be wrong.

I checked that the GRIP file is using device 0, and this matches what is in the RIO dashboard (which says "cam0").

Thoughts?
-Scott

Last edited by s-taylor : 21-02-2016 at 22:19. Reason: fixed <code> tags