This question seems to be asked occasionally, but nothing has worked for us. We are running the versionb 2023.4.2 on a raspberryPi 3b. We have used photonVision in past seasons to target balls.
We set up the web interface to target yellow cones. Our java program connects to the camera and is able to use the data to target a cone. We added a second pipeline for a blue cube. If we select the cube in the web interface, the program will successfully target the cube.
We then added pipeline selections to our code. One command selects 0 the other selects 1 as shown here.
camera.setPipelineIndex(1); // select cube targeting
It has no effect, The target data for the pipeline selected in the web interface is always returned.