GRIP Full of Errors

I exported my GRIP stuff into a Java file (I’m not even sure I did it right, it only exports a .java so I copy pasted the text in that file into a class in Eclipse)

The code is riddled with errors, I’m the only programmer on my team and I’m struggling to understand what the issue is.

It’s the standard GRIP code, I have an HSV Threshold, a mask, and a blob finder. In the Java code, lots of objects like VisionPipeline, Mat, and MatOfKeyPoint (and many more) are being flagged as nonexistent. What could be the issue?


Sounds like the Eclipse project isn’t a WPILib robot project, which explains how it can’t find all those libraries

It is a WPLib and it recognizes many other objects such as Joysticks, just not anything from GRIP. Any ideas??

VisionPipeline is new in WPILib this year. Have you updated the Eclipse plugins?

Also for some reason we had to to this manually- make sure that opencv and cscore are included libraries. If you go to project properties > Java Build Path > Libraries, then “Add External JARs”, select opencv and cscore in ~/wpilib/java/current/lib, that might solve the issue.

We do C++, but it’s still in Eclipse.

Did you export your code to Eclipse or copy in the code from a separate file? I had an issue earlier today with an imported file being corrupt and not recognizing anything (also refusing to even consider building), so I copied and pasted into a new project created from a random WPI-provided sample project.

In the new file, make sure your includes follow actual paths. You’ll probably have to comment out/ remove the “#include <opencv2/contrib/contrib.hpp” unless you can find the folder. I was unable to, and commenting it out seems to have worked.