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

representation.py: better assertion errors #354

Merged

Conversation

kevinfoley
Copy link
Contributor

@kevinfoley kevinfoley commented Mar 15, 2024

Description

Replaced two simple asserts with detailed error messages about what's gone wrong.

Related Issue

#353

Motivation and Context

I was working on a robot with 131 links and got an assertion error from representation.py, on this line:

assert self.input_type in MESH_DATA_TYPES

The generic assertion error and call stack was not helpful for understanding what went wrong or which of the 131 links was causing the problem. I had to look at the source code to better understand the problem, and then replace the simple assert with a more detailed AssertionError so I would know which link was causing the error.

While I was at it, I also added a more detailed AssertionError for the case where the meshname is None or not a string.

How Has This Been Tested?

I used the new AssertionError for self.input_type to identify which link in the robot was causing the issue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

…essages, to make errors easier to understand in Blender.
@hwiedPro
Copy link
Collaborator

Thanks, that's a great contribution!

@hwiedPro hwiedPro merged commit e359008 into dfki-ric:master May 16, 2024
@hwiedPro hwiedPro mentioned this pull request Jun 13, 2024
9 tasks
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