Hi,
When I try running the ToF examples (whichever one) on the AE3 with either the ‘latest release’ (5.0.1) or the ‘latest development’ firmware, the camera hangs, after some time USB reenumerates with an ‘this USB device does not work properly’ message → I need to reboot the camera.
The minimum feasible example below works, even though it takes some time to start:
import tof
tof.init()
while True:
try:
depth, dmin, dmax = tof.read_depth()
print(depth)
except RuntimeError as e:
print("tof error:", e)
It seems that the issue is with the output visualisation routines / snapshot of tof:
# Scale the image and belnd it with the framebuffer
tof.draw_depth(
img,
depth,
x_scale=img.width() / 8,
y_scale=img.height() / 8,
hint=image.BILINEAR,
alpha=100,
scale=(0, 4000),
color_palette=image.PALETTE_DEPTH,
)
or
try:
img = tof.snapshot(
vflip=True,
hmirror=True,
x_scale=IMAGE_SCALE,
y_scale=IMAGE_SCALE,
hint=image.BILINEAR,
scale=(0, 4000),
copy_to_fb=True,
color_palette=image.PALETTE_DEPTH,
)
- → running these crashes the camera immediately