Image Collection Repository
Overview
Image collection is done on any computer running Linux on the drone. Image collection accesses the camera in the same manner as the airside system.
Repository:
GitHub - UWARG/image-collection: Collect images during flight.
Software
Setup - USB Camera
Follow the instructions to clone the repository and activate the environment: Autonomy Workflow Software
Install packages:
pip install -r requirements.txt
Usage - USB Camera
Prerequisites:
The username and home directory of the computer used is
warg
If it is not, change the username and home directory: How to rename Linux users and their home directory - Serverlab
Update the repository by running:
git checkout main
git pull
git submodule update --remote --merge
Copy the contents of rc.local.copyme
to /etc/rc.local
.
Modifying
/etc/rc.local
requires superuser access (e.g.sudo
)
Collecting images:
Connect the camera to the computer
Power on the computer:
If camera is not connected, image collection fails to start. Power off the computer and go to step 1
Image collection is automatically run on startup through the
/etc/rc.local
file
Collect images by pointing the camera towards the object(s) of interest
Power off the computer
Accessing images:
Disconnect all sensors
Power on the computer
Move or copy the images to be saved
Delete the images to free space for future collection
Setup - Raspberry Pi Camera Module 3
Clone the repository or update it as normal (same as USB Camera), following Autonomy Workflow Software, but please read the warning box before you do so!
When creating the virtual environment, use the --system-site-packages
option to include the system libraries, or do not activate a virtual environment.
The picamera2 library is pre-installed on PiOS, and it is not encouraged to install it using pip: https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf. Hence, we will use the pre-installed library instead.
Those libraries cannot be easily installed using pip and require additional steps, so we just use the provided library in global space. There are some missing dependencies when installing through pip, which causes build fail.
Usage - Raspberry Pi Camera Module 3
Option A: Run the script manually
python picam.py
The test_cam.py
file can be used to test camera settings using a preview and a monitor before image collection flights.
Option B: Run the script from bootup using /etc/rc.local
.
Copy the picamera section of rc.local.copyme
to /etc/rc.local
(starts the image capturing in the background):
Make sure you don’t activate any virtual environments beforehand!
To stop it when you’re done: