Skip to content

Commit

Permalink
Add type annotation for function get_capture_array()
Browse files Browse the repository at this point in the history
  • Loading branch information
tckarenchiang authored Oct 7, 2024
1 parent 9b0913c commit eb27e06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions robohatlib/hal/Camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
except ImportError:
raise ImportError("Failed to import needed dependencies for the Camera class, make sure picamera2 is installed")

from numpy.typing import NDArray
# --------------------------------------------------------------------------------------

class Camera:
Expand Down Expand Up @@ -52,7 +53,7 @@ def init_camera(self) -> None:

# --------------------------------------------------------------------------------------

def get_capture_array(self):
def get_capture_array(self) -> NDArray[np.uint8]:
"""!
return numpy arrays of captured data. Makes a copt before leaving
@return: None or array
Expand Down Expand Up @@ -138,4 +139,4 @@ def __check_ffmpeg() -> bool:
return False
return True

# --------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------

0 comments on commit eb27e06

Please sign in to comment.