Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
/*
|
2020-12-31 19:57:51 -08:00
|
|
|
* Copyright (C) Photon Vision.
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2022-01-20 19:35:28 -08:00
|
|
|
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
package org.photonvision;
|
|
|
|
|
|
2022-03-16 21:33:20 -07:00
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.nio.file.Path;
|
2020-08-08 14:21:38 -04:00
|
|
|
import java.util.ArrayList;
|
2022-03-16 21:33:20 -07:00
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.stream.Collectors;
|
2020-08-06 01:42:53 -04:00
|
|
|
import org.apache.commons.cli.*;
|
2020-08-08 14:21:38 -04:00
|
|
|
import org.photonvision.common.configuration.CameraConfiguration;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
import org.photonvision.common.configuration.ConfigManager;
|
2020-07-12 12:29:30 -04:00
|
|
|
import org.photonvision.common.dataflow.networktables.NetworkTablesManager;
|
2020-09-15 11:19:36 -07:00
|
|
|
import org.photonvision.common.hardware.HardwareManager;
|
2022-12-26 21:51:34 -06:00
|
|
|
import org.photonvision.common.hardware.PiVersion;
|
2020-07-31 15:43:58 -04:00
|
|
|
import org.photonvision.common.hardware.Platform;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
import org.photonvision.common.logging.LogGroup;
|
2020-07-11 22:43:19 -04:00
|
|
|
import org.photonvision.common.logging.LogLevel;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
import org.photonvision.common.logging.Logger;
|
|
|
|
|
import org.photonvision.common.networking.NetworkManager;
|
2020-08-08 14:21:38 -04:00
|
|
|
import org.photonvision.common.util.TestUtils;
|
2021-09-23 17:48:18 -05:00
|
|
|
import org.photonvision.common.util.numbers.IntegerCouple;
|
2022-12-28 11:21:41 -08:00
|
|
|
import org.photonvision.raspi.LibCameraJNI;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
import org.photonvision.server.Server;
|
2020-08-08 14:21:38 -04:00
|
|
|
import org.photonvision.vision.camera.FileVisionSource;
|
2020-12-20 20:09:39 -06:00
|
|
|
import org.photonvision.vision.opencv.CVMat;
|
2020-10-13 06:58:50 -07:00
|
|
|
import org.photonvision.vision.opencv.ContourGroupingMode;
|
2021-09-23 17:48:18 -05:00
|
|
|
import org.photonvision.vision.opencv.ContourShape;
|
2022-09-28 18:21:41 -07:00
|
|
|
import org.photonvision.vision.pipeline.AprilTagPipelineSettings;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
import org.photonvision.vision.pipeline.CVPipelineSettings;
|
2021-09-03 19:20:55 -07:00
|
|
|
import org.photonvision.vision.pipeline.ColoredShapePipelineSettings;
|
2020-12-20 20:09:39 -06:00
|
|
|
import org.photonvision.vision.pipeline.PipelineProfiler;
|
2020-08-08 14:21:38 -04:00
|
|
|
import org.photonvision.vision.pipeline.ReflectivePipelineSettings;
|
2020-08-29 16:30:33 -07:00
|
|
|
import org.photonvision.vision.processes.VisionModule;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
import org.photonvision.vision.processes.VisionModuleManager;
|
|
|
|
|
import org.photonvision.vision.processes.VisionSource;
|
|
|
|
|
import org.photonvision.vision.processes.VisionSourceManager;
|
2020-08-08 14:21:38 -04:00
|
|
|
import org.photonvision.vision.target.TargetModel;
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
|
|
|
|
|
public class Main {
|
|
|
|
|
public static final int DEFAULT_WEBPORT = 5800;
|
|
|
|
|
|
2020-08-06 01:42:53 -04:00
|
|
|
private static final Logger logger = new Logger(Main.class, LogGroup.General);
|
2020-08-17 13:25:28 -07:00
|
|
|
private static final boolean isRelease = PhotonVersion.isRelease;
|
2020-08-06 01:42:53 -04:00
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
private static boolean isTestMode = false;
|
2022-03-16 21:33:20 -07:00
|
|
|
private static Path testModeFolder = null;
|
2020-08-06 01:42:53 -04:00
|
|
|
private static boolean printDebugLogs;
|
|
|
|
|
|
|
|
|
|
private static boolean handleArgs(String[] args) throws ParseException {
|
|
|
|
|
final var options = new Options();
|
|
|
|
|
options.addOption("d", "debug", false, "Enable debug logging prints");
|
|
|
|
|
options.addOption("h", "help", false, "Show this help text and exit");
|
2021-03-07 21:39:02 -05:00
|
|
|
options.addOption(
|
|
|
|
|
"t",
|
|
|
|
|
"test-mode",
|
|
|
|
|
false,
|
|
|
|
|
"Run in test mode with 2019 and 2020 WPI field images in place of cameras");
|
2020-08-06 01:42:53 -04:00
|
|
|
|
2022-03-16 21:33:20 -07:00
|
|
|
options.addOption("p", "path", true, "Point test mode to a specific folder");
|
|
|
|
|
|
2020-08-06 01:42:53 -04:00
|
|
|
CommandLineParser parser = new DefaultParser();
|
|
|
|
|
CommandLine cmd = parser.parse(options, args);
|
|
|
|
|
|
|
|
|
|
if (cmd.hasOption("help")) {
|
|
|
|
|
HelpFormatter formatter = new HelpFormatter();
|
|
|
|
|
formatter.printHelp("java -jar photonvision.jar [options]", options);
|
|
|
|
|
return false; // exit program
|
|
|
|
|
} else {
|
|
|
|
|
if (cmd.hasOption("debug")) {
|
|
|
|
|
printDebugLogs = true;
|
|
|
|
|
logger.info("Enabled debug logging");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cmd.hasOption("test-mode")) {
|
|
|
|
|
isTestMode = true;
|
|
|
|
|
logger.info("Running in test mode - Cameras will not be used");
|
2022-03-16 21:33:20 -07:00
|
|
|
|
|
|
|
|
if (cmd.hasOption("path")) {
|
2022-09-28 18:21:41 -07:00
|
|
|
Path p = Path.of(System.getProperty("PATH_PREFIX", "") + cmd.getOptionValue("path"));
|
2022-03-16 21:33:20 -07:00
|
|
|
logger.info("Loading from Path " + p.toAbsolutePath().toString());
|
|
|
|
|
testModeFolder = p;
|
|
|
|
|
}
|
2020-08-06 01:42:53 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-16 21:33:20 -07:00
|
|
|
private static void addTestModeFromFolder() {
|
|
|
|
|
ConfigManager.getInstance().load();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
var reflective = new ReflectivePipelineSettings();
|
|
|
|
|
var shape = new ColoredShapePipelineSettings();
|
2022-09-28 18:21:41 -07:00
|
|
|
var aprilTag = new AprilTagPipelineSettings();
|
2022-03-16 21:33:20 -07:00
|
|
|
List<VisionSource> collectedSources =
|
|
|
|
|
Files.list(testModeFolder)
|
|
|
|
|
.filter(p -> p.toFile().isFile())
|
|
|
|
|
.map(
|
|
|
|
|
p -> {
|
|
|
|
|
try {
|
2022-09-28 18:21:41 -07:00
|
|
|
// var camConf =
|
|
|
|
|
//
|
|
|
|
|
// ConfigManager.getInstance()
|
|
|
|
|
// .getConfig()
|
|
|
|
|
//
|
|
|
|
|
// .getCameraConfigurations()
|
|
|
|
|
//
|
|
|
|
|
// .get(p.getFileName().toString());
|
|
|
|
|
|
|
|
|
|
// if (camConf == null && false) {
|
|
|
|
|
CameraConfiguration camConf;
|
|
|
|
|
if (true) {
|
2022-03-16 21:33:20 -07:00
|
|
|
camConf =
|
|
|
|
|
new CameraConfiguration(
|
|
|
|
|
p.getFileName().toString(), p.toAbsolutePath().toString());
|
|
|
|
|
camConf.FOV = TestUtils.WPI2019Image.FOV; // Good guess?
|
2022-09-28 18:21:41 -07:00
|
|
|
camConf.addCalibration(TestUtils.get2020LifeCamCoeffs(false));
|
2022-03-16 21:33:20 -07:00
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
var pipeSettings = new AprilTagPipelineSettings();
|
2022-03-16 21:33:20 -07:00
|
|
|
pipeSettings.pipelineNickname = p.getFileName().toString();
|
|
|
|
|
pipeSettings.outputShowMultipleTargets = true;
|
|
|
|
|
pipeSettings.inputShouldShow = true;
|
2022-09-28 18:21:41 -07:00
|
|
|
pipeSettings.outputShouldShow = false;
|
|
|
|
|
pipeSettings.solvePNPEnabled = true;
|
2022-03-16 21:33:20 -07:00
|
|
|
|
|
|
|
|
var psList = new ArrayList<CVPipelineSettings>();
|
2022-09-28 18:21:41 -07:00
|
|
|
// psList.add(reflective);
|
|
|
|
|
// psList.add(shape);
|
|
|
|
|
psList.add(aprilTag);
|
2022-03-16 21:33:20 -07:00
|
|
|
camConf.pipelineSettings = psList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new FileVisionSource(camConf);
|
|
|
|
|
} catch (Exception e) {
|
2022-09-28 18:21:41 -07:00
|
|
|
logger.error("Couldn't load image " + p.getFileName().toString(), e);
|
2022-03-16 21:33:20 -07:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.filter(Objects::nonNull)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
ConfigManager.getInstance().unloadCameraConfigs();
|
|
|
|
|
VisionModuleManager.getInstance().addSources(collectedSources).forEach(VisionModule::start);
|
|
|
|
|
ConfigManager.getInstance().addCameraConfigurations(collectedSources);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
logger.error("Path does not exist!");
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 16:30:33 -07:00
|
|
|
private static void addTestModeSources() {
|
2022-01-10 16:51:06 -08:00
|
|
|
ConfigManager.getInstance().load();
|
2020-08-08 14:21:38 -04:00
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
var camConfApril =
|
|
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("Apriltag");
|
|
|
|
|
if (camConfApril == null) {
|
|
|
|
|
camConfApril =
|
|
|
|
|
new CameraConfiguration("Apriltag", TestUtils.getTestModeApriltagPath().toString());
|
|
|
|
|
camConfApril.FOV = TestUtils.WPI2019Image.FOV;
|
|
|
|
|
camConfApril.calibrations.add(TestUtils.get2019LifeCamCoeffs(true));
|
|
|
|
|
|
|
|
|
|
var pipeline2019 = new AprilTagPipelineSettings();
|
|
|
|
|
pipeline2019.pipelineNickname = "Robots";
|
|
|
|
|
pipeline2019.outputShowMultipleTargets = true;
|
|
|
|
|
pipeline2019.inputShouldShow = true;
|
|
|
|
|
|
|
|
|
|
var psList2019 = new ArrayList<CVPipelineSettings>();
|
|
|
|
|
psList2019.add(pipeline2019);
|
|
|
|
|
camConfApril.pipelineSettings = psList2019;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 16:30:33 -07:00
|
|
|
var camConf2019 =
|
2022-01-10 16:51:06 -08:00
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("WPI2019");
|
|
|
|
|
if (camConf2019 == null) {
|
|
|
|
|
camConf2019 =
|
|
|
|
|
new CameraConfiguration("WPI2019", TestUtils.getTestMode2019ImagePath().toString());
|
|
|
|
|
camConf2019.FOV = TestUtils.WPI2019Image.FOV;
|
|
|
|
|
camConf2019.calibrations.add(TestUtils.get2019LifeCamCoeffs(true));
|
|
|
|
|
|
|
|
|
|
var pipeline2019 = new ReflectivePipelineSettings();
|
|
|
|
|
pipeline2019.pipelineNickname = "CargoShip";
|
|
|
|
|
pipeline2019.targetModel = TargetModel.k2019DualTarget;
|
|
|
|
|
pipeline2019.outputShowMultipleTargets = true;
|
|
|
|
|
pipeline2019.contourGroupingMode = ContourGroupingMode.Dual;
|
|
|
|
|
pipeline2019.inputShouldShow = true;
|
|
|
|
|
|
|
|
|
|
var psList2019 = new ArrayList<CVPipelineSettings>();
|
|
|
|
|
psList2019.add(pipeline2019);
|
|
|
|
|
camConf2019.pipelineSettings = psList2019;
|
|
|
|
|
}
|
2020-08-08 14:21:38 -04:00
|
|
|
|
2020-08-29 16:30:33 -07:00
|
|
|
var camConf2020 =
|
2022-01-10 16:51:06 -08:00
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("WPI2020");
|
|
|
|
|
if (camConf2020 == null) {
|
|
|
|
|
camConf2020 =
|
|
|
|
|
new CameraConfiguration("WPI2020", TestUtils.getTestMode2020ImagePath().toString());
|
|
|
|
|
camConf2020.FOV = TestUtils.WPI2020Image.FOV;
|
|
|
|
|
camConf2020.calibrations.add(TestUtils.get2019LifeCamCoeffs(true));
|
|
|
|
|
|
|
|
|
|
var pipeline2020 = new ReflectivePipelineSettings();
|
|
|
|
|
pipeline2020.pipelineNickname = "OuterPort";
|
|
|
|
|
pipeline2020.targetModel = TargetModel.k2020HighGoalOuter;
|
|
|
|
|
camConf2020.calibrations.add(TestUtils.get2020LifeCamCoeffs(true));
|
|
|
|
|
pipeline2020.inputShouldShow = true;
|
|
|
|
|
|
|
|
|
|
var psList2020 = new ArrayList<CVPipelineSettings>();
|
|
|
|
|
psList2020.add(pipeline2020);
|
|
|
|
|
camConf2020.pipelineSettings = psList2020;
|
|
|
|
|
}
|
2020-08-29 16:30:33 -07:00
|
|
|
|
2022-01-10 16:51:06 -08:00
|
|
|
var camConf2022 =
|
|
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("WPI2022");
|
|
|
|
|
if (camConf2022 == null) {
|
|
|
|
|
camConf2022 =
|
|
|
|
|
new CameraConfiguration("WPI2022", TestUtils.getTestMode2022ImagePath().toString());
|
|
|
|
|
camConf2022.FOV = TestUtils.WPI2022Image.FOV;
|
|
|
|
|
camConf2022.calibrations.add(TestUtils.get2019LifeCamCoeffs(true));
|
|
|
|
|
|
|
|
|
|
var pipeline2022 = new ReflectivePipelineSettings();
|
|
|
|
|
pipeline2022.pipelineNickname = "OuterPort";
|
|
|
|
|
pipeline2022.targetModel = TargetModel.k2020HighGoalOuter;
|
|
|
|
|
pipeline2022.inputShouldShow = true;
|
|
|
|
|
// camConf2020.calibrations.add(TestUtils.get2020LifeCamCoeffs(true));
|
|
|
|
|
|
|
|
|
|
var psList2022 = new ArrayList<CVPipelineSettings>();
|
|
|
|
|
psList2022.add(pipeline2022);
|
|
|
|
|
camConf2022.pipelineSettings = psList2022;
|
|
|
|
|
}
|
2020-08-29 16:30:33 -07:00
|
|
|
|
2021-09-03 19:20:55 -07:00
|
|
|
// Colored shape testing
|
|
|
|
|
var camConfShape =
|
2022-01-10 16:51:06 -08:00
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("Shape");
|
|
|
|
|
|
|
|
|
|
// If we haven't saved shape settings, create a new one
|
|
|
|
|
if (camConfShape == null) {
|
|
|
|
|
camConfShape =
|
|
|
|
|
new CameraConfiguration(
|
|
|
|
|
"Shape",
|
|
|
|
|
TestUtils.getPowercellImagePath(TestUtils.PowercellTestImages.kPowercell_test_1, true)
|
|
|
|
|
.toString());
|
|
|
|
|
var settings = new ColoredShapePipelineSettings();
|
|
|
|
|
settings.hsvHue = new IntegerCouple(0, 35);
|
|
|
|
|
settings.hsvSaturation = new IntegerCouple(82, 255);
|
|
|
|
|
settings.hsvValue = new IntegerCouple(62, 255);
|
|
|
|
|
settings.contourShape = ContourShape.Triangle;
|
|
|
|
|
settings.outputShowMultipleTargets = true;
|
|
|
|
|
settings.circleAccuracy = 15;
|
|
|
|
|
settings.inputShouldShow = true;
|
|
|
|
|
camConfShape.addPipelineSetting(settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var collectedSources = new ArrayList<VisionSource>();
|
|
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
var fvsApril = new FileVisionSource(camConfApril);
|
2021-09-03 19:20:55 -07:00
|
|
|
var fvsShape = new FileVisionSource(camConfShape);
|
2022-01-10 16:51:06 -08:00
|
|
|
var fvs2019 = new FileVisionSource(camConf2019);
|
|
|
|
|
var fvs2020 = new FileVisionSource(camConf2020);
|
|
|
|
|
var fvs2022 = new FileVisionSource(camConf2022);
|
|
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
collectedSources.add(fvsApril);
|
2022-01-10 16:51:06 -08:00
|
|
|
collectedSources.add(fvs2022);
|
2021-09-03 19:20:55 -07:00
|
|
|
collectedSources.add(fvsShape);
|
2022-01-10 16:51:06 -08:00
|
|
|
collectedSources.add(fvs2020);
|
|
|
|
|
collectedSources.add(fvs2019);
|
2021-09-03 19:20:55 -07:00
|
|
|
|
2022-03-16 21:33:20 -07:00
|
|
|
ConfigManager.getInstance().unloadCameraConfigs();
|
2020-08-29 16:30:33 -07:00
|
|
|
VisionModuleManager.getInstance().addSources(collectedSources).forEach(VisionModule::start);
|
|
|
|
|
ConfigManager.getInstance().addCameraConfigurations(collectedSources);
|
2020-08-06 01:42:53 -04:00
|
|
|
}
|
|
|
|
|
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
public static void main(String[] args) {
|
2022-09-28 18:21:41 -07:00
|
|
|
try {
|
2022-12-16 17:05:23 -08:00
|
|
|
TestUtils.loadLibraries();
|
2022-09-28 18:21:41 -07:00
|
|
|
logger.info("Native libraries loaded.");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Failed to load native libraries!", e);
|
|
|
|
|
}
|
2022-12-16 17:05:23 -08:00
|
|
|
|
2022-12-28 11:21:41 -08:00
|
|
|
try {
|
|
|
|
|
LibCameraJNI.forceLoad();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
logger.error("Failed to load native libraries!", e);
|
|
|
|
|
}
|
2022-09-28 18:21:41 -07:00
|
|
|
|
2020-08-06 01:42:53 -04:00
|
|
|
try {
|
2022-03-16 21:33:20 -07:00
|
|
|
if (!handleArgs(args)) {
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
2020-08-06 01:42:53 -04:00
|
|
|
} catch (ParseException e) {
|
|
|
|
|
logger.error("Failed to parse command-line options!", e);
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-09 16:35:42 -08:00
|
|
|
CVMat.enablePrint(false);
|
2020-12-20 20:09:39 -06:00
|
|
|
PipelineProfiler.enablePrint(false);
|
|
|
|
|
|
|
|
|
|
var logLevel = printDebugLogs ? LogLevel.TRACE : LogLevel.DEBUG;
|
2020-07-24 12:06:54 -04:00
|
|
|
Logger.setLevel(LogGroup.Camera, logLevel);
|
|
|
|
|
Logger.setLevel(LogGroup.WebServer, logLevel);
|
|
|
|
|
Logger.setLevel(LogGroup.VisionModule, logLevel);
|
|
|
|
|
Logger.setLevel(LogGroup.Data, logLevel);
|
|
|
|
|
Logger.setLevel(LogGroup.General, logLevel);
|
2020-09-15 11:19:36 -07:00
|
|
|
logger.info("Logging initialized in debug mode.");
|
2020-07-11 22:43:19 -04:00
|
|
|
|
|
|
|
|
logger.info(
|
|
|
|
|
"Starting PhotonVision version "
|
2020-07-19 10:41:41 -07:00
|
|
|
+ PhotonVersion.versionString
|
2020-07-11 22:43:19 -04:00
|
|
|
+ " on "
|
2022-12-26 21:51:34 -06:00
|
|
|
+ Platform.getPlatformName()
|
|
|
|
|
+ (Platform.isRaspberryPi() ? (" (Pi " + PiVersion.getPiVersion() + ")") : ""));
|
2020-08-06 01:42:53 -04:00
|
|
|
|
2020-08-26 10:03:56 -07:00
|
|
|
ConfigManager.getInstance().load(); // init config manager
|
2020-08-29 16:30:33 -07:00
|
|
|
ConfigManager.getInstance().requestSave();
|
|
|
|
|
|
2020-09-15 11:19:36 -07:00
|
|
|
// Force load the hardware manager
|
|
|
|
|
HardwareManager.getInstance();
|
|
|
|
|
|
2020-09-15 11:34:27 -07:00
|
|
|
NetworkManager.getInstance().reinitialize();
|
2020-08-19 17:08:24 -07:00
|
|
|
|
|
|
|
|
NetworkTablesManager.getInstance()
|
|
|
|
|
.setConfig(ConfigManager.getInstance().getConfig().getNetworkConfig());
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
|
2020-08-29 16:30:33 -07:00
|
|
|
if (!isTestMode) {
|
|
|
|
|
VisionSourceManager.getInstance()
|
|
|
|
|
.registerLoadedConfigs(
|
|
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().values());
|
2022-03-16 21:33:20 -07:00
|
|
|
|
2020-08-29 16:30:33 -07:00
|
|
|
VisionSourceManager.getInstance().registerTimedTask();
|
|
|
|
|
} else {
|
2022-03-16 21:33:20 -07:00
|
|
|
if (testModeFolder == null) {
|
|
|
|
|
addTestModeSources();
|
|
|
|
|
} else {
|
|
|
|
|
addTestModeFromFolder();
|
|
|
|
|
}
|
2020-08-29 16:30:33 -07:00
|
|
|
}
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
|
|
|
|
|
Server.main(DEFAULT_WEBPORT);
|
|
|
|
|
}
|
|
|
|
|
}
|