RE: Data Capture

No there isn’t, but you can export CSV (comma separated values) over the debugging stream, and copy and paste that into excel later.

EDIT: Whoops, meant to name this “Data Capture”, mods are welcome to rename this thread if they feel like it.

Thanks Cody,

That is the setup I am trying to understand, how do you setup the debug stream?
I’ve done plenty of CSV cut and paste from terminal data, but I think that setup is what I am missing.

Edit:
I noticed writeDebugStreamLine() here so I’ll try that, although the bug they mention may make it pointless for now:

http://www.robotc.net/forums/viewtopic.php?f=63&t=11733

Here is a nice little tutorial:

http://www.dexterindustries.com/howto/using-debugger-stream-in-robotc-for-lego/

In terms of the code you actually run on the robot here is the help page relevant to the debug stream.

http://help.robotc.net/WebHelpVEX/index.htm#topics/robotc_debugger/debug_windows/debug_stream.htm%3FTocPath%3DROBOTC%20Debugger|_____7

To open the debug stream
Wirelessly download to the robot. Open Debug Stream under Robot, Debugger Windows, Debug Stream.
Then press start on the program and live watch the data be written in.

This will help.


writeDebugStream("int x is: %d", x);  // writes the current value of int 'x' to the debug stream

So in your case, you’d do this:



bool first = true;
void writeInt(int value) {

	if(first) {
		writeDebugStream("%d", value);  // writes value without comma
		first = false;
		return;
	} else {
		writeDebugStream(", %d", value);  // writes value with comma
	}

}

Then just call writeInt(foo); whenever you need to write values. This’ll only write integers, and only ONE stream of them (so it won’t allow you to write out two values at once, without having to separate the data).

This is giving me an idea for a JSON data exporter. Something that could write out any amount of arbitrary data to be processed and turned into CSV later.

I suppose you could just save the values in a large array and write a proper CSV with multiple channels of data later. But w/e this’ll do basic stuff.

-Cody

Perfect Tabor/Cody , thank you

No problem, good luck!

JSON would be awesome, but limiting in Vex/RobotC stream capabilities. I’ve thought about it to get the kids into more modern approaches to data, but we reverted back to a simple formatted string.

You can start getting into the line length limits so JSON variables and formatting adds to that when you want to output a few variables at a time.

Having all the variables on one output line at a time you want to visualize makes it easier to import into Excel/Open Office. Merging lines across time slices is much more difficult.

So making a format identifier up front, followed by parseable data behind it for the rest of the line works. Try and put a header line first time through for that format but it is tricky to keep up.

Vertical pipe symbol is the delimiter of choice | as commas can be used in strings. You can use whatever you want so it is a personal preference.

The amount of data streamed per unit time gets hairy too if you don’t have your wait commands. So loop nicely!

The save as feature int he new robot C versions make copy/paste not required. Yeah!

Lastly, the wireless connection is a bit slow and can drop some data. So if possible, run USB A-A cables from the Cortex to the Joystick. A 15’ cable works for most things and luckily no bridge this year to get entangled with. You will get a lot less dropped data.

The save feature works great, instead of cut and paste, lets you use a format like:

("%d, %d, %d, %d \n", …) straight into CSV in Excel.