diff --git a/source/docs/simulation/AdvantageScope.rst b/source/docs/simulation/AdvantageScope.rst new file mode 100644 index 0000000..7e90b07 --- /dev/null +++ b/source/docs/simulation/AdvantageScope.rst @@ -0,0 +1,64 @@ +AvantageScope Simulation +======================== + +AvantageScope simulations allow the full simulation of a robot and all of its components on a virtual field. It can be further augmented with PhotonVIsion in order to simulate vision. + +Before continuing, ensure WindowsPhotonVision is installed on your target device. For this, the target device will be your host. Instructions can be found :ref:`here ` for all devices. + +Due to a lack of a physical robot, PhotonVision will be used to run the network tables instead of the roborio. Instructions can be found :ref:`here`. It is not required to change the Team Number/NetworkTables Server Address. + +In order to interface AScope with PhotonVision, some extra software needs to be downloaded + + - `link Java: ' + - `link AdvantageScope (now comes bundled with wpilib): ' + - `link NDI Core Suit: ' + - `link OBS: ' + - `link OBS-NDI Interfacer: ' + +AdvantageScope setup +==================== + +1. Open 3D Field +2. Setup a robot (Doesn’t matter if you use 2D or 3D pose, just make sure theres a camera) +3. Pop out the window (Button on the top right next to the eye) +.. image:: images/AdvantageScope.png + +OBS +=== + +1. Create a new window capture source +.. image:: images/OBSCreateNewSource.png +2. Select the popped out AScope window as the source window +.. image:: images/OBSLinkWindow.png +3. Under tools select NDI Output +.. image:: images/OBSLinkNDI.png +4. Check Main Output & Preview Output +.. image:: images/OBSLinkNDI-2.png + +NDI Tools +========= + +1. Select the webcam +.. image:: images/NDI.png +2. In the popup on the bottom right, select the gear, then your computer name, then OBS + +PhotonVision +============ +1. In the camera tab, select the NDI Webcam you used +.. image:: images/SetNDICam.png + +Code Setup +========== +1. Wherever your robot is first initialized (RobotContainer.java, Robot.java, main.java), set it to link to PhotonVision instead of the robot +.. code-block:: + public RobotContainer() { + if(Robot.isSimulation()) { + NetworkTableInstance inst = NetworkTableInstance.getDefault(); + inst.stopServer(); + // Change the IP address in the below function to the IP address you use to connect to the PhotonVision UI. + inst.setServer("127.0.0.1"); + inst.startClient4("Robot Simulation"); + } + } + + diff --git a/source/docs/simulation/images/AdvantageScope.png b/source/docs/simulation/images/AdvantageScope.png new file mode 100644 index 0000000..0c208d6 Binary files /dev/null and b/source/docs/simulation/images/AdvantageScope.png differ diff --git a/source/docs/simulation/images/NDI.png b/source/docs/simulation/images/NDI.png new file mode 100644 index 0000000..786ec8e Binary files /dev/null and b/source/docs/simulation/images/NDI.png differ diff --git a/source/docs/simulation/images/OBSCreateNewSource.png b/source/docs/simulation/images/OBSCreateNewSource.png new file mode 100644 index 0000000..f24bc45 Binary files /dev/null and b/source/docs/simulation/images/OBSCreateNewSource.png differ diff --git a/source/docs/simulation/images/OBSLinkNDI-2.png b/source/docs/simulation/images/OBSLinkNDI-2.png new file mode 100644 index 0000000..0f164f0 Binary files /dev/null and b/source/docs/simulation/images/OBSLinkNDI-2.png differ diff --git a/source/docs/simulation/images/OBSLinkNDI.png b/source/docs/simulation/images/OBSLinkNDI.png new file mode 100644 index 0000000..54383c6 Binary files /dev/null and b/source/docs/simulation/images/OBSLinkNDI.png differ diff --git a/source/docs/simulation/images/OBSLinkWindow.png b/source/docs/simulation/images/OBSLinkWindow.png new file mode 100644 index 0000000..c115612 Binary files /dev/null and b/source/docs/simulation/images/OBSLinkWindow.png differ diff --git a/source/docs/simulation/images/SetNDICam.png b/source/docs/simulation/images/SetNDICam.png new file mode 100644 index 0000000..4e613e6 Binary files /dev/null and b/source/docs/simulation/images/SetNDICam.png differ