-
Notifications
You must be signed in to change notification settings - Fork 0
Create recording2mcap and dummy_data tools #30
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
Conversation
if not input(f"Output directory '{output}' already exists. Overwrite? (y/n): ").lower().startswith("y"): | ||
logger.info("Exiting") | ||
sys.exit(0) | ||
# Remove the existing directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think comments like these are helpful?
I'm personally not a big proponent of comments in general, and think they should only ever be used to explain why something is done and not what is done (especially when it is obvious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these comments bother you? Why?
I agree, describing the Why is more important (and often missing) than the What.
But I still see value in these comments, as they describe the intent of the code block. That means, I can quickly understand the flow and actions of the code without reading code which is noisier and requires more experience. Reading one comment spares me from parsing one block in my head.
In this case:
I very rarely use shutil
and rmtree
is not the most intuitive name. Of course, I could assume its function considering its input, but when still unsure it requires to read the docs.
Alternatively, one could demand each code-block with such a comment should be its method with proper documentation. This seems silly for a one-liner. For longer blocks, I would normally agree, but this is just a small utility tool, where I don't think it's worth the effort. That's why I use these comments as a middle ground between proper clean functions or nothing.
Create recording2mcap and dummy_data tools
This pull request introduces several enhancements and new features across various files, focusing on dummy data generation, and MCAP file conversion. The most important changes include renaming a workflow file, adding new functions for dummy data insertion, and implementing a new script for converting recordings to MCAP format.
Workflow and Configuration Updates:
.github/workflows/create_db.yml
to.github/workflows/dummy_db.yml
and updated the workflow to include dummy data population steps. (.github/workflows/dummy_db.yml
) [1] [2]Dummy Data Insertion:
ddlitlab2024/dataset/dummy_data.py
to insert dummy data into the database, including recordings, images, rotations, joint states, joint commands, and game states. (ddlitlab2024/dataset/dummy_data.py
)MCAP File Conversion:
recording2mcap.py
for converting recordings to MCAP format, including functions to write images, rotations, joint states, joint commands, and game states to MCAP files. (ddlitlab2024/dataset/recording2mcap.py
)Miscellaneous Updates:
.vscode/settings.json
. (.vscode/settings.json
)lichtblick_layout.json
. (ddlitlab2024/dataset/lichtblick_layout.json
)stamp_to_seconds_nanoseconds
to convert timestamps. (ddlitlab2024/dataset/models.py
)reader.py
. (ddlitlab2024/dataset/reader.py
)mcap
dependency topyproject.toml
. (pyproject.toml
)