Go to Post Holonomic? I thought we were holographic. Or was that autonomic? I'm confused.... - Wayne C. [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-01-2017, 11:44
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 136
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Grip & Intermediate Vision Examples Errors

Quote:
Originally Posted by SLAB-Mr.Thomas View Post
Thanks for all the good thoughts. My Eclipse WPILib plugins updated automatically last night and the vision samples now work perfectly without any code changes. (Not sure the 2 events had anything to do with each other.)

The only time I get that error message now is if the camera is unplugged (unusual message but probably reflects what's really happening in the background to attempt to restart the camera which it does do just fine.)

Was able to get Grip embedded running on roboRIO, albeit slowly (2 frames per second for our 5 steps) and only after fixing all the coding errors in the generated code.

Only question left is what's VisionRunner do for me? I'm not knowingly using it and processing is working.

Repeating what others have found but with my actual code posted herein:
Generate C++ code WITHOUT the checkmark for VisionPipeline.
Generated code has a missing cv:: in the SimpleBlobDetector code.
Generated code has a spurious include for contrib.
Generated code has an extra setsource0 method definition or a missing method declaration. Removing the method seems to be fine.

Code:
In robot.cpp of the Intermediate Vision Example:
add my Pipeline class name:
#include "Pipeline.h"  // Base Name matches generated file name. NO Checkmark on the Grip generate C++ code!  (creates reference to parent class VisionPipeline that doesn't exist in C++)

add to VisionThread:
		grip::Pipeline Gripper;  // Class Name matches generated file name.

add after rectangle(....):
			Gripper.process(mat);  //  run the Grip pipeline

			// Give the output stream a new image to display
//			outputStream.PutFrame(mat);
			outputStream.PutFrame(*Gripper.getblurOutput());

Remove from generated code Pipeline.cpp:
//void Pipeline::setsource0(cv::Mat &source0){   // removed. method doesn't have a declaration and its function seems to be redundant with the parameter
//	source0.copyTo(this->source0); 				 // removed. on the constructor so remove this method instead of fixing it
//} 											 // removed.

Fix generated code Pipeline.cpp:
		cv::Ptr<cv::SimpleBlobDetector> detector = cv::SimpleBlobDetector::create(params); // Add cv:: in front of 2nd SimpleBlobDetector


Remove from generated code Pipeline.h:
//#include <opencv2/contrib/contrib.hpp>	   // removed.  file doesn't exist.  Possibly an OpenCV artifact that WPILib has no need for now

The VisionPipeline/Runner/Thread stuff is to make it as simple as possible to run vision processing in a separate thread. It's mostly intended for less experienced teams so they don't kill the main robot program by running vision on the main thread. You don't need to use it if you don't want to. The VisionPipeline include should actually be "vision/VisionPipeline.h"... I'll fix that for the next release

The setsourceN functions weren't removed when I changed the process() method to take all the sources. They can be safely deleted (and they'll be gone in the next release of GRIP).

The include for the OpenCV contrib module can also be safely deleted. I'm working on fixing imports/includes to only use what's needed, much like RobotBuilder. That's going to take a while due to a major internal rework of the code generation module, so for the time being you'll just need to remember to remove the unneeded includes.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi