We’re working with a limelight 2+ and have developed a few different pipelines. I’m wondering if anyone has found a way to upload one or more pipeline files to the limelight during robot operation.
We use revision control with our Robot code to ensure that the tested code is what we’re running. I’d like to be certain that the pipelines we’ve tested are the pipelines uploaded without requiring a human to click through the limelight UI.
I’d like to check in the pipeline files that we’re using and upload them to the limelight in Robot initialization. That would even allow us to test a branch with pipeline changes and then when we switched to another branch, the new branch would use the expected pipeline files.
I’ve not seen any way to do this in the Limelight API or documentation, but its definitely possible that I’ve missed it. It feels like it is probably just a matter of doing the proper HTTP request , the same one that the Javascript code in the UI does.
Are you using the photonvision software or the normal limelight software?
You can download the pipelines and upload them to the camera, but I don’t believe that there is a limelight/photonvision supported way to upload pipelines. However, you can duplicate your pipeline into another slot, test in that pipeline number, and then still have the original pipeline being used in the earlier.
I’m not saying it’s definitely not possible, but I know the limelight and photonvision aren’t designed with a built-in way to do this. Maybe someone with more experience with raspberry pi’s can figure this out?
One thing to note: you can connect to the limelight over ssh, but it requires a password that is not set by the team.
Overall, the complexity probably isn’t worth it. You should probably just download/upload the pipelines in the UI. At best you are going to save yourself a couple of minutes every time you use substantially different pipelines; but doing this is going to take hours. It won’t save you any time.
There isn’t an example, but they do mention getting values from other robot sensors for fusion on the limelight in custom scripts here, which would also mean you could pass configuration values for the pipeline.
I am currently using limelight 2022.2.2, but I had already been considering looking at photonvision.
You’re right in that having software do something that you can manually do often doesn’t pay off immediately. But, If someone forgets to mention that they were tinkering with a pipeline and someone else forgets to manually upload the right one, you can easily lose a lot of time debugging. It only takes one evening wasted down a rat-hole to make up a couple of hours and save a lot of stress.
I’d really like for there to be a limelight supported way to not rely on this state saved on the limelight.
That said, I poked around with the limelight image a bit. It seems likely that we could enable ssh access and accomplish it. The image has /home/pi/visionserver directory populated with ‘0.vpr’, ‘1.vpr’ …
The python scripts are just another thing that ultimately gets saved on the limelight, and would have to be managed. Its not clear to me that it would allow you to programmatically change state.
Is there a way to generally access the network tables from a limelight python script?
Compared to the generic wpilibpi example, Basic Vision Example — FIRST Robotics Competition documentation, a from networktables import NetworkTables gives me a “no such package” type error.
The limelight python example, Using Python to create Custom OpenCV Vision Pipelines — Limelight 1.0 documentation, only mentions that an llrobot array can be passed into my code and I’m to return an llpython array, which both show up in the network table, but it would be nice to have general network table access.