Commit Graph

82 Commits

Author SHA1 Message Date
Matt
869e4628ce Fix image rotation in test mode (#144) 2020-10-19 13:26:11 -04:00
Chris Gerth
3a78e23a55 Added input and output frame file save routines (#134)
* Added input and output frame file save routines

* First pass at review items

* Revised logic to not crash on start and pass tests

* Updated build.gradle to force line endings. Spotless passes now.

* Reverted lineEndings to not force Unix.

Gerth needs to fix up his dev pc.

Co-authored-by: Banks T <btrout.dhrs@gmail.com>
2020-10-16 21:49:50 -04:00
Matt
31013346c0 Rename MJPEG streams when camera name changes (#136)
* Rename MJPEG streams when camera name changes

* Change camera name to HTTP request

This allows us to wait for it to for sure be done

* Fix reload logic

* whee lnt

* Reload on backend connect too

* Update CameraAndPipelineSelect.vue
2020-10-16 19:48:24 -04:00
Banks T
e37fcdea98 Replace JPigpio, add hardware PWM support (#127)
* Send brightness properly to clients

* Refactor GPIO, add custom Pigpio socket wrapper

* Replace PiGPIO with PigpioPin, fix hardwarePWM

* Remove Jpigpio dependency

* Apply Spotless

* Warn user of Pigpio pin incapable of hardware PWM

* Begin rework of blinking and brightness control for vision leds

* Fixed blink, fixed brightness persistence, added bootup blink

* Cleanup HardwareManager access of config

* Apply spotless

* Skip hardware test on non-Pi

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2020-10-16 19:06:40 -04:00
Matt
23f3c0e6e1 Use chessboard squares (vs interior corners); fix resolution selector bug (#139)
* Change chessboard size to be squares not interior corners

This reduces ambiguity

* Force users to select resolution

This forces the correct video mode index to be selected. Otherwise the 0th camera videomode index will be used, as it's zero-inited. This is undesirable.

* Make target model an enum

This will allow the UI to remember the currently selected target.
2020-10-13 06:58:50 -07:00
Matt
6e0a6b804e Fix calibration slider not moving, hide gain slider when needed (#135) 2020-10-05 19:22:58 -07:00
Matt
2d7a4dd1b9 Add thread safety to Logger (#131) 2020-09-25 07:47:07 -07:00
Matt
28459704c6 Fix network config "Supported" bug (#130)
* Fix network config bug

* Use Jackson instead of hacky solution for management

* run spotless

* Add assertion
2020-09-24 18:34:47 -04:00
Matt
3305c6619d Fix pipeline duplication bug (#128) 2020-09-17 11:23:00 -07:00
Matt
24132555b8 Guarantee cameras always have the same ports (#123)
* Guarantee cameras always have the same ports

* clean up cscore stuff

* Fix stream api abuse
2020-09-15 19:00:26 -07:00
Matt
44bfc3ea6c Fix static IP and network settings on Pi 2020-09-15 11:34:27 -07:00
Matt
71fc8a7017 Metrics and lighting implementation (#116)
Implements metrics and lighting control.
2020-09-15 11:19:36 -07:00
Matt
b73c698e4d Never overwrite hardware config file (#122)
* Never overwrite hardware config file

* Remove unneeded assert
2020-09-13 12:58:07 -07:00
Matt
45686b7c9d Add NT servermode switch (#120) 2020-09-13 08:58:56 -07:00
Matt
2495d348ea Implement hostname, IP setting (#114) 2020-09-10 20:07:23 -07:00
Matt
a35f775b05 Fix driver mode settings, sort resolutions (#115)
* Fix DriverMode settings

* Update FileVisionSource.java

* Sort modes by resolution

* Filter duplicated modes

* run spotless

* Fix calibration bug

* run format

* aaaaa

* Add hardware and platform support

* decrease timing sensitivity

* Better handle jvm exitg

* Make reboot happen immediately

* Cleanup restart

* Remove debug print

* Fix Jackson exploding when deserializing old versions of configs

* Add unit test for old config versions

* Run format

* Add a comment

* remove isvendorcam from pipeline manager

* oops
2020-09-10 19:20:16 -07:00
Banks T
ddd15d362b PiCam Tweaks (#63)
* Update QuirkyCamera to do name-based matching

* Add pi-cam exposure set

* Refactor QuirkyCamera

* Add PiCam quirk test, fix tests for no-name quirky cameras

* Apply Spotless

* Add pinhole model unit test
2020-09-08 12:11:29 -04:00
Matt
73fc8e04ca Filter non-bgr modes on Pi (#112)
This can almost double performance in some cases.
2020-09-05 09:33:48 -07:00
Matt
c1d2cbf1de Revert "Stream threading (#110)" (#111)
This reverts commit 4c4b76a70e.
2020-09-05 00:09:01 -04:00
Xzibit
ef7c23c558 [Hardware] Run command to start pigpio daemon before connecting to it (#107)
* Don't start metrics thread

* Start pigpio daemon before connecting to it

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2020-09-04 18:47:13 -07:00
Banks T
4c4b76a70e Stream threading (#110)
* Condense pipeline settings classes

* Add OutputStreamPipeline
2020-09-04 18:35:11 -07:00
Matt
8a7318f5dd Update log viewer, add uncalibrated modal (#108)
Adds a prettier log viewer, with the ability to filter logs. Also warns user and prevents switching into 3d mode if the resolution is uncalibrated.
2020-09-04 18:18:44 -07:00
Banks T
ec9e3dcf79 Led control (#109)
* Refactor vision source manager to not suck

* Run spotless

* Fix settings not being saved

* run spotless

* add braudcast

* set LEDs based on pipeline

* GPIO refactor, hardwaremanager singleton change

* PiGPIO cleanup, add repeating blink, StatusLED

* Refactor CustomGPIO

* add ledMode NT Entry

* Add blink reset

* Blink fixes

* Move logic to VisionLED class

* Resolve comments, apply spotless

* "Fix' HardwareManagerTest

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2020-09-04 21:15:17 -04:00
Matt
7f4df2ff4d Auto reconnect to unconnected cameras (#40)
* Auto reconnect to unconnected cameras

* Refactor vision source manager to not suck

* Filter allowed video modes

* Run spotless

* Fix filtering

* Update VisionSourceManager.java

* Remove debug stuff

* Add unit tests, rebase

* run spotless

* Fix config test

* Fix settings not being saved

* run spotless

* oop

* kil debug prints if we have no usb cams to match

* whoooops

* add braudcast

* Actually save pipeline settings

* fix memes

* get right coeffs

* Run spotless

* run spotless

* rebase and add some prints

* Sorry min

* Oops reimpl matching

* Oops
2020-08-29 16:30:33 -07:00
Xzibit
8718be7a94 Remove GPU and RAM metrics (#105)
* Don't start metrics thread if not on linux

* [Hardware] remove GPU/RAM metrics
2020-08-28 13:43:50 -07:00
Xzibit
81e5eef7ae Status LEDs (#104)
* Don't start metrics thread if not on linux

* Add statusLED support

* [Hardware] Add status LED support

* [Hardware] Invalid LED port checks

* [Hardware] Check if statusLED exists in config
2020-08-27 14:53:02 -04:00
Banks T
b6d9fe216a Robot offset point (#98)
* Add offset point calculation in backend

* Add pipeline result caching

* Add dual offset unit test
2020-08-27 11:41:03 -07:00
Matt
9f0e89ea29 UI 3d mode, ConfigManager bugfixes (#103)
* stupid bugs I guess idk where else to put this commit

* Run spotless

* Fix config file loading

Splits load into own method

* Run spotless
2020-08-26 13:03:56 -04:00
Matt
fea72e18bf Create FPS limited streamers (#97) 2020-08-20 19:42:39 -04:00
Banks T
072075508c Disable drawing during color picking (#96)
Replaces showThreshold with shouldDraw
2020-08-20 11:45:28 -07:00
Matt
0f8507e6b3 Implement NetworkTables (#95)
* Implement NetworkTables stuff

* Update RequestHandler.java

* run spotless

* Address review

* fix comments and cleanup more
2020-08-19 20:08:24 -04:00
Xzibit
1bcf58fc51 Don't start metrics thread if not on linux (#93) 2020-08-18 13:15:54 -04:00
Matt
87186809c9 Buffer setting save (#51)
This makes it so that settings are written to disk 1 second after settings have stopped being changed. This means that while dragging sliders in the UI, settings won't be written repeatedly. This reduces wear on system storage and improves performance, as saving is expensive.
2020-08-17 13:25:28 -07:00
Banks T
38099e79cf Fix and unit test TimedTaskManager (#91)
Adds TimedTaskManager unit test and switches back to standard executor instead of the custom subclass.
2020-08-17 13:24:15 -07:00
Banks T
832d8413e1 Fix selective send (#90)
* Move VisionSettingsChangeSubscriber to own class

* Use selective sending on simple PSCs

* Fix origin context skip logic
2020-08-17 13:20:36 -07:00
Matt
b3436765e1 3d, camera calibration, backend settings hookup (#80)
* Implement new UI backend stuff

* Kinda partially add resolution accuracy list

* camera calibration go brrrrrrrr

* ayyyy calibration works

* Maybe fix grouping

* Reorganize camera view

* Fix settings not getting sent

* Make pretty (#4)

* Reorganize camera view

* Apply some cosmetic layout changes to the cameras page

* Fix pipeline rollback bug when starting on non-dashboard pages

Co-authored-by: Matt <matthew.morley.ca@gmail.com>

* Fix naming mismatch

* Mostly make stuff work

* rename robot-relative pose to camera-relative pose

* SolvePNP memes, fix isFovConfigurable

* Change config path to photonvision_config

* netmask go poof, fix zip download?

* Update index.js

* Fix multi cam stuff?

* Use LinearFilter instead

* Fix multicam

* aaa

* start adding restart device and restart program, fix square size bug

* Add some debug stuff

* oop

* Start fixing tests

* Fix tests

* Make target box proportinal

* run spotless

* Make crosshair h o t p i n k

* Address review comments

* Address review 2 electric booaloo

* Possibly implement vendor FOV?

* Make centroid crosshair gren

* actually use FOV

* Fix tests

* actually fix tests

Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
2020-08-14 12:39:21 -07:00
Banks T
86ea661ed9 Fix camera matching (#87)
* Add name matching

* Remove index matching

* Add name-only matching fallback

* Fix debug log location, fix name matching

* Apply LessSpot
2020-08-08 21:30:39 -04:00
Banks T
ff58381056 WPI Image Test Mode (#81)
* Add camera config for calibration to test mode

* Add 3D capabilities to test mode

* Add resources to main for jar testmode

* Refactor path utilities for test mode

* Apply spotless
2020-08-08 14:21:38 -04:00
Banks T
10fb1619ea Add CLI options (#74)
* Added CLI options

* Wording fix
2020-08-06 01:42:53 -04:00
Banks T
7b457efc55 Add FileVisionSource (#71) 2020-08-05 18:43:56 -04:00
Xzibit
dea68041fb Calibration and metrics clean up. (#68)
* Add more calibration metrics
* Cleanup metrics
* Rename PWM fields to match convention
2020-08-04 13:19:40 -07:00
Xzibit
0b98dc3c9f Hardware Management, Metrics, PWM/GPIO support. (#12)
* [Server] Hardware Management

* [Server] Hardware Management

* [Server] Hardware Management

* [Server] Hardware Management

* [Server] Hardware Management

* [Server] Hardware Management

* Added metricsPublisher

* [Server] Hardware Management

* [Server] Hardware Management

* Fill in HardwareConfig, allow JSON Comments

* Use hardware config

* [Hardware Management] Use Hardware Config

* [Hardware Management] Use softPWM for dimming

* [Hardware] Added HardwareConfig Test

* [Hardware] Started HardwareManager

* Start metrics thread in hardwareManager

* [Hardware] Added Hardware Manager Test

* [Hardware] Spotless

* [Hardware] Added logging, cleaned up HardwareConfig

* [Hardware] Added logging to PWM class

* [Hardware] Rebase off master, fix merge conflicts

* [Hardware] Ignore metrics commands if on pi

* [Hardware] Remove GPIO provision after shutdown

* [Hardware] Switch over to diozero

* [Hardware] Use broadcom pins

* [Hardware] Fix PWM port

* [Hardware] Use jpi instead of pigpio

* [Hardware] Use dizero-core

* [Hardware] No need to close LED

* [Hardware] Switch to jpigpio

* [Hardware] Initalize JPiGPIO in unit tests

* [Hardware] Use dutyCycle for LED dimming

* [Hardware] Add blink test to HardwareManager

* [Hardware] Fix PWM port

* [Hardware] Fix HardwareManagerTest

* [Hardware] Fix HardwareManagerTest

* [Hardware] Use waves for LED blinking

* [Hardware] Make blinking part of PWM

* [Hardware] Add API methods to hardware Manager

* [Hardware] Only start pigpio if on pi

* [Hardware] Merge PWM classes into GPIO

* [Hardware] Add Hardware stuff to VisionModules

* [Hardware] Remove random semicolon

Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
2020-07-31 15:43:58 -04:00
Banks T
3f5898e73d Camera gain (#62)
* Add default QuirkyCamera, make quirks public in USBCameraSource

* Add gain send, fix PS3Eye VID/PID

* Fix ps3eye test
2020-07-28 20:18:04 -07:00
Banks T
429241f838 Stream FPS Cap (#64) 2020-07-28 21:24:36 -04:00
Banks T
48851470ae Various logging cleanups (#65)
* Various logging cleanups

* Move device info to string, apply spotless
2020-07-28 21:20:54 -04:00
Banks T
a6dc41f4da Fix VisionSource device filtering (#60)
* Fix VisionSource filtering

* Apply spotless

* Change method ordering

* change one single character
2020-07-28 02:54:42 -04:00
Banks T
37a6d4e424 Catch VideoException when setting camera properties (#58)
* Catch VideoException when setting camera properties

* Fix test settables, add log message
2020-07-24 16:46:33 -04:00
Banks T
91c1f8000e TimedTaskManager Exception Handling (#56)
* Refactor of TimedTaskManager to use custom Executor

* Apply spotless

* Fix exception logging

* Apply spotless

* Fix bad reference
2020-07-24 12:05:48 -07:00
Banks T
77fd6a84c8 Logging additions 2 (#55)
* Add overload to logger.error() for Throwable to print stack trace

* Replaced all e.printStackTrace() with logger.error()

* Log level dependent on dev or release
2020-07-24 09:06:54 -07:00
Banks T
22d7ccc74d Add camera name blacklist for bad devices (#54) 2020-07-23 22:37:25 -07:00