Skip to content

Commit

Permalink
Fix relative import for python3 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
safijari authored May 17, 2019
1 parent 7f92771 commit b89bc79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aprilgrid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tagFamilies import t36h11
from .tagFamilies import t36h11
from apriltags_eth import make_default_detector
from collections import namedtuple

Expand Down
11 changes: 6 additions & 5 deletions aprilgrid/createTargetPDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,26 @@
import math
import numpy as np

from tagFamilies import *
from .tagFamilies import *

class AprilTagCodes:

class AprilTagCodes(object):
def __init__(self, chosenTagFamiliy):
try:
self.chosenTagFamiliy = chosenTagFamiliy
self.tagCodes = TagFamilies[chosenTagFamiliy][0]
self.totalBits = TagFamilies[chosenTagFamiliy][1]
except:
print "[ERROR]: Unknown tag familiy."
print("[ERROR]: Unknown tag familiy.")
sys.exit(0)

#borderBits must be consitent with the variable "blackBorder" in the detector code in file ethz_apriltag2/src/TagFamily.cc
def generateAprilTag(canvas, position, metricSize, tagSpacing, tagID, tagFamililyData, rotation=2, symmCorners=True, borderBits=2):
#get the tag code
try:
tagCode=tagFamililyData.tagCodes[tagID]
except:
print "[ERROR]: Requested tag ID of {0} not available in the {1} TagFamiliy".format(tagID, tagFamililyData.chosenTagFamiliy)
except Exception:
print("[ERROR]: Requested tag ID of {0} not available in the {1} TagFamiliy".format(tagID, tagFamililyData.chosenTagFamiliy))

#calculate the bit size of the tag
sqrtBits = (math.sqrt(tagFamililyData.totalBits))
Expand Down

0 comments on commit b89bc79

Please sign in to comment.