Skip to content

Commit

Permalink
cam_test: configurable FPS with N/M keys, print sensor and VCSEL temp…
Browse files Browse the repository at this point in the history
…erature for ToF with `-show` or `/` toggle
  • Loading branch information
alex-luxonis committed Jun 30, 2024
1 parent 8426272 commit 1cec190
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion utilities/cam_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
exposure time: I O 1..33000 [us]
sensitivity iso: K L 100..1600
focus: , . 0..255 [far..near]
FPS: N M
To go back to auto controls:
'E' - autoexposure
'F' - autofocus (continuous)
Expand Down Expand Up @@ -495,6 +496,7 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
EXP_STEP = 500 # us
ISO_STEP = 50
LENS_STEP = 1 / 1024
FPS_STEP = 2.5
DOT_STEP = 0.05
FLOOD_STEP = 0.05
DOT_MAX = 1
Expand All @@ -513,6 +515,10 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
sensMin = 100
sensMax = 1600

fps = args.fps
fpsMin = 0.01
fpsMax = 120

dotIntensity = 0
floodIntensity = 0

Expand Down Expand Up @@ -599,7 +605,9 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
txt += f"Exp: {pkt.getExposureTime().total_seconds()*1000:6.3f} ms, "
txt += f"ISO: {pkt.getSensitivity():4}, "
txt += f"Lens pos: {pkt.getLensPosition():3}, "
txt += f"Color temp: {pkt.getColorTemperature()} K"
txt += f"Color temp: {pkt.getColorTemperature()} K "
txt += f"Sensor: {pkt.getSensorTemperature()} degC "
txt += f"Aux/VCSEL: {pkt.getAuxTemperature()} degC"
if needs_newline:
print()
needs_newline = False
Expand Down Expand Up @@ -681,6 +689,16 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
ctrl = dai.CameraControl()
ctrl.setAutoExposureEnable()
controlQueue.send(ctrl)
elif key in [ord('n'), ord('m')]:
if key == ord('n'):
fps -= FPS_STEP
if key == ord('m'):
fps += FPS_STEP
fps = clamp(fps, fpsMin, fpsMax)
print("Setting FPS: ", fps)
ctrl = dai.CameraControl()
ctrl.setFps(fps)
controlQueue.send(ctrl)
elif key in [ord(','), ord('.')]:
if key == ord(','):
lensPos -= LENS_STEP
Expand Down

0 comments on commit 1cec190

Please sign in to comment.