Skip to content

Commit 89c3f94

Browse files
committed
Switched Camera encoder
1 parent 4d550d4 commit 89c3f94

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"Resolution": [1600, 1200], "Brightness": -30.0, "Exposure": 2566.0}
1+
{"Resolution": [1600, 1200], "Brightness": 30.0, "Exposure": 642.0}

PiSideCode/Camera/camera.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,13 @@ def setResolution(self, identifier, resolution):
195195
# os.system(f"v4l2-ctl -d /dev/v4l/by-path/{identifier} --set-fmt-video=width={resolution[0]},height={resolution[1]}")
196196
self.info[identifier].cam.set(cv2.CAP_PROP_FRAME_HEIGHT, resolution[1])
197197
self.info[identifier].cam.set(cv2.CAP_PROP_FRAME_WIDTH, resolution[0])
198-
self.info[identifier].cam.set(
199-
cv2.CAP_PROP_FOURCC,
200-
cv2.VideoWriter_fourcc(
201-
*("MJPG" if "MJPG" in self.info[identifier].validFormats else "GREY")
202-
),
203-
)
198+
# self.info[identifier].cam.set(
199+
# cv2.CAP_PROP_FOURCC,
200+
# cv2.VideoWriter_fourcc(
201+
# *("MJPG" if "MJPG" in self.info[identifier].validFormats else "GREY")
202+
# ),
203+
# )
204+
self.info[identifier].cam.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"YUYV"))
204205
self.info[identifier].cam.set(cv2.CAP_PROP_FPS, 30) # Lower can be better
205206
resolution = tuple(resolution)
206207

PiSideCode/Processing/Processing.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import wpimath.geometry as wpi
55
import numpy as np
6+
import math
67

78

89
class Processor:
@@ -67,8 +68,8 @@ def makePoseObject(temp):
6768
temp["rotation"]["quaternion"]["Y"],
6869
temp["rotation"]["quaternion"]["Z"],
6970
)
70-
),
71-
)
71+
).rotateBy(wpi.Rotation3d(0, 0, math.radians(180))))
72+
7273

7374
# ROT MUST BE A 3x3 ROTATION MATRIX
7475
def getTransform(trans, rot):
@@ -78,7 +79,7 @@ def getTransform(trans, rot):
7879

7980
def getTagTransform(jsonID):
8081
pose = Processor.makePoseObject(jsonID)
81-
rot = pose.rotation()
82+
rot = pose.rotation().rotateBy(wpi.Rotation3d(0,0,math.radians(180)))
8283
translation = np.asarray([pose.X(), pose.Y(), pose.Z()]).reshape(3, 1)
8384
rot, _ = cv2.Rodrigues(np.asarray([rot.X(), rot.Y(), rot.Z()]).reshape(3, 1))
8485
return Processor.getTransform(translation, rot)
@@ -229,7 +230,7 @@ def imagePose(self, images, K, D, layout, arucoDetector):
229230
if len(ids) > 1:
230231
ambig.append(2767)
231232

232-
if len(ids) == 1:
233+
if len(ids) == 0:
233234
tempc1 = np.asarray(
234235
[self.squareLength / 2, self.squareLength / 2, 0]
235236
)

PiSideCode/SystemData.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"TeamNumber": 2767, "TableName": "WallEye", "ip": "10.27.67.11", "BoardDim": [7, 7], "TagSize": 0.157}
1+
{"TeamNumber": 2767, "TableName": "Walleye", "ip": "10.27.67.11", "BoardDim": [7, 7], "TagSize": 0.168275}

0 commit comments

Comments
 (0)