Limelight on a Romi

Thanks Peter, that would be a huge help to our programming efforts. Forgive my lack of knowledge but is it difficult/time consuming to add that feature? Thanks for all you do.

3 Likes

Though i will add that we have found it useful to be able to tether the Romoi+Pi to the development computer using an ethernet cable (makes it possible to screen share in a zoom session without losing internet) so I hope the two use cases would be compatible.

3 Likes

Does that mean a Limelight could work tethered?

Given that the Raspberry Pi image used for Romi is the WPI Vision image, you can drop a Raspberry Pi camera & LED ring onto the Romi and use the WPI_Pi vision tools. The physics & hardware is very similar - yes, the UI isn’t quite as polished/easy-mode.

From the fact that tethering works… Peter, do you think they could put an unmanaged switch on the Romi and talk to both the limelight & PC?

This is the smallest gigabit switch we’ve found, and has survived FRC competitions for us. It’s still going to look huge on the Romi, and I don’t remember if it takes 12v or 5v… https://smile.amazon.com/gp/product/B008PC1FYK/

1 Like

I find having a usb wifi adapter on the dev computer so you can have the robot and internet both connected helpful.

2 Likes

It occurs to me that it’s also possible to just connect the computer’s ethernet to the network/internet and use wifi for connecting to the robot, if a network drop is convenient.

2 Likes

It’s a 5V product.
(I just bought the “Amazon Warehouse” version and didn’t get a power supply in this box, kinda annoyed and can’t tell yall what current it’s rated to draw yet)

Hi Peter! We just recently got our ROMI driving around and it has been awesome for the new team members. I came across this thread when we looked at adding a Limelight or GlowWorm to the ROMI. Do you know if there are any plans to incorporate similar platforms or what our best course of action should be to get one operational with the ROMI platform?

Hi! I’m not Peter but I do work with the PhotonVision team from time to time. If you already have a Gloworm running PhotonVision, we have documentation for installing it on a Romi: Installing PhotonVision on a Romi - PhotonVision Docs

If you already have a LimeLight (Gloworms are not for sale at the moment but should be back at a later date), you can follow this documentation to install PhotonVision on a Limelight Installing PhotonVision on a Limelight - PhotonVision Docs and then work from there. To my knowlege, Limelight has no docs on using it with Romi but I am sure it is possible if you don’t want to install PhotonVision on it.

If you have any other questions about PhotonVision or need help with using it, do not hesitate to reach out.

4 Likes

We have not used it with the team yet, but I have been using Photon with the Romi. It is really easy. The only caveate is that you need the pi to be writeable.

I built upon what others have done, but all I did was put the .jar in userspace then wrote a Python file that starts photon. I uploaded that as the python program, and it runs automatically. Even the pi camera (if you are careful with the cable) works sufficiently.

From there, programming photon is really similar to the limelight.

2 Likes

Awesome! Thanks for the info. We will give it a try.

3 Likes

@Mr.R_2 or @mdurrani834, I’ve been trying to the PhotonVision working on my Romi and the one thing I can’t seem to do is get Photonvision to be available on Network Tables, so I can process targets. I was wondering if you could show me what network settings or code you are using to make it work.

I followed the suggestions I’ve read of making the Romi /etc/fstab writable, changed the /home/pi/runCamera program to run the PV jar. Shuffleboard is connected to localhost and I get info from the Romi. Edit - the camera I’m using is a MS Lifecam plugged into a USB port on a PI 4.

I have successfully been able to connect to 10.0.0.2:5800 and play around with PV settings and the Romi settings and have tried just about every setting combo I can think to try that might help. Restarted PV, Romi PI, Romi code after making changes, etc… The usual things.

I can get the Romi code to connect to CameraServer and display my laptop camera. I am running the basic RomiReference code from WPILib with just a little PV code to start an instance and try to output the Yaw of a target, if one is present, which runs in the periodic function of my Drivetrain subsystem.

So, it seems that I’m just missing some key piece of the puzzle to connect the PV with the NetworkTable on the Romi. Are you running the NT server/client on the PV/Romi? What IP are you using?

Thanks for your input!

I vaguely remember having to point Photonvision as a client toward the desktop IP, not the Romi IP. Remember, the Romi code is running on your PC, not the Pi.

Right, that’s where I’m just not sure what the settings I’m changing are actually affecting. You say point PV as a client to the desktop IP… OK an ipconfig on Windows gives me 10.0.0.116. Should I add that to PV’s Networking tab as a static IP? I have tried that. I have the team number as 0 and hostname is still photonvision. Not running Network Tables server.
Thanks, if there’s anything else you can suggest, I’m all ears!

I do not have access to a Romi right now, but will in a couple of days.

If I understand correctly, Photon is running on the Romi (the Raspberry Pi) not the host computer. There is some magic that happens where the Romi tells the simulator what the websocket is, and then sets up the websocket as a network tables instance. There is a lot that can go wrong in that connection (but I thought most of it got sorted out in the first few updates of the firmware).

What version of WPILibPi and Romi service are you running? If it is too old, the Network Tables piece may still be broken. You can see the thread about it here.

Are you able to see the Romi table in the simulator (or in the Dashboard of your choosing)? If so, the websocket-> network tables should be working.

The one piece that will not probably be sorted out, is that some firewalls (or perhaps antivirus) block that connection. On my work computer, I can run the Romi software fine, but anything requiring the Romi Network Table Data Fails (including Vision). On all our other machines, all our other machines, everything works fine.

Are you able to see PhotonVision at wpilibpi.local:5800? If not, Photon may not be running. Before running the Python scripts, I remoted into the pi and ran Photon manually. Then, I could find it at wpilibpi.local:5800. If you launch it through the WPILib interface, you get logging in the WPILibPi window, which is helpful.

If that is not working, the Network Tables piece will not either.

If you are, and it is just Photon, Here is a link to a repo we have with a Python file that worked for us. I do not have access to a Romi right now to help you troubleshoot, but I could try.

If I remember correctly, there was also a bug where some of the newer features of the Romi Network Table interfered with vision, but I may be mis-remembering.

Eidt: We did not change any client/host settings in PV. We tried that first, but realized it was a firewall issue. So, accepting the defaults for that just worked.

1 Like

Thanks, I’ll give disabling firewalls a shot. That does seem to make sense since the more I think about it, everything that involves the computer talking to the ROMI works, but not the other way around.

1 Like

That was it! And once I figured out that I had to use the actual camera name, not just photonvision, in the config I was able to get target data, whoo-hoo!

3 Likes

Excellent. Yes. The Firewall is messy. It is a bit worse with the Romi than the full-sized bot because the full-size would typically either work or not. The Firewall probably blocks all communication. But since the Romi WebSockets work out of the box, there is a bit more room for it to work until you need Romi-generated network tables.

3 Likes

I’m seriously thinking about contributing to the PhotonVision docs on Romi installation to add the info I’ve gleaned from CD to make this work. The last few steps regarding making the filesystems writable and doing a more thorough modification to the start scripts to get the software running are missing. Also, just a line about the firewall being an issue. Maybe the bit about setting Shuffleboard to localhost, but that might belong on WPILib docs. Unless someone else beats me to it, or maybe there’s already updates that haven’t made it to the latest release?

If anyone on the WPILibPi & Romi projects read this, I wonder if it would be possible to install PhotonVision without needing to make the boot and root filesystems writable? Perhaps by allowing a separate partition for applications under /opt? Currently, the WPILibPi partitions the whole card on boot. The main benefit is that it might not be necessary to shutdown the PI manually, though there is value in teaching kids a bit of Linux as well :wink: It may just be the cost of doing something more advanced with the Romi.

1 Like

HI! I usually manage PhotonVision docs related stuff. If you would be willing to contribute that information, we would really appreciate it. You can find our repo here: GitHub - PhotonVision/photonvision-docs: Docs for PhotonVision, a free open-source vision processing software for FRC teams. and contributing instructions here: Contributing to PhotonVision Documentation - PhotonVision Docs. Otherwise, I’ll get around to it soon (may take a while because my Romi is at the team workspace atm) and will let you know once it is live.

Thanks for letting us know!

3 Likes