Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 85729b9

Browse files
authored
Add build instructions for deploy (#298)
* Add build instructions for deploy Because I always forget the command * typeos and adding clean commands * comment and scope creep
1 parent bea749d commit 85729b9

File tree

1 file changed

+62
-3
lines changed

1 file changed

+62
-3
lines changed

source/docs/contributing/photonvision/build-instructions.rst

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,32 @@ Running the following command under the root directory will build the jar under
9393

9494
``gradlew shadowJar``
9595

96+
Build and Run the Source on a Raspberry Pi Coprocessor
97+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98+
99+
As a convinenece, the build has built in `deploy` command which builds, deploys, and starts the current source code on a coprocessor.
100+
101+
An architecture override is required to specify the deploy target's architecture.
102+
103+
.. tab-set::
104+
105+
.. tab-item:: Linux
106+
107+
``./gradlew clean``
108+
``./gradlew deploy -PArchOverride=linuxarm64``
109+
110+
.. tab-item:: macOS
111+
112+
``./gradlew clean``
113+
``./gradlew deploy -PArchOverride=linuxarm64``
114+
115+
.. tab-item:: Windows (cmd)
116+
117+
``gradlew clean``
118+
``gradlew deploy -PArchOverride=linuxarm64``
119+
120+
The ``deploy`` command is tested against Raspberry Pi coprocessors. Other similar coprocessors may work too.
121+
96122
Using PhotonLib Builds
97123
~~~~~~~~~~~~~~~~~~~~~~
98124

@@ -139,10 +165,10 @@ After adding the generated vendordep to your project, add the following to your
139165
}
140166
141167
142-
Debugging a local PhotonVision build
143-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168+
Debugging PhotonVision Running Locally
169+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144170

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"`.
171+
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 :code:`launch.json`. Note args can be passed with :code:`--args="foobar"`.
146172

147173
.. code-block::
148174
@@ -165,6 +191,39 @@ One way is by running the program using gradle with the :code:`--debug-jvm` flag
165191
166192
PhotonVision can also be run using the gradle tasks plugin with :code:`"args": "--debug-jvm"` added to launch.json.
167193

194+
195+
Debugging PhotonVision Running on a CoProcessor
196+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
197+
198+
Set up a VSCode configuration in :code:`launch.json`
199+
200+
.. code-block::
201+
202+
{
203+
// Use IntelliSense to learn about possible attributes.
204+
// Hover to view descriptions of existing attributes.
205+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
206+
"version": "0.2.0",
207+
"configurations": [
208+
{
209+
"type": "java",
210+
"name": "Attach to CoProcessor",
211+
"request": "attach",
212+
"hostName": "photonvision.local",
213+
"port": "5801",
214+
"projectName": "photon-core"
215+
},
216+
]
217+
}
218+
219+
Stop any existing instance of PhotonVision.
220+
221+
Launch the program with the following additional argument to the JVM: :code:`java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=photonvision.local:5801`
222+
223+
Once the program says it is listening on port 5801, launch the debug configuration in VSCode.
224+
225+
The program will wait for the VSCode debugger to attach before proceeding.
226+
168227
Running examples
169228
~~~~~~~~~~~~~~~~
170229

0 commit comments

Comments
 (0)