Skip to content

Commit

Permalink
deploy: 767c94f
Browse files Browse the repository at this point in the history
  • Loading branch information
NValsted committed Apr 14, 2024
0 parents commit 74d2dc7
Show file tree
Hide file tree
Showing 110 changed files with 10,293 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 1e0214877af56aa3010c006124e215bf
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/disco-1.doctree
Binary file not shown.
Binary file added .doctrees/disco-1/index.doctree
Binary file not shown.
Binary file added .doctrees/disco-1/wp1-payload.doctree
Binary file not shown.
Binary file added .doctrees/disco-1/wp2-project.doctree
Binary file not shown.
Binary file added .doctrees/disco-2.doctree
Binary file not shown.
Binary file added .doctrees/disco-2/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/disco-2/software/index.doctree
Binary file not shown.
Binary file added .doctrees/disco-2/software/system-setup.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/disco-2/sub-docs/csp_proc/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
21 changes: 21 additions & 0 deletions _downloads/3ce011f7ecc935c644467df404f75f55/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 discosat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
74 changes: 74 additions & 0 deletions _downloads/9fd53ad819a247ddcbb0e5c4cf177636/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>csp_proc: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">csp_proc
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
<div class="headertitle">
<div class="title">csp_proc Documentation</div> </div>
</div><!--header-->
<div class="contents">
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
Binary file added _images/camera_sequence_diagram.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/image_batch.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/image_data_content.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/picocore-bbdsi-connector-layout.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/pipeline_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/pixel-formats-raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions _sources/disco-1.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Disco1


## Example Text

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


## Table

| No. | Prime |
| ---- | ------ |
| 1 | No |
| 2 | Yes |
| 3 | Yes |
| 4 | No |



## Code blocks

The following is a Python code block:
```python
def hello():
print("Hello world")
```

And this is a C code block:
```c
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
```


## Math

This creates an equation:
```{math}
a^2 + b^2 = c^2
```

This is an in-line equation, {math}`a^2 + b^2 = c^2`, embedded in text.
9 changes: 9 additions & 0 deletions _sources/disco-1/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=======
Disco 1
=======

.. toctree::
wp1-payload.md
wp2-project.md
wp3-bus.md
wp4-software.md
51 changes: 51 additions & 0 deletions _sources/disco-1/wp1-payload.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Work Package 1 - Payload


## Example Text

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


## Table

| No. | Prime |
| ---- | ------ |
| 1 | No |
| 2 | Yes |
| 3 | Yes |
| 4 | No |



## Code blocks

The following is a Python code block:
```python
def hello():
print("Hello world")
```

And this is a C code block:
```c
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
```


## Math

This creates an equation:
```{math}
a^2 + b^2 = c^2
```

This is an in-line equation, {math}`a^2 + b^2 = c^2`, embedded in text.
7 changes: 7 additions & 0 deletions _sources/disco-1/wp2-project.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# WP2 Project

## Timeline
First this then that

## Milestones
Some milestones are reached and others not
14 changes: 14 additions & 0 deletions _sources/disco-2.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Disco 2

## Subsection

Exciting documentation in here.
Let's make a list (empty surrounding lines required):

- item 1

- nested item 1
- nested item 2

- item 2
- item 3
18 changes: 18 additions & 0 deletions _sources/disco-2/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=======
Disco 2
=======

.. toctree::
software/index.rst
..
wp0_management.md
wp10-science.md
wp1-payload.md
wp2-2ndpayload.md
wp3-Structure.md
wp4-uhf.md
wp5-sband.md
wp6-legal.md
wp7-operation.md
wp8-integration.md
wp9-pr.md
79 changes: 79 additions & 0 deletions _sources/disco-2/software/camera-controller.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Camera Controller
[The Disco-2 camera controller](https://github.com/ivaroli/DiscoCameraController) is a controller that controls the visible and IR light cameras onboard the Disco-2 payload. It's purpose is to fetch raw image data from the camera sensors and pass them to the image processing pipeline (DIPP). It interfaces with the processing pipeline over System V message queue and shared memory, and it exposes a parameter with libparam over CSP that allows sending of image capture instructions.

## Overview

### Image data
When the camera captures an image from the visible light cameras, the controller captures the raw **BayerRG** data from the camera sensor. The controller then packages the data into a `unsigned char *data` array. It also prepends a 4 byte integer in front of the image data, indicating the size of the image. A diagram representing the data generated from a single image is below:

![Data reprisentation of a single image](img/image_data_content.drawio.png)

The camera can also capture a burst of images. This burst of images will be packaged together into a single batch that will be sent to the image processing pipeline.

![Data reprisentation of a burst of images](img/image_batch.drawio.png)

The image processing pipeline and the camera communicate using [System V Shared Memory](https://docs.oracle.com/cd/E19683-01/816-5042/svipc-41256/index.html) and a [System V Message Queue](https://docs.oracle.com/cd/E19683-01/816-5042/svipc-23310/index.html). When the camera captures a burst of images, it generates a shared memory segment and inserts the image data into it. Afterwards, the camera controller sends a System V message queue message to the image processing pipeline to signal that the images are ready for processing. Upon receiving this message, the processing pipeline retrieves the images from the shared memory segment before deallocating it. The message queue message is structured as a defined struct, as shown below.

```c
typedef struct ImageBatch {
long mtype; /* message type to read from the message queue */
int height; /* height of images */
int width; /* width of images */
int channels; /* channels of images */
int num_images; /* amount of images */
int batch_size; /* size of the entire image batch of data */
int shm_key; /* key to shared memory segment of image data */
int pipeline_id; /* id of pipeline to utilize for processing */
unsigned char *data; /* address to image data (in shared memory) */
} ImageBatch;
```

Below is a sequence diagram illustrating the entire process of capturing images and delivering them to the processing pipeline:

![Sequecne diagram of capturing images and delivering them to the processing pipeline](img/camera_sequence_diagram.drawio.png)

### Visible light sensor data
The camera controller captures raw data from the visible light image sensors in a BayerRG format with a 12-bit pixel depth. In this format, every two bytes in the image data represent a single R, G, or B pixel. This approach is taken to grant the image processing pipeline greater control over image processing. Below is a visual representation of the BayerRG pixel format.

![Sequence diagram of capturing images and delivering them to the processing pipeline](img/pixel-formats-raw.png)

### IR light sensor data
**Undecided**

## Capturing images
The camera controller exposes a CSP parameter through [libparam](https://github.com/spaceinventor/libparam), called `capture_param`. This parameter is a semi-colon seperated string of values describing the image capture. An example of a CSH command setting this parameter is below:

```
set capture_param "CAMERA_TYPE=VMB;CAMERA_ID=1800 U-2040c;NUM_IMAGES=10;EXPOSURE=55000;ISO=0;INTERVAL=55000;"
```

The possible values that can be set are the following.

| Name | Type | Example | Description | Required | Default |
|-------------|-------------|----------------|---------------------------------------------------------------|-----------------|----------------------------------------|
| CAMERA_ID | string | 1800 U-2040c | The model of the camera to capture with | True | N/A |
| CAMERA_TYPE | string | VMB | The camera type to capture with | FALSE | VMB |
| EXPOSURE | int | 55000 | Exposure in microseconds | False | If not set, then exposure is estimated |
| ISO | double | 1.0 | ISO or gain | False | 1 |
| NUM_IMAGES | int | 10 | Number of images to capture | False | 1 |
| INTERVAL | int | 0 | Delay between images in microseconds (not including exposure) | False | 0 |

## Building
The Camera controller is built with the Meson build system. A build script is included in the [github repository](https://github.com/ivaroli/DiscoCameraController). Simply call `./configure.sh` and the controller will be built.

## Error log
The camera controller provides an integer parameter via the CSP parameter named error_log, denoting the latest cause of failure encountered during image capture. Refer to the table below for the list of potential error codes along with their respective explanations.

| Error Code | Description |
|------------|-----------------------------------------------------------|
| 0 | Success |
| 100 | General error in parsing of capture instructions |
| 101 | Invalid camera type or camera type implementation missing |
| 102 | CAMERA_ID is missing from capture instructions |
| 103 | NUM_IMAGES to capture is 0 |
| 200 | General error during image capture |
| 201 | No cameras connected or found |
| 202 | Camera with id CAMERA_ID not found |
| 300 | General error in message queue |
| 301 | Unable to create shared memory space |
| 302 | Unable to insert data into memory space |
Loading

0 comments on commit 74d2dc7

Please sign in to comment.