Skip to content

Commit

Permalink
Remove SPI speed for stability, switch extractor to Tetra3, cleanup i…
Browse files Browse the repository at this point in the history
…mports
  • Loading branch information
brickbots committed Mar 5, 2024
1 parent c062af8 commit 2527226
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion python/PiFinder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def init_display():

# init display (SPI hardware)
# 48,000,000 hz seems to be the fastest this display can support
serial = spi(device=0, port=0, bus_speed_hz=48000000)
# serial = spi(device=0, port=0, bus_speed_hz=48000000)
serial = spi(device=0, port=0)
device_serial = ssd1351(serial, rotate=0, bgr=True)
device_serial.capabilities(width=128, height=128, rotate=0, mode="RGB")
display_device = DeviceWrapper(device_serial, RED_RGB)
Expand Down
10 changes: 5 additions & 5 deletions python/PiFinder/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
from PiFinder import utils

sys.path.append(str(utils.tetra3_dir))
import PiFinder.tetra3
import cedar_detect_client
import PiFinder.tetra3.tetra3 as tetra3
from PiFinder.tetra3.tetra3 import cedar_detect_client


# Select method used for star detection and centroiding. True for cedar-detect,
# False for Tetra3.
USE_CEDAR_DETECT = True
USE_CEDAR_DETECT = False


def solver(shared_state, solver_queue, camera_image, console_queue, is_debug=False):
logging.getLogger("tetra3.Tetra3").addHandler(logging.NullHandler())
logging.debug("Starting Solver")
t3 = PiFinder.tetra3.tetra3.Tetra3(
t3 = tetra3.Tetra3(
str(utils.cwd_dir / "PiFinder/tetra3/tetra3/data/default_database.npz")
)
last_solve_time = 0
Expand Down Expand Up @@ -68,7 +68,7 @@ def solver(shared_state, solver_queue, camera_image, console_queue, is_debug=Fal
np_image, sigma=8, max_size=8, use_binned=True
)
else:
logging.info("Falling back to Tetra3 for centroiding")
# logging.info("Falling back to Tetra3 for centroiding")
centroids = tetra3.get_centroids_from_image(np_image)
t_extract = (precision_timestamp() - t0) * 1000
logging.debug(
Expand Down

0 comments on commit 2527226

Please sign in to comment.