Skip to content

Commit 10b58b0

Browse files
cclausspeterbarker
authored andcommitted
camera_projection.py: Fix undefined names 'json' and 'self'
flake8 rule F821 -- Undefined names have the potential to raise NameError at runtime. `import json` needed for lines 64 and 106. `self` needed for line 87.
1 parent 5a3802d commit 10b58b0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

MAVProxy/modules/lib/camera_projection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
class to project a camera view onto the map
44
'''
55

6+
import json
7+
import math
8+
import time
9+
610
import numpy
711
from numpy import array, eye, zeros, uint64
812
from numpy import linalg, dot, transpose
913
from numpy import sin, cos, pi
1014
from math import pi
11-
import math
1215
import cv2
1316
from MAVProxy.modules.lib import mp_elevation
1417
from pymavlink.rotmat import Vector3
1518
from MAVProxy.modules.lib import mp_util
16-
import time
1719

1820
class CameraParams:
1921
'''
@@ -83,7 +85,7 @@ def todict(self):
8385
@staticmethod
8486
def fromdict(data):
8587
if data['version'] != 0:
86-
raise Exception('version %d of camera params unsupported' % (self.version))
88+
raise Exception('version %d of camera params unsupported' % (data['version']))
8789
try:
8890
K = array(data['K'])
8991
D = array(data['D'])

0 commit comments

Comments
 (0)