Skip to content

Commit

Permalink
finished setting up ntcore output publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
GearBoxFox committed Feb 10, 2024
1 parent 38d6468 commit cafb8fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions py/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from pipeline.Capture import CVCapture
from pipeline.Detector import Detector
from output.StreamServer import MjpegServer
from output.OutputPublisher import NTOutputPublisher

import time
import ntcore

if __name__ == '__main__':
config = ConfigStore(LocalConfig(), RemoteConfig())
Expand All @@ -13,8 +15,11 @@
stream_server = MjpegServer()
file_config = FileConfigSource()
remote_config = NTConfigSource()
observation_publisher = NTOutputPublisher()

file_config.update(config)
ntcore.NetworkTableInstance.getDefault().setServer(config.local_config.server_ip)
ntcore.NetworkTableInstance.getDefault().startClient4(config.local_config.device_id)

detector = Detector(config)
stream_server.start(config)
Expand Down Expand Up @@ -42,4 +47,5 @@
tracked_objs = detector.update_tracker(objs)

image = detector.draw_bbox(image, tracked_objs)
observation_publisher.publish(config, timestamp, tracked_objs, fps)
stream_server.set_frame(image)

0 comments on commit cafb8fc

Please sign in to comment.