Switch from RST to MyST Markdown (#1395)

This commit is contained in:
Mohammad Durrani
2024-08-18 14:05:23 -04:00
committed by GitHub
parent 0493ef9133
commit 4643f86438
124 changed files with 2821 additions and 2757 deletions

View File

@@ -0,0 +1,39 @@
# Hardware In The Loop Simulation
Hardware in the loop simulation is using a physical device, such as a supported co-processor running PhotonVision, to enhance simulation capabilities. This is useful for developing and validating code before the camera is attached to a robot, as well as reducing the work required to use WPILib simulation with PhotonVision.
Before continuing, ensure PhotonVision is installed on your target device. Instructions can be found {ref}`here <docs/installation/index:Installation & Setup>` for all devices.
Your coprocessor and computer running simulation will have to be connected to the same network, like a home router. Connecting the coprocessor directly to the computer will not work.
To simulate with hardware in the loop, a one-line change is required. From the PhotonVision UI, go to the sidebar and select the Settings option. Within the Networking settings, find "Team Number/NetworkTables Server Address".
During normal robot operation, a team's number would be entered into this field so that the PhotonVision coprocessor connects to the roboRIO as a NT client. Instead, enter the IP address of your computer running the simulation here.
:::{note}
To find the IP address of your Windows computer, open command prompt and run `ipconfig`.
```console
C:/Users/you>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : home
Link-local IPv6 Address . . . . . : fe80::b41d:e861:ef01:9dba%10
IPv4 Address. . . . . . . . . . . : 192.168.254.13
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.254.254
```
:::
```{image} images/coproc-client-to-desktop-sim.png
```
No code changes are required, PhotonLib should function similarly to normal operation.
Now launch simulation, and you should be able to see the PhotonVision table on your simulation's NetworkTables dashboard.
```{image} images/hardware-in-the-loop-sim.png
```