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;
|
|
|
|
|
|
2024-10-31 08:27:19 -07:00
|
|
|
import edu.wpi.first.hal.HAL;
|
2022-03-16 21:33:20 -07:00
|
|
|
import java.io.IOException;
|
|
|
|
|
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;
|
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;
|
2024-01-15 22:28:34 -05:00
|
|
|
import org.photonvision.common.configuration.NeuralNetworkModelManager;
|
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;
|
2024-12-04 18:01:48 -08:00
|
|
|
import org.photonvision.common.hardware.OsImageVersion;
|
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;
|
2024-11-06 20:16:36 -05:00
|
|
|
import org.photonvision.common.logging.KernelLogLogger;
|
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;
|
2024-03-04 23:27:39 -05:00
|
|
|
import org.photonvision.common.logging.PvCSCoreLogger;
|
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.networking.NetworkManager;
|
2020-08-08 14:21:38 -04:00
|
|
|
import org.photonvision.common.util.TestUtils;
|
2024-10-31 08:27:19 -07:00
|
|
|
import org.photonvision.jni.PhotonTargetingJniLoader;
|
2024-01-15 22:28:34 -05:00
|
|
|
import org.photonvision.jni.RknnDetectorJNI;
|
2024-01-05 12:26:17 -07:00
|
|
|
import org.photonvision.mrcal.MrCalJNILoader;
|
2024-01-02 10:04:58 -08:00
|
|
|
import org.photonvision.raspi.LibCameraJNILoader;
|
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;
|
2024-01-08 14:09:15 -05:00
|
|
|
import org.photonvision.vision.apriltag.AprilTagFamily;
|
2025-01-01 03:04:20 -05:00
|
|
|
import org.photonvision.vision.camera.PVCameraInfo;
|
2020-12-20 20:09:39 -06:00
|
|
|
import org.photonvision.vision.opencv.CVMat;
|
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;
|
2020-12-20 20:09:39 -06:00
|
|
|
import org.photonvision.vision.pipeline.PipelineProfiler;
|
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.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;
|
2024-03-04 23:24:23 -05:00
|
|
|
private static boolean isSmoketest = 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");
|
2023-06-03 21:04:04 -04:00
|
|
|
options.addOption(
|
|
|
|
|
"i",
|
|
|
|
|
"ignore-cameras",
|
|
|
|
|
true,
|
|
|
|
|
"Ignore cameras that match a regex. Uses camera name as provided by cscore.");
|
2023-09-01 12:58:35 -07:00
|
|
|
options.addOption("n", "disable-networking", false, "Disables control device network settings");
|
|
|
|
|
options.addOption(
|
|
|
|
|
"c",
|
|
|
|
|
"clear-config",
|
|
|
|
|
false,
|
|
|
|
|
"Clears PhotonVision pipeline and networking settings. Preserves log files");
|
2024-03-04 23:24:23 -05:00
|
|
|
options.addOption(
|
|
|
|
|
"s",
|
|
|
|
|
"smoketest",
|
|
|
|
|
false,
|
|
|
|
|
"Exit Photon after loading native libraries and camera configs, but before starting up camera runners");
|
2022-03-16 21:33:20 -07:00
|
|
|
|
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
|
|
|
}
|
2023-06-03 21:04:04 -04:00
|
|
|
|
2023-09-01 12:58:35 -07:00
|
|
|
if (cmd.hasOption("disable-networking")) {
|
|
|
|
|
NetworkManager.getInstance().networkingIsDisabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cmd.hasOption("clear-config")) {
|
|
|
|
|
ConfigManager.getInstance().clearConfig();
|
|
|
|
|
}
|
2024-03-04 23:24:23 -05:00
|
|
|
|
|
|
|
|
if (cmd.hasOption("smoketest")) {
|
|
|
|
|
isSmoketest = true;
|
|
|
|
|
}
|
2020-08-06 01:42:53 -04:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
2024-01-08 14:09:15 -05:00
|
|
|
CameraConfiguration camConf2024 =
|
|
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("WPI2024");
|
2025-01-01 03:04:20 -05:00
|
|
|
if (camConf2024 == null || true) {
|
2024-01-08 14:09:15 -05:00
|
|
|
camConf2024 =
|
|
|
|
|
new CameraConfiguration(
|
2025-01-01 03:04:20 -05:00
|
|
|
PVCameraInfo.fromFileInfo(
|
|
|
|
|
TestUtils.getResourcesFolderPath(true)
|
|
|
|
|
.resolve("testimages")
|
|
|
|
|
.resolve(TestUtils.WPI2024Images.kSpeakerCenter_143in.path)
|
|
|
|
|
.toString(),
|
|
|
|
|
"WPI2024"));
|
2024-01-08 14:09:15 -05:00
|
|
|
|
|
|
|
|
camConf2024.FOV = TestUtils.WPI2024Images.FOV;
|
|
|
|
|
// same camera as 2023
|
|
|
|
|
camConf2024.calibrations.add(TestUtils.get2023LifeCamCoeffs(true));
|
|
|
|
|
|
|
|
|
|
var pipeline2024 = new AprilTagPipelineSettings();
|
2025-01-01 03:04:20 -05:00
|
|
|
var path_split = Path.of(camConf2024.matchedCameraInfo.path()).getFileName().toString();
|
2024-01-08 14:09:15 -05:00
|
|
|
pipeline2024.pipelineNickname = path_split.replace(".jpg", "");
|
|
|
|
|
pipeline2024.targetModel = TargetModel.kAprilTag6p5in_36h11;
|
|
|
|
|
pipeline2024.tagFamily = AprilTagFamily.kTag36h11;
|
|
|
|
|
pipeline2024.inputShouldShow = true;
|
|
|
|
|
pipeline2024.solvePNPEnabled = true;
|
|
|
|
|
|
|
|
|
|
var psList2024 = new ArrayList<CVPipelineSettings>();
|
|
|
|
|
psList2024.add(pipeline2024);
|
|
|
|
|
camConf2024.pipelineSettings = psList2024;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-01 03:04:20 -05:00
|
|
|
var cameraConfigs = List.of(camConf2024);
|
2021-09-03 19:20:55 -07:00
|
|
|
|
2022-03-16 21:33:20 -07:00
|
|
|
ConfigManager.getInstance().unloadCameraConfigs();
|
2025-01-01 03:04:20 -05:00
|
|
|
cameraConfigs.stream().forEach(ConfigManager.getInstance()::addCameraConfiguration);
|
|
|
|
|
VisionSourceManager.getInstance().registerLoadedConfigs(cameraConfigs);
|
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) {
|
2024-05-19 17:35:40 -07:00
|
|
|
logger.info(
|
|
|
|
|
"Starting PhotonVision version "
|
|
|
|
|
+ PhotonVersion.versionString
|
2024-12-04 18:01:48 -08:00
|
|
|
+ " on platform "
|
2024-05-19 17:35:40 -07:00
|
|
|
+ Platform.getPlatformName()
|
|
|
|
|
+ (Platform.isRaspberryPi() ? (" (Pi " + PiVersion.getPiVersion() + ")") : ""));
|
|
|
|
|
|
2024-12-04 18:01:48 -08:00
|
|
|
if (OsImageVersion.IMAGE_VERSION.isPresent()) {
|
|
|
|
|
logger.info("PhotonVision image version: " + OsImageVersion.IMAGE_VERSION.get());
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-19 17:35:40 -07:00
|
|
|
try {
|
|
|
|
|
if (!handleArgs(args)) {
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
logger.error("Failed to parse command-line options!", e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We don't want to trigger an exit in test mode or smoke test. This is specifically for MacOS.
|
|
|
|
|
if (!(Platform.isSupported() || isSmoketest || isTestMode)) {
|
|
|
|
|
logger.error("This platform is unsupported!");
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
try {
|
2024-03-04 23:24:23 -05:00
|
|
|
boolean success = TestUtils.loadLibraries();
|
|
|
|
|
|
|
|
|
|
if (!success) {
|
|
|
|
|
logger.error("Failed to load native libraries! Giving up :(");
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
2022-09-28 18:21:41 -07:00
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Failed to load native libraries!", e);
|
2024-03-04 23:24:23 -05:00
|
|
|
System.exit(1);
|
2022-09-28 18:21:41 -07:00
|
|
|
}
|
2024-10-31 08:27:19 -07:00
|
|
|
logger.info("WPI JNI libraries loaded.");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
boolean success = PhotonTargetingJniLoader.load();
|
|
|
|
|
|
|
|
|
|
if (!success) {
|
|
|
|
|
logger.error("Failed to load native libraries! Giving up :(");
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Failed to load photon-targeting JNI!", e);
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
|
|
|
|
logger.info("photon-targeting JNI libraries loaded.");
|
|
|
|
|
|
|
|
|
|
if (!HAL.initialize(500, 0)) {
|
|
|
|
|
logger.error("Failed to initialize the HAL! Giving up :(");
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
2022-12-16 17:05:23 -08:00
|
|
|
|
2022-12-28 11:21:41 -08:00
|
|
|
try {
|
2023-09-01 12:58:35 -07:00
|
|
|
if (Platform.isRaspberryPi()) {
|
2024-01-02 10:04:58 -08:00
|
|
|
LibCameraJNILoader.forceLoad();
|
2023-09-01 12:58:35 -07:00
|
|
|
}
|
2022-12-28 11:21:41 -08:00
|
|
|
} catch (IOException e) {
|
2023-09-01 12:58:35 -07:00
|
|
|
logger.error("Failed to load libcamera-JNI!", e);
|
2022-12-28 11:21:41 -08:00
|
|
|
}
|
2024-01-15 22:28:34 -05:00
|
|
|
try {
|
|
|
|
|
if (Platform.isRK3588()) {
|
|
|
|
|
RknnDetectorJNI.forceLoad();
|
|
|
|
|
} else {
|
|
|
|
|
logger.error("Platform does not support RKNN based machine learning!");
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
logger.error("Failed to load rknn-JNI!", e);
|
|
|
|
|
}
|
2024-01-05 12:26:17 -07:00
|
|
|
try {
|
|
|
|
|
MrCalJNILoader.forceLoad();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
logger.warn(
|
|
|
|
|
"Failed to load mrcal-JNI! Camera calibration will fall back to opencv\n"
|
|
|
|
|
+ e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
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);
|
2023-06-17 21:47:18 -07:00
|
|
|
Logger.setLevel(LogGroup.Config, logLevel);
|
2020-07-24 12:06:54 -04:00
|
|
|
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
|
|
|
|
2024-11-06 20:16:36 -05:00
|
|
|
// Add Linux kernel log->Photon logger
|
|
|
|
|
KernelLogLogger.getInstance();
|
|
|
|
|
|
|
|
|
|
// Add CSCore->Photon logger
|
2024-03-04 23:27:39 -05:00
|
|
|
PvCSCoreLogger.getInstance();
|
|
|
|
|
|
2023-09-27 18:37:27 -07:00
|
|
|
logger.debug("Loading ConfigManager...");
|
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();
|
|
|
|
|
|
2024-09-21 16:08:00 -04:00
|
|
|
logger.info("Loading ML models...");
|
|
|
|
|
var modelManager = NeuralNetworkModelManager.getInstance();
|
|
|
|
|
modelManager.extractModels(ConfigManager.getInstance().getModelsDirectory());
|
|
|
|
|
modelManager.discoverModels(ConfigManager.getInstance().getModelsDirectory());
|
|
|
|
|
|
2023-09-27 18:37:27 -07:00
|
|
|
logger.debug("Loading HardwareManager...");
|
2020-09-15 11:19:36 -07:00
|
|
|
// Force load the hardware manager
|
|
|
|
|
HardwareManager.getInstance();
|
|
|
|
|
|
2023-09-27 18:37:27 -07:00
|
|
|
logger.debug("Loading NetworkManager...");
|
2020-09-15 11:34:27 -07:00
|
|
|
NetworkManager.getInstance().reinitialize();
|
2020-08-19 17:08:24 -07:00
|
|
|
|
2023-09-27 18:37:27 -07:00
|
|
|
logger.debug("Loading NetworkTablesManager...");
|
2020-08-19 17:08:24 -07:00
|
|
|
NetworkTablesManager.getInstance()
|
|
|
|
|
.setConfig(ConfigManager.getInstance().getConfig().getNetworkConfig());
|
2024-10-31 08:27:19 -07:00
|
|
|
NetworkTablesManager.getInstance().registerTimedTasks();
|
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
|
|
|
|
2024-03-04 23:24:23 -05:00
|
|
|
if (isSmoketest) {
|
|
|
|
|
logger.info("PhotonVision base functionality loaded -- smoketest complete");
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-01 03:04:20 -05:00
|
|
|
// todo - should test mode just add test mode sources, but still allow local usb cameras to be
|
|
|
|
|
// added?
|
2020-08-29 16:30:33 -07:00
|
|
|
if (!isTestMode) {
|
2023-09-27 18:37:27 -07:00
|
|
|
logger.debug("Loading VisionSourceManager...");
|
2020-08-29 16:30:33 -07:00
|
|
|
VisionSourceManager.getInstance()
|
|
|
|
|
.registerLoadedConfigs(
|
|
|
|
|
ConfigManager.getInstance().getConfig().getCameraConfigurations().values());
|
|
|
|
|
} else {
|
2022-03-16 21:33:20 -07:00
|
|
|
if (testModeFolder == null) {
|
|
|
|
|
addTestModeSources();
|
|
|
|
|
}
|
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
|
|
|
|
2025-01-01 03:04:20 -05:00
|
|
|
VisionSourceManager.getInstance().registerTimedTasks();
|
|
|
|
|
|
2023-09-27 18:37:27 -07:00
|
|
|
logger.info("Starting server...");
|
2023-12-28 13:24:28 -06:00
|
|
|
HardwareManager.getInstance().setRunning(true);
|
2024-01-08 13:02:31 -05:00
|
|
|
Server.initialize(DEFAULT_WEBPORT);
|
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
|
|
|
}
|
|
|
|
|
}
|