An error about running a camera calibration
newboylkp opened this issue · 3 comments
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.
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)")
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.