Skip to content

Commit

Permalink
Fix mode_test.py
Browse files Browse the repository at this point in the history
The rotation property no longer tells us the mounting orientation of
the sensor, so we have to hardcode this instead for the time being.

Signed-off-by: David Plowman <[email protected]>
  • Loading branch information
davidplowman committed Jun 28, 2023
1 parent 0cc0d3b commit cff339b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/mode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def check(raw_config, fps):
# Check we got the correct raw format
assert picam2.camera_configuration()["raw"]["size"] == raw_config["size"]
set_format = SensorFormat(picam2.camera_configuration()["raw"]["format"])
set_format.transform(Transform(rotation=picam2.camera_properties["Rotation"]))
# For now, assume all our cameras are rotated 180 degrees. These seems to be no easy
# way to get this information from libcamera any more.
rotation = 180 # picam2.camera_properties["Rotation"]
set_format.transform(Transform(rotation=rotation))
assert set_format.format == raw_config["format"], \
f'{picam2.camera_configuration()["raw"]["format"]} != {raw_config["format"]}'
picam2.set_controls({"FrameRate": fps})
Expand Down

0 comments on commit cff339b

Please sign in to comment.