Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate log files (cockpit standard and video subtitles) #582

Merged
merged 7 commits into from
Nov 27, 2023

Conversation

rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Nov 21, 2023

image

To be merged after #573.

Fix #546
Fix #450

@rafaellehmkuhl rafaellehmkuhl changed the title Generate log files Generate log files (cockpit standard and video subtitles) Nov 21, 2023
@rafaellehmkuhl rafaellehmkuhl force-pushed the generate-log-files branch 5 times, most recently from 2b83c6c to b15506e Compare November 22, 2023 20:23
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Nov 22, 2023
@rafaellehmkuhl rafaellehmkuhl force-pushed the generate-log-files branch 3 times, most recently from 30bb006 to f7718a7 Compare November 23, 2023 01:21
Comment on lines 140 to 152
const roll = Number(logPoint.data['roll']).toFixed(2)
const pitch = Number(logPoint.data['pitch']).toFixed(2)
const heading = Number(logPoint.data['heading']).toFixed(2)
const depth = Number(logPoint.data['depth']).toFixed(2)
const mode = logPoint.data['mode']
const batteryVoltage = Number(logPoint.data['batteryVoltage']).toFixed(2)
const batteryCurrent = Number(logPoint.data['batteryCurrent']).toFixed(2)
const gpsVisibleSatellites = logPoint.data['gpsVisibleSatellites']
const gpsFixType = logPoint.data['gpsFixType']
const latitude = Number(logPoint.data['latitude']).toFixed(6)
const longitude = Number(logPoint.data['longitude']).toFixed(6)
const secondsStart = logPoint.seconds.toFixed(0)
const secondsFinish = (logPoint.seconds + 1).toFixed(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include units for these somehow? The indicators already include units, so that seems like it should be doable, hopefully :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try the discussed approach. If it fits, I will change the PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the new approach, each widget register which variables it uses, and this information is used for automatic variable selection (if no user custom selection is made).

@rafaellehmkuhl rafaellehmkuhl force-pushed the generate-log-files branch 3 times, most recently from 6ceca2e to f8c3559 Compare November 24, 2023 03:35
@rafaellehmkuhl rafaellehmkuhl marked this pull request as ready for review November 24, 2023 12:20
@rafaellehmkuhl rafaellehmkuhl force-pushed the generate-log-files branch 2 times, most recently from 549093b to 0cdf9c2 Compare November 27, 2023 15:19
src/components/mini-widgets/MiniVideoRecorder.vue Outdated Show resolved Hide resolved
src/libs/logging.ts Outdated Show resolved Hide resolved
/**
* Variables data can be datalogged
*/
export enum DatalogVariable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant we use registerUsage to do this kind of definition for us dynamically ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do that, we lose the ability to add to the logs variables that are not being used by widgets.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So.. why not having the log being done by the abstract vehicle class over registerUsage being used over widgets if the idea is to log everything ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs should be independent from video subtitles.

Copy link
Member Author

@rafaellehmkuhl rafaellehmkuhl Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs should be independent from video subtitles.

They are. It's the other way around. The subtitles are dependent on the logs.

So.. why not having the log being done by the abstract vehicle class over registerUsage being used over widgets if the idea is to log everything ?

The registerUsage approach is just to deliver a good default to users. If they never configured which variables to show in the subtitle overlays, the default ones will be the ones they are using.

Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was imagining that all the widgets would provide their data, and a class would record them when registered.

With the current design, I don't understand how, for example, arbitrary data would be recorded, like from a custom sensor received as a float value, or anything from a generic indicator.

@rafaellehmkuhl
Copy link
Member Author

I was imagining that all the widgets would provide their data, and a class would record them when registered.

With the current design, I don't understand how, for example, arbitrary data would be recorded, like from a custom sensor received as a float value, or anything from a generic indicator.

We indeed do not support the use-case you mentioned in this first patch.

The problem with having the widgets registering what to record as a solo approach is that we wouldn't be able to record things that no widget is registering. Remember the widgets are lazy-loaded, so if the widget is not in any view, the variable will not be registered and them the user won't be able to use it.

What we could do is to actually do both: have the pre-registered variables and allow widgets to also provide their own, in a custom way.

@rafaellehmkuhl
Copy link
Member Author

@joaoantoniocardoso I'm testing the approach I mentioned and the place where it fit's more is indeed the VeryGenericIndicator, but for it to make sense I need to add extra UI on the widget to allow the user to manually register the variable (clicking a button) when it decides on a good widget configuration (otherwise we end up with garbage in the log).

As I still need to finish the joystick pipeline for this week, do you think it's reasonable if we go with this PR as is and open a an issue and follow with a PR next week adding support for the generic from-wiget registering?

Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested :)

For the docs, we should mention that the browser will ask the user for permission to download multiple files at once.

@rafaellehmkuhl rafaellehmkuhl merged commit bdf4999 into bluerobotics:master Nov 27, 2023
7 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the generate-log-files branch November 27, 2023 23:00
@rafaellehmkuhl
Copy link
Member Author

Video of the final working version:

Screen.Recording.2023-11-27.at.20.05.32.mp4

@ES-Alexander
Copy link
Contributor

Docs key points:

  • Currently a pre-defined set of variables being logged
  • Raw log of inputs/outputs being logged automatically at 1Hz on the control station
  • Subtitle file created when recording a video, by slicing the raw log from the start:end times of the video, formatted as a subtitle file
  • By default logs variables in active widgets, but not the ambiguous ones (like VeryGenericIndicator)
    • It's possible to override the variables by going to the logs configuration page (need to document that image too)
  • Currently output format determined automatically (TODO: create issue on desired interface, with grid and draggable elements)

@joaoantoniocardoso
Copy link
Member

joaoantoniocardoso commented Dec 4, 2023

Docs key points:

* Currently a pre-defined set of variables being logged

* Raw log of inputs/outputs being logged automatically at 1Hz on the control station

* Subtitle file created when recording a video, by slicing the raw log from the start:end times of the video, formatted as a subtitle file

* By default logs variables in active widgets, but not the ambiguous ones (like VeryGenericIndicator)
  
  * It's possible to override the variables by going to the logs configuration page (need to document that image too)

* Currently output format determined automatically (TODO: create issue on desired interface, with grid and draggable elements)

@ES-Alexander I'd advocate to include something like:

  • Multiple files will be downloaded (subtitle + video) when recording is finished, so the browser will ask the user for permission to download multiple files, and the user must accept it to use this feature.

ES-Alexander added a commit to ES-Alexander/ardusub-zola that referenced this pull request Dec 12, 2023
ES-Alexander added a commit to ES-Alexander/ardusub-zola that referenced this pull request Dec 12, 2023
ES-Alexander added a commit to ES-Alexander/ardusub-zola that referenced this pull request Dec 12, 2023
ES-Alexander added a commit to ES-Alexander/ardusub-zola that referenced this pull request Dec 12, 2023
ES-Alexander added a commit to ES-Alexander/ardusub-zola that referenced this pull request Dec 13, 2023
ES-Alexander added a commit to bluerobotics/ardusub-zola that referenced this pull request Dec 13, 2023
ES-Alexander added a commit to bluerobotics/ardusub-zola that referenced this pull request Dec 13, 2023
ES-Alexander added a commit to bluerobotics/ardusub-zola that referenced this pull request Dec 13, 2023
@ES-Alexander ES-Alexander added docs-complete Change documentation has been completed and removed docs-needed Change needs to be documented labels Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-complete Change documentation has been completed
Projects
None yet
4 participants