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

better error message when BoardConfig wrong #10

Open
astraw opened this issue Feb 24, 2025 · 3 comments
Open

better error message when BoardConfig wrong #10

astraw opened this issue Feb 24, 2025 · 3 comments

Comments

@astraw
Copy link
Contributor

astraw commented Feb 24, 2025

Hi, we noticed that when providing a wrong board config (or when using the default board config when it is wrong), the error behavior does not lead one to immediate realize the problem:

thread 'main' panicked at src/util.rs:349:14:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(Digging deeper leads one quickly to a problem in optimizer, which gets intimidating quickly.)

I wonder if it would be straightforward to catch if the board configuration seems wrong and list this as a possible cause of the error.

@powei-lin
Copy link
Owner

It is difficult to tell whether the optimization failure is due to wrong board configuration, wrong model selection, wrong model initialization, or any other reason. The optimizer is just solving a general non-linear least square problem.

@powei-lin
Copy link
Owner

If you want to generate custom aprilgrid layout and config, try using the python script in https://github.com/powei-lin/aprilgrid-rs

@astraw
Copy link
Contributor Author

astraw commented Feb 25, 2025

Maybe a test that checks how many tags are expected and compares with how many are found in most images would be a decent heuristic to start.

Changing the error from a panic due to unwrapping a null to "The optimization failed. It is difficult to tell whether the optimization failure is due to wrong board configuration, wrong model selection, wrong model initialization, or any other reason. The optimizer is just solving a general non-linear least square problem." would be easier for a user to move forward with.

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

No branches or pull requests

2 participants