diff --git a/camera_data/README.md b/camera_data/README.md new file mode 100644 index 00000000..cb0bbea3 --- /dev/null +++ b/camera_data/README.md @@ -0,0 +1,19 @@ +# Camera Data Module + +This module read and writes data from available camera feeds to the `/camera_frames` topic. + +### Messages + +- `v_angle`: Vertical orientation tilt of the camera enclosed in [-90, 90] degrees (The pitch axis of rotation). +- `h_angle`: Horizontal orientation tilt of the camera enclosed in [-90, 90] degrees (The Yaw axis of rotation). + +### Scripts + +- `camera_feeds.py`: Collects available camera ports and outputs them all in distinct windows. +- `camera_subscriber.py`: Subscriber to the `/camera_frames` topic that displays the images to screen. +- `camera_publisher.py`: Publishes frames from the selected camera (from the `camera_selection` topic) to the + `/camera_frames` topic at a rate of __30fps__. + +### Tests + +- `test_get_cameras.py`: Tests the camera feed collection from the `camera_feeds.py` script. diff --git a/camera_data/src/getCameraFeeds.py b/camera_data/src/camera_feeds.py similarity index 86% rename from camera_data/src/getCameraFeeds.py rename to camera_data/src/camera_feeds.py index 0b9c5360..80ecd8cf 100644 --- a/camera_data/src/getCameraFeeds.py +++ b/camera_data/src/camera_feeds.py @@ -14,13 +14,13 @@ def __init__(self): self.available_cameras.append(newCap) def get_all_feeds(self): - retAndFrame = [] + ret_frame = [] # read each capture object in vids and add as a tuple to retAndFrame for camera in self.available_cameras: newFeed = camera.read() - retAndFrame.append((newFeed[0], newFeed[1])) + ret_frame.append((newFeed[0], newFeed[1])) - return retAndFrame + return ret_frame def run_feeds(self): while True: @@ -38,5 +38,5 @@ def run_feeds(self): # Runnable to display camera feeds if __name__ == '__main__': - camHandler = CameraHandler() - camHandler.run_feeds() + camera_handler = CameraHandler() + camera_handler.run_feeds() diff --git a/camera_data/test/test_getCam.py b/camera_data/test/test_get_cameras.py similarity index 79% rename from camera_data/test/test_getCam.py rename to camera_data/test/test_get_cameras.py index ebb7155a..79323dff 100644 --- a/camera_data/test/test_getCam.py +++ b/camera_data/test/test_get_cameras.py @@ -9,5 +9,5 @@ import getCameraFeeds as gcf # Runnable to display camera feeds -camHandler = gcf.CameraHandler() -camHandler.run_feeds() +camera_handler = gcf.CameraHandler() +camera_handler.run_feeds()