Mercury1089 / 2016-robot-code

Team Mercury 2016 FIRST Robotics season code for FIRST Stronghold
0 stars 0 forks source link

Implement log/trace mechanism #11

Closed gartaud closed 8 years ago

gartaud commented 8 years ago

In the event of a malfunction (e.g. failure to properly shoot a boulder in the high goal) during a match, it will be useful to have access to a black-box to review what happened (e.g. be able to know what the distance, alignment, and angle to target were when the shot was fired... or what buttons the pilot and co-pilot pressed) We therefore need some form of log/trace mechanism.

Fundamentally it might be as simple as printing a formatted output to the system console using System.out, but all entries should be time-stamped (possibly using timer on FPGA to do so) All this should be wrapped in a class (e.g. Logger) so that it is convenient to use.

gartaud commented 8 years ago

Next step: test the Logger. One approach could be to log info of interest just prior to shooting the boulder (horizontal distance to goal, perceived opening width, turn angle; and tilt). Then install a ftp client on the laptop, fetch the logfile and make sure it contains what you expect.

gartaud commented 8 years ago

noting that Raj recommends WinSCP as the ftp client

Endoman123 commented 8 years ago

A few questions about this while I'm working on the logger:

gartaud commented 8 years ago

Console display would work too. Are you talking about the console display in the FRC Driver Station?

Endoman123 commented 8 years ago

No; I made a simple Swing GUI to display the console output.

gartaud commented 8 years ago

Remember that the Java code is running on the robot which does not have a display. So you either need to save information on a file for later retrieval via ftp, or send information to the FRC Driver Station (to the "Messages Tab" aka DS Log Viewer it seems - which I believe support receiving user information as of this year).

gartaud commented 8 years ago

See http://www.chiefdelphi.com/forums/showthread.php?p=1523196

Endoman123 commented 8 years ago

Had a feeling that that would be the case. I don't remember if printing to the RioLog actually worked for us; I don't think we've ever tried. Right now that isn't something I can try out, not without a robot I can deploy code to.

gartaud commented 8 years ago

You may assume it does and try it on the early prototype when you get a chance (next week?). It is a fairly normal process to work on software with limited access to a physical device. You write what you think should work, make sure it compiles properly... and then you test it when you get your time slice of the hardware.

JaiPatel1 commented 8 years ago

works