From 5770359667e0063c5dd35f079d7c46a0ca6f1853 Mon Sep 17 00:00:00 2001 From: Eli Byrd Date: Thu, 14 Nov 2024 16:48:42 -0600 Subject: [PATCH] Update for new Camera Server --- .github/scripts/readme-generate.py | 11 ++- manifest.json | 149 +++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 2 deletions(-) diff --git a/.github/scripts/readme-generate.py b/.github/scripts/readme-generate.py index 5033456..504d178 100644 --- a/.github/scripts/readme-generate.py +++ b/.github/scripts/readme-generate.py @@ -81,12 +81,19 @@ def main(json_path, file_path): if "Error" in board_desc: write_packet_section(file, "Errors", board_desc["Error"]) - # Write IP for each network device in the Rovecomm manifest + # Write IP for each network device in the RoveComm manifest file.write("# Network Devices\n\n") file.write("| name | ip |\n") file.write("| :--- | -- |\n") for device_name, device_desc in manifest.get("NetworkDevices", {}).items(): - file.write(f"| **{device_name}** | `{device_desc.get('Ip', 'N/A')}`\n") + file.write(f"| **{device_name}** | `{device_desc.get('Ip', 'N/A')}` |\n") + + # Write IP for each multicasting device in the RoveComm manifest + file.write("# Multicast Devices\n\n") + file.write("| name | ip | port | device |\n") + file.write("| :--- | -- | ---- | ------ |\n") + for device_name, device_desc in manifest.get("MulticastCameras", {}).items(): + file.write(f"| **{device_name}** | `{device_desc.get('Ip', 'N/A')}` | `{device_desc.get('Port', 'N/A')}` | `{device_desc.get('Device', 'N/A')}` |\n") except IOError as e: print(f"Error: Could not write to file '{file_path}'. {e}") diff --git a/manifest.json b/manifest.json index cb61419..33dfeb7 100644 --- a/manifest.json +++ b/manifest.json @@ -785,6 +785,93 @@ }, "Error": {} }, + "CameraServer": { + "Ip": "192.168.4.102", + "Commands": { + "TakePhoto": { + "dataId": 14000, + "dataType": "UINT8_T", + "dataCount": 1, + "comments": "Take a picture with the current camera. [0] is the camera to take a picture with." + }, + "ToggleStream": { + "dataId": 14001, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Stop the current camera stream. [0] is the camera to stop streaming. [1] is the action (0 = Shutdown, 1 = Startup, 2 = Restart)." + }, + "AdjustBrightness": { + "dataId": 14002, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Adjust brightness level (0-255). [0] is the camera ID, [1] is the brightness level." + }, + "AdjustContrast": { + "dataId": 14003, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Adjust contrast level (0-255). [0] is the camera ID, [1] is the contrast level." + }, + "AdjustSaturation": { + "dataId": 14004, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Adjust saturation level (0-255). [0] is the camera ID, [1] is the saturation level." + }, + "AdjustHue": { + "dataId": 14005, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Adjust hue level (0-255). [0] is the camera ID, [1] is the hue level." + }, + "SetWhiteBalance": { + "dataId": 14008, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Set white balance temperature. [0] is the camera ID, [1] is the white balance level." + }, + "AdjustBacklightContrast": { + "dataId": 14009, + "dataType": "UINT8_T", + "dataCount": 2, + "comments": "Adjust backlight contrast level (0-255). [0] is the camera ID, [1] is the backlight contrast level." + }, + "SetExposure": { + "dataId": 14010, + "dataType": "INT32_T", + "dataCount": 2, + "comments": "Set exposure level. [0] is the camera ID, [1] is the exposure level." + } + }, + "Telemetry": { + "AvailableCameras": { + "dataId": 14100, + "dataType": "UINT8_T", + "dataCount": 1, + "comments": "Bitmask values for which cameras are able to stream. LSB is Camera 0, MSB is Camera 7." + }, + "StreamingCameras": { + "dataId": 14101, + "dataType": "UINT8_T", + "dataCount": 4, + "comments": "Which cameras the system is currently streaming on each port" + }, + "PictureTaken1": { + "dataId": 14102, + "dataType": "UINT8_T", + "dataCount": 1, + "comments": "Picture has been taken." + } + }, + "Error": { + "CameraUnavailable": { + "dataId": 14200, + "dataType": "UINT8_T", + "dataCount": 1, + "comments": "Camera has errored and stopped streaming. [0] is ID of camera as an integer (not bitmask)." + } + } + }, "IRSpectrometer": { "Ip": "192.168.3.104", "Commands": {}, @@ -891,5 +978,67 @@ "Basestation2_4GHzRocket": { "Ip": "10.0.0.12" } + }, + "MulticastCameras": { + "DriveCamLeft": { + "Ip": "239.0.0.1", + "Port": 50000, + "Device": 0, + "Name": "Drive Cam Left" + }, + "DriveCamRight": { + "Ip": "239.0.0.2", + "Port": 50000, + "Device": 1, + "Name": "Drive Cam Right" + }, + "GimbalCamLeft": { + "Ip": "239.0.0.3", + "Port": 50000, + "Device": 2, + "Name": "Gimbal Cam Left" + }, + "GimbalCamRight": { + "Ip": "239.0.0.4", + "Port": 50000, + "Device": 3, + "Name": "Gimbal Cam Right" + }, + "BackCam": { + "Ip": "239.0.0.5", + "Port": 50000, + "Device": 4, + "Name": "Back Cam" + }, + "AuxCam1": { + "Ip": "239.0.0.6", + "Port": 50000, + "Device": 5, + "Name": "Aux Cam 1" + }, + "AuxCam2": { + "Ip": "239.0.0.7", + "Port": 50000, + "Device": 6, + "Name": "Aux Cam 2" + }, + "AuxCam3": { + "Ip": "239.0.0.8", + "Port": 50000, + "Device": 7, + "Name": "Aux Cam 3" + }, + "AuxCam4": { + "Ip": "239.0.0.9", + "Port": 50000, + "Device": 8, + "Name": "Aux Cam 4" + }, + "Microscope": { + "Ip": "239.0.0.10", + "Port": 50000, + "Device": 9, + "Name": "Microscope" + } } } \ No newline at end of file