Skip to content

Add drone renders to docs - #126

Merged
amacati merged 6 commits into
mainfrom
feature.drone_renders
Oct 12, 2026
Merged

amacati merged 6 commits into
mainfrom
feature.drone_renders

Conversation

@ratheron

Copy link
Copy Markdown
Collaborator

The docs have a section for drone renders which was previously commented out. Added automatic render generation. Had to add dependencies to the docs env for headless rendering without a GPU driver.

@ratheron
ratheron force-pushed the feature.drone_renders branch from 198aabf to 7175994 Compare October 9, 2026 10:03
@ratheron
ratheron marked this pull request as ready for review October 9, 2026 10:04
@ratheron
ratheron requested a review from amacati as a code owner October 9, 2026 10:04

@amacati amacati left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks mostly good to go, just a question around the except blocks.

Comment thread docs/gen_drone_renders.py Outdated
Comment on lines +26 to +29
try:
import mkdocs_gen_files
except ImportError:
pass # not running in a docs environment — nothing to generate

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we really want to use try-except here? When would this script ever run outside a docs env? I think this should just throw

Comment thread docs/gen_drone_renders.py Outdated
Comment on lines +92 to +99
def gl_available() -> bool:
"""Check for a usable OpenGL context, so an unusable one is reported only once."""
try:
mujoco.Renderer(mujoco.MjModel.from_xml_string("<mujoco/>"), 4, 4).close()
except Exception as e:
log.warning(f"Could not create an OpenGL context, skipping the drone renders: {e!r}")
return False
return True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here. We should not hide errors, not even in the docs. The script is only expected to run when this is available, right?

Comment thread docs/gen_drone_renders.py Outdated
Comment on lines +103 to +107
try:
image = render(drone)
except Exception as e:
log.warning(f"Could not render drone '{drone}': {e!r}")
continue

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here. Why bare excepts?

@ratheron
ratheron requested a review from amacati October 12, 2026 11:41
@ratheron

Copy link
Copy Markdown
Collaborator Author

Added conftest to catch new errors (instead of adding a new flag to the pixi task)

@amacati
amacati merged commit 9e288ea into main Oct 12, 2026
6 checks passed
@amacati
amacati deleted the feature.drone_renders branch October 12, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants