You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: source/docs/contributing/photonvision/build-instructions.rst
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,3 +137,59 @@ After adding the generated vendordep to your project, add the following to your
137
137
repositories {
138
138
mavenLocal()
139
139
}
140
+
141
+
142
+
Debugging a local PhotonVision build
143
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144
+
145
+
One way is by running the program using gradle with the :code:`--debug-jvm` flag. Run the program with :code:`./gradlew run --debug-jvm`, and attach to it with VSCode by adding the following to launch.json. Note args can be passed with :code:`--args="foobar"`.
146
+
147
+
.. code-block::
148
+
149
+
{
150
+
// Use IntelliSense to learn about possible attributes.
151
+
// Hover to view descriptions of existing attributes.
152
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
153
+
"version": "0.2.0",
154
+
"configurations": [
155
+
{
156
+
"type": "java",
157
+
"name": "Attach to Remote Program",
158
+
"request": "attach",
159
+
"hostName": "localhost",
160
+
"port": "5005",
161
+
"projectName": "photon-core",
162
+
}
163
+
]
164
+
}
165
+
166
+
PhotonVision can also be run using the gradle tasks plugin with :code:`"args": "--debug-jvm"` added to launch.json.
167
+
168
+
Running examples
169
+
~~~~~~~~~~~~~~~~
170
+
171
+
You can run one of the many built in examples straight from the command line, too! They contain a fully featured robot project, and some include simulation support. The projects can be found inside the photonlib-java-examples and photonlib-cpp-examples subdirectories, respectively. The projects currently available include:
172
+
173
+
- photonlib-java-examples:
174
+
- aimandrange:simulateJava
175
+
- aimattarget:simulateJava
176
+
- getinrange:simulateJava
177
+
- simaimandrange:simulateJava
178
+
- simposeest:simulateJava
179
+
- photonlib-cpp-examples:
180
+
- aimandrange:simulateNative
181
+
- getinrange:simulateNative
182
+
183
+
To run them, use the commands listed below. Photonlib must first be published to your local maven repository, then the copyPhotonlib task will copy the generated vendordep json file into each example. After that, the simulateJava/simulateNative task can be used like a normal robot project. Robot simulation with attached debugger is technically possible by using simulateExternalJava and modifying the launch script it exports, though unsupported.
0 commit comments