This exercise was part of the testing open star tracker in a Raspberry Pi Zero W 2.
The Open Star Tracker documentation hasn't detailed very well the steps to install all the prerequisite to make it work. So after some iterations these are the steps to install it.
The goal is to install OpenStarTracker using miniconda, assuming a Debian 12.12 fresh install using a regular account star (not as root)
adduser star
echo "star ALL=(ALL:ALL) ALL" > /etc/sudoers.d/star
sudo apt install build-essential autoconf automake gdb git \
libffi-dev zlib1g-dev \
libssl-dev astrometry.net \
cmake libsystemd-dev \
kg-config graphviz bc \
cmake pkg-config libsystemd-dev
There is a lot documentation on how to install miniconda, those are the basic steps for installing it on aarch64 cpu architecture.
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh
Re-login to reload the conda env variables.
conda create --name openst
conda activate openst
conda install scipy pandas swig opencv astropy
For some unknown reason gprof2dot is not available in conda but in pip3.
pip3 install gprof2dot
OpenStarTracker requires systemd-python to run the unit tests and is not available on conda nor pip, so this is the way to install it.
pip3 install 'git+https://github.com/systemd/python-systemd.git#egg=systemd-python'
cd /usr/share/astrometry
sudo wget http://data.astrometry.net/4100/index-4112.fits
sudo wget http://data.astrometry.net/4100/index-4113.fits
sudo wget http://data.astrometry.net/4100/index-4114.fits
sudo wget http://data.astrometry.net/4100/index-4115.fits
sudo wget http://data.astrometry.net/4100/index-4116.fits
sudo wget http://data.astrometry.net/4100/index-4117.fits
sudo wget http://data.astrometry.net/4100/index-4118.fits
sudo wget http://data.astrometry.net/4100/index-4119.fits
cd
git clone https://github.com/UBNanosatLab/openstartracker.git
cd openstartracker/tests
Check the python version
which python3
/home/star/miniconda3/envs/openst/bin/python3
Modify the default python location in the file unit_test.sh changing the variable PYTHON
cd openstartracker/tests/
vim unit_test.sh
#PYTHON="/usr/bin/python3.10"
PYTHON="/home/star/miniconda3/envs/openst/bin/python3"
Modify the python headers from the Makefiles
vim ../beast/Makefile
#PYTHONHEADERS=/usr/include/python3.10
PYTHONHEADERS=/home/star/miniconda3/envs/openst/include/python3.13
Modify the header in simulator.py
#!/home/star/miniconda3/envs/openst/bin/python3
Now you should able to run the unit tests as follow (be patience).
./unit_test.sh -crei science_cam_may8_0.05sec_gain40
g++ -std=c++11 -Wall -Ofast -g -pg test.c -o test -lm
swig -python -c++ beast.i
config.h:28: Warning 454: Setting a pointer/reference variable may leak memory.
stars.h:176: Warning 509: Overloaded method star_db::operator +=(star const *) effectively ignored,
stars.h:163: Warning 509: as it is shadowed by star_db::operator +=(star const &).
g++ -g -O3 -std=c++11 -Ofast -fPIC -c beast_wrap.cxx -o beast_wrap.o -lstdc++ -I/home/star/miniconda3/envs/openst/include/python3.13
g++ -g -O3 -shared -fPIC beast_wrap.o -o _beast.so
Calibrating...
[ WARN:[email protected]] global loadsave.cpp:1063 imwrite_ Unsupported depth image for selected encoder is fallbacked to CV_8U.
diff: science_cam_may8_0.05sec_gain40/calibration_data/checksum.txt: No such file or directory
Clearing old calibration data:
solve-field --skip-solved --cpulimit 60 science_cam_may8_0.05sec_gain40/calibration_data/img4.png
Reading input file 1 of 1: "science_cam_may8_0.05sec_gain40/calibration_data/img4.png"...
Read file stdin: 1392 x 1040 pixels x 1 color(s); maxval 255
Using 8-bit output
Extracting sources...
simplexy: found 973 sources.
Solving...
Reading file "science_cam_may8_0.05sec_gain40/calibration_data/img4.axy"...
Field 1 did not solve (index index-4119.fits, field objects 1-10).
Field 1 did not solve (index index-4118.fits, field objects 1-10).
Field 1 did not solve (index index-4117.fits, field objects 1-10).
Field 1 did not solve (index index-4116.fits, field objects 1-10).
Field 1 did not solve (index index-4115.fits, field objects 1-10).
Field 1 did not solve (index index-4114.fits, field objects 1-10).
log-odds ratio 42.4583 (2.75041e+18), 8 match, 0 conflict, 18 distractors, 33 index.
RA,Dec = (179.821,15.7389), pixel scale 15.7184 arcsec/pix.
Hit/miss: Hit/miss: -+-++--+-+-+--------+----+(best)----------------------------------+--------------c-----------------+------
Field 1: solved with index index-4113.fits.
Field 1 solved: writing to file science_cam_may8_0.05sec_gain40/calibration_data/img4.solved to indicate this.
Field: science_cam_may8_0.05sec_gain40/calibration_data/img4.png
Field center: (RA,Dec) = (179.816145, 15.734701) deg.
Field center: (RA H:M:S, Dec D:M:S) = (11:59:15.875, +15:44:04.922).
Field size: 6.06461 x 4.55756 degrees
Field rotation angle: up is 179.233 degrees E of N
Field parity: neg
Creating new FITS file "science_cam_may8_0.05sec_gain40/calibration_data/img4.new"...
Creating index object overlay plot...
Creating annotation plot...
Your field contains:
The star Denebola / Deneb Aleet (β Leo / 94 Leo)
The star 3 Com
The star o Leo / 95 Leo
[... snipped...]