Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Processor load and other data (http://www.chiefdelphi.com/forums/showthread.php?t=141968)

gerthworm 17-01-2016 12:48

Processor load and other data
 
Hi All!

Our team this year is working on a more-advanced, on-RIO logging system to record robot data during matches. We want to use this to help validate some of our controls algorithms, benchmark drivetrain performance, and help diagnose any issues which show up during a match.

As part of this, we'd like to be able to log things like the roboRIO's processor load, available RAM, network load, etc. Anything we can get our hands on, really. Anyone have any experience getting this information in Java at runtime?

It doesn't look like WPILIB supports it directly, and the handful of Java examples I've found on line seem to cause runtime errors as soon as the code is loaded on (I presume this is because the functionality isn't implemented in the real-time system). I would suspect this info is somewhere since it shows up in the driver station, I'm just not sure how to get at it.

Thanks!

Arhowk 17-01-2016 13:17

Re: Processor load and other data
 
Much of what you desire can already be obtained in the Driver Station..

Above the log console in the driver station, click the gear and hit "View Log File". These log files should have everything you asked for. If not, than you'll need to post the code you're working with to record data and the console output.

gerthworm 17-01-2016 13:42

Re: Processor load and other data
 
Understood, pulling driver station logs is always an option.

As to what had been attempted, I had tried to work with java.lang.management.ManagementFactory and java.lang.management.OperatingSystemMXBean per the suggestions on this stack overflow post. The actual permutations of code I tried got lost between commits (bad programmer!). No worries if this isn't enough, just curious if anyone else has had success yanking these numbers in software on the RIO itself.

Joe Ross 17-01-2016 14:05

Re: Processor load and other data
 
This has been on my todo list to figure out for a while. Since the FRCNetworkComms task knows the values because it sends to the driver station, you could file a feature request to have those accessible to the robot program also. However, if FIRST did decide to implement that, it wouldn't be until next season

gerthworm 17-01-2016 15:38

Re: Processor load and other data
 
Thanks for the info! Pending what we find this season, I may enter that request.

FYI, the background on this is we have had some very hard-to-diagnoses failures in the past where we lose control of the robot briefly. What I'm hoping to do is to track fine-grained data every run about voltages, current draw, drive commands, network status, processor load, etc. - all in the hope that if/when we have a failure, we'll have enough info to know where to go start debugging (even on a non-reproducible problem).

Additionally, some of the algorithms suggested this year would need to be tuned and evaluated on real hardware. Not sure if we'll be successful in implementing and using them, but I figured the logging infrastructure would be needed anyway to properly evaluate these algorithms performance.


All times are GMT -5. The time now is 10:24.

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