USST-RADSAT-SK / software-and-command

Code and Documentation for USST’s RADSAT-SK in their first Canadian CubeSat Project
8 stars 0 forks source link

Operation/adding initial functions for camera #209

Closed ATGr8 closed 1 year ago

w-moretti commented 2 years ago

Latest camera update:


[RAdcsCaptureTask.c] To get detection results and trigger a new detection:

  1. Initialize an empty instance of detection_results_t with detection_results_t data = {0} to hold the detection results.
  2. Call getResultsAndTriggerNewDetection(&data), which will fetch the detection status from CubeSense and calculate the resulting direction vector if detection was successful. See CubeSense's User Manual for more details.

Note 1: Depending on the frequency of the required detection results, it may be desired to change the internal logic of the function or separate the capture and detection functionalities into distinct functions.


[RImageCaptureTask.c] To capture and download an image:

  1. First, an image buffer is needed to allocate memory. Call full_image_t *image = initializeNewImage(<image_size>), where <image_size> is an integer between 0 and 4 (see CubeSense's ICD for more details). The function returns a pointer to the allocated memory for the image.
  2. To tell CubeSense to take a picture, then call captureImage(<camera>, <SRAM>, <location>), where: <camera> is either 0 (use Camera 1) or 1 (use Camera 2) <SRAM> is either 0 (store image in SRAM1) or 1 (store image in SRAM2) <location> is either 0 (store in Top Halve) or 1 (store in Bottom Halve)
  3. To download the captured image, call downloadImage(<SRAM>, <location>, image), where: <SRAM> is either 0 (image stored in SRAM1) or 1 (image stored in SRAM2) <location> is either 0 (get from Top Halve) or 1 (get from Bottom Halve) image is the pointer to the image buffer initialized in Step 1.
  4. Once the image is no longer needed, it is important to free the allocated memory by calling free(image)

Note 1: As per CubeSense's documentation, simple image capture is recommended to be done on the Bottom Halves of each SRAM to not conflict with the Top Halves used for the detection algorithm. Note 2: It is suggested to wait a small amount of time (<1 sec) between capturing and downloading an image, to allow enough time for CubeSense to store the captured image in its memory.

w-moretti commented 2 years ago

Also, for whatever reason, the commits aren't properly associated with my account, not sure how to correct that.