GRIP - Vision Processing

I was just messing around with GRIP and it is a very powerful tool. Does anyone know how to use the data it outputs. I’ve never messed with the networks table at all which is where it seems to output the data. Any help would be awesome!

What language? i have messed around with network tables, specifically for vision actually…They are pretty simple to use…essentially if your robot is deciding if it should do ____ based on a value from a table it would look similar to this

table visiontable = NetworkTable.getTable("vision")
boolean shouldFire = visiontable.getvalue()
//rest of code

so while grip is powerful, its still in development…

The GRIP manual on Screensteps has an article for that:
http://wpilib.screenstepslive.com/s/4485/m/50711/l/479908-reading-array-values-published-by-networktables

Ok so that’s how you access the data from grip but what can you do with that information?

Also would you have to have grip running on your computer with the driver station?

Since its java, it can be run anywhere! thats the beauty of it! It can run on your driverstaion, the rio or even a coprocessor, such an an odroid c1 (way better then raspi)

So I could take an ip camera from the robot and input that data into GRIP then output the data to the robot? If I had it running with the driver station. Also how do I use the information back

The C++ example on this page shows how to print the area and x/y coordinates of each target.

Assuming you’re able to get this far, exactly how you use this data depends on your robot and your strategy. For example, if you’re trying to like the robot up horizontally with the biggest target, you might do something like this. (This is a really oversimplified example, but hopefully it serves as a good starting point)

const double CENTER_X = 320.0;
const double TOLERANCE_X = 20.0;

void AutoShoot() {
	while (true) {
		auto areas = grip->GetNumberArray("myContoursReport/area", llvm::ArrayRef<double>()),
		     xs    = grip->GetNumberArray("myContoursReport/x",    llvm::ArrayRef<double>());

		// Pick whatever target has the biggest area
		double targetArea = -1.0, targetX = 0.0;
		for (int i = 0; i < areas.size(); i++) {
			if (areas* > targetArea) {
				targetArea = areas*;
				targetX = xs*;
			}
		}
		
		// If we didn't find a target, return control to the operator
		if (targetArea < 0.0) {
			return;
		}

		// If we're too far to the left to shoot, move right.  If we're too far
		// to the right, move left.  If we're spot on, shoot and return.
		if (targetX < CENTER_X - TOLERANCE_X) {
			MoveRobotRight();
		} else if (targetX > CENTER_X + TOLERANCE_X) {
			MoveRobotLeft();
		} else {
			ShootBoulder();
			return;
		}
	}
}

Hello. Just started using GRIP. Is it possible to run grip from my drivers station PC by getting the robot USB camera feed? If so how do I send the Network Table data back to the roboRio for my program?

Thanks