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

An error about running a camera calibration #689

Open
newboylkp opened this issue Jun 7, 2024 · 3 comments
Open

An error about running a camera calibration #689

newboylkp opened this issue Jun 7, 2024 · 3 comments

Comments

@newboylkp
Copy link

hi,Thank you for reading this question of mine,I think I've successfully installed Kalibr but I got the following error when I run it, I've solved it for 2 or 3 days and still haven't solved it,If you have encountered a similar problem and solved it successfully, please help me, thanks!
1717763325152
1717763299348

@Andreachen0707
Copy link

checking by the code:

if not isinstance(targetRows,int) or targetRows < 3:
                errList.append("invalid targetRows (int>=3)")
            if not isinstance(targetCols,int) or targetCols < 3:
                errList.append("invalid targetCols (int>=3)")

i think you should first check your astra_april.yaml to see what your targetRows and targetCols looks like. If you indeed need targetRow/targetCols less than 3, just modify the code in ConfigReader.py to add a var named errList. It should be fine.

This does look like a bug. But not a huge one.

@newboylkp
Copy link
Author

astra_april.yaml
Thanks for your answer! I've found a workaround. I've replaced all the errList in my code with print, so my code runs successfully.
if targetType == 'checkerboard':
try:
targetRows = self.data["targetRows"]
targetCols = self.data["targetCols"]
rowSpacingMeters = self.data["rowSpacingMeters"]
colSpacingMeters = self.data["colSpacingMeters"]
except KeyError as e:
self.raiseError("Calibration target configuration in {0} is missing the field: {1}".format(self.yamlFile, str(e)) )

        if not isinstance(targetRows,int) or targetRows < 3:
            #print >>targetRows, " ==targetRows "
            print("invalid targetRows (int>=3)")
        if not isinstance(targetCols,int) or targetCols < 3:
            print("invalid targetCols (int>=3)")
        if not isinstance(rowSpacingMeters,float) or rowSpacingMeters <= 0.0:
            print("invalid rowSpacingMeters (float)")
        if not isinstance(colSpacingMeters,float) or colSpacingMeters <= 0.0:
            print("invalid colSpacingMeters (float)")

@WFram
Copy link

WFram commented Jun 11, 2024

Just use AprilGrid board with enough tags (more than 3) and make sure the .yaml file, which describes the pattern and is passed through --target when running calibration, contains proper parameters.

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

3 participants