How do you log?

Starting this thread because I’m very curious about teams current logging systems and how they like to log in their system.

I’ve had the thoughts of trying to setup some sort of web dashboard to view logging in realtime as the robot is in operation. Obviously not available in an actual match, but we spend so much time working on software and trying to understand why something is doing what, getting this data could be excellent! but I can’t imagine I’m alone!

Why do you say this? A web dashboard can totally be used during an actual match. There’s nothing that says you can’t run a web browser on your driver station.

1 Like

You’re in luck! WPILib actually provides features that lets you output any values or information directly to your driver station.

My team uses Shuffleboard, but any of them would work. Usually it just involves adding a line of code to return, and then you can modify the dashboard on your driver station using a GUI.

1 Like

Yeah sorry. Absolutely available. I didn’t explain it well but how I’d probably do this is setup a large monitor/tv at our workshop that can display logging data while our robot is operational logging information like a dashboard that we might care about. I would somehow host a site local to that network so any other system connected to the network could pop onto it and see the telemetry data.

1 Like

You can definitely do that; take a look at AdvantageScope (data analysis and log viewing) and FRC Web Components (real-time dashboard).

6 Likes

darn was hoping to be lazy and leverage something!

1 Like

We use our own custom, but simple, solution. We have classes that internally log to network tables and to data log files at the same time. We can switch off the major nt logging during competition, but we download the logs after a match or testing and then look at them in advantagescope.

1 Like

hmm i might go with something simple like that. Your code isn’t on github by any chance?

It is :+1:.

javabot-beta-2023/src/main/java/frc/lib/logging at main · FRC2539/javabot-beta-2023 (github.com)

This is the link to the specific folder for 2023.

Also, the current system is a work in progress. We are working on adding support for Pose2d, ChassisSpeeds, and sendables.

We have something similar implemented with generics (which makes it a little messy but okay in general):

Making specific cases for the various common non-primitive types you see makes quite a lot of sense, I think we may copy that :smile: . Currently we just split it out into the format AdvantageScope expects in the robot code.

I might be interpreting your question wrong but you may be look for 6328’s AdvantageKit for logging and AdvantageScope for visualizing. We’ve used this for viewing real time logged data to help us diagnose issues and evaluate if something needs to be fixed.

They’ve written lots of examples for how to implement into your codebase. You can view wpilogs and rlogs and stream over nt4 and rlog.

3 Likes

I really wanted to use advantagekit but it was just a bit too controlling in the way data is managed. Perhaps that’s for the better but I like having flexibility.

I’m glad to hear about plenty of teams using their great software though.

1 Like

You can use AdvantageScope without using the rest of AdvantageKit.

2 Likes

Yep, that’s what we do, and it works great :+1:.

1 Like

I actually don’t think AdvantageKit is that confusing in how they log. They’re approach is to log basically all values from the motors and all the values that would allow you to replay the match exactly. At the end of the day, it makes sure that you’ll have most of the values you want and won’t miss a value when logging.

2 Likes

Of the tools I have used, WpiLib’s inbuilt data logging works great, 2 lines logs all the NetworkTables and DriverStation data. It will even save the data on the Rio or a flash drive with no extra configuration. I personally found AdvantageKit a little confusing, and they modify WpiLib (only to introduce logging parts) that I didn’t like.

Once you have the logs though, AdvantageScope is ABSOLUTELY the best visualization tool in FRC to replay data. Nothing is even close on after the match replay of data. For 2023, they support the WpiLib data format.

3 Likes

For some shameless self-promotion, if you find the WPILib NetworkTables/Shuffleboard API too verbose to interact with directly and would rather just annotate fields to indicate they should be logged, give Oblog a try:

4 Likes

+1 for oblog. +1 for anything that lets you drop the line @log above some class member of interest, and it just magically shows up everywhere you care about in logs, telemetry, NT, whatever.

4 Likes

Well, I started out with Sthil 026, nothing quite like it. But recently I got an Ego with 16in bar, and that’s been super convenient.

3 Likes

I’m a Fiskars hatchet guy myself. Won’t take down a tree but I don’t have to do that too often. Let me axe you a question though. What kind of bar and chain oil do you use?

2 Likes