Skip to content

Commit

Permalink
coherent file naming scheme; documentation of camera_data module;
Browse files Browse the repository at this point in the history
  • Loading branch information
carloskiki committed Mar 5, 2024
1 parent cff1950 commit 9e90d24
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
19 changes: 19 additions & 0 deletions camera_data/README.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 9e90d24

Please sign in to comment.