Custom Datalogging iteration issue

When utilizing the custom datalogging feature of wpilib on-robot-telemetry, our team wants to have all our fields recorded per iteration.

However, when utilizing multiple " my[insertlogtype]Log.append( [datavalue] ) " types, it seems to only shove one append variable into the datalog per iteration as shown by converting the datalog into a csv file linked below.

Screenshot 2023-06-18 091800

Is there a way for the datalogManager to record all variables in the same iteration and append them to the same timestamp?

Link to the on-robot telemetry documentation:

Just use advantagescope to voew the logs. Itll show everything synced to the right timestamps. I think you can export individual fields from there if you need to

By default, append gets the timestamp when you call it. However, you can also give it a timestamp as a second parameter. So you can get the timestamp once per loop iteration, save it to a variable, and then pass that variable into all your append() calls so all the values have the same timestamp.


Another option if you specifically need the fields in a CSV format is to use the export tool in AdvantageScope. It includes an option for how to generate the timestamps for the rows — either “all changes” (like WPILib’s tool) or with “fixed” intervals:

  • All Changes: Create a new row when any of the included fields are updated. Other columns will show duplicate values.
  • Fixed: Create new rows at a fixed interval, useful for logs without timestamp synchronization (when many fields are being logged with similar, but not identical, timestamps).

With “fixed” the rows don’t necessarily line up with the loop cycles but it’s OK for some applications. Otherwise Peter’s suggestion of manually providing timestamps is the way to go.