WPILib on a PI + Romi?

So my team is looking at doing some at-home remote programming lessons.

As we can’t get the full robot to everyone’s home, buying RoboRio’s for all the programmers is also out.

We were looking at this WPILib on a PI Project Releases · wpilibsuite/WPILibPi · GitHub

Does anyone have any experience with this?
Does it have to be a Romi 32U4 robot?

I would love some information on people’s experience with this.

2 Likes

It is brand new so you probably won’t find that many people that have it but I just got mine and enjoy it.

Currently the WPILibPi stuff only supports the Romi with the 32U4 but there is no technical reason it couldn’t be expanded it is just a matter of development time. Is there something wrong with the 32U4?

It does suck regular batteries dry pretty quickly so some good rechargeables are needed.

Let me know if you have other questions!

3 Likes

Have you see the preliminary documentation? Getting Started with Romi — FIRST Robotics Competition documentation

See also the first tv episode https://m.twitch.tv/videos/838364551

3 Likes

I just got a few Romi kits and have had very good experiences with them so far.

The kit itself is very high quality, and goes together easily with few tools needed. It is surprisingly robust, and the physical tolerances are excellent.

The electronics seem a bit pricey at first blush, but when you realize that the Romi controller has the motor drivers and an IMU onboard, it is actually a really good deal. The motor encoders and the IMU are what makes the Romi a candidate for running serious WPILib code.

What really makes the Romi shine is the well-engineered Pi-to-Arduino I2C bridge. You could finagle such a setup yourself, but not in such a compact, electrically robust package.

So, to answer your original question, you could put together a system using a Raspberry Pi, an Arduino, some voltage level shifters, and a few sensors and drivers, and I expect that there will someday (soon?) be other WPILib-compatible platforms, but you would end up spending more money in the long run.

The Romi is a much better robot than you might expect from looking at pictures online. and having the ability to write real robot code on a tiny, inexpensive robot platform is truly a Game Changer.

4 Likes

this is good to know.

I think this will work for our intentions this year.

1 Like

As an aside, we based early implementations of WPILib + Romi on another Pololu controller, the A-Star 32U4 Robot Controller (which uses the same microcontroller as the Romi, and has motor outputs, but lacked encoders).

Transitioning that to the Romi made a lot of sense since it came prepackaged with useful peripherals out of the box (and would be easier to troubleshoot across a large number of users since the hardware is standardized)

5 Likes

This looks really cool and could be a great learning tool. I’m planning to snag one, soon, for sure.

Can you run vision on this (like with an attached Pi camera or USB camera) or would it be better to get a second Pi to run the vision on?

Any docs describing attaching sensors coming soon? Or suggestions on which ones to start with (besides the encoders?)

2 Likes

The image is derived from FRCVision (now renamed to WPILibPi), so it still has all of the streaming features included. Unfortunately, due to the Pi mounting configuration on the Romi, there is insufficient clearance for the Pi Camera’s cable, but USB cameras do work.

4 Likes

I have a pi camera running on the Romi. It is tight, and definitely touching the control board, but it seems to be working just fine. I ran it for a couple hours yesterday with no issues. If you wanted added safety, you could probably use another header to add space.

Any docs describing attaching sensors coming soon? Or suggestions on which ones to start with (besides the encoders?)

The documentation is quite up to date. Here is the wpilib page, and here is the git page which has some other information. The Pololu pages are helpful too.

So far, these have been wonderful. We have gotten it running and used an external tt motor and external servos (I have to work on current control before using a bigger motor). We also have some basic vision running on it.

This is an incredible addition to our inventory and should help us train for years to come.

5 Likes

We’re working on some more docs for the Romi, so stay tuned!

The web UI lets you configure the 5 external IO pins (and also shows you which WPILib devices/channels they map to in code). An upcoming update will bring gyro and accelerometer support (as well as gyro calibration)

4 Likes

Thanks, all. I somehow missed the page with the GPIO pin mappings and web GUI page when I was looking before.

Does anyone have any specific favorite sensors you’ve been able to get to work well with it or that are worth playing with? Time-of-flight, ultrasonic, limit, etc? It looks like any analog sensor will work just fine. It’s good to hear that the gyro/accelerometer support will be available soon.

1 Like

I’ve had good results with the sharp IR distance sensors (the response curve isn’t linear , so refer to the data sheet for details). One of my test bots has a couple of limit switches attached to the front to act as bumpers, which has worked really well (at scaring my pets).

4 Likes

Thank you for this information.
We are having a bit of difficulty with two things (is there a place where we should look for or post bug reports for the wpilib implementation)?

We are having difficulty with DIO inputs. Even the built-in digital inputs do not seem to work most of the time (even with the example code). Does anyone have any working DIO code that we can try?

The other difficulty we are finding is that encoder. getRate() does not seem to return anything other than 0. I feel like this was an issue with the simulator before when we tried it last year, but I am not certain.

We do realize it is early, so if the answer is just hang tight, we can do so. :slight_smile:
Again, this project is incredibly helpful for us, and I hope it will help other teams as well.

2 Likes

The WPILib Romi repo is a good place to put Romi specific issues.

I have a bug fix for the DIO issue but it isn’t fully published yet. It should be available in the next build of the Pi image, and also upgradeable via the web UI.

I don’t think we implemented getRate but it’s something we can add

3 Likes

Thanks. I will add a feature request for getRate if that is not too heavy-handed. Ultimately, our goal is to practice learning how to work with trajectories. We are aware that is impossible without a gyro currently, but getRate will be helpful as well. We are aware of how early it is and how much incredible work has been done to make these robots possible.

2 Likes

The Romi has a gyro. I think trajectory support is on the wishlist. Last I heard there were concerns about update rate on the romi is that still a preventing issue or is it just a “small matter of programming”?

2 Likes

Thank you for this. I know the Romi has a gyro, but also know that it is not yet implemented. I realize trajectory support is a tall ask especially for a device so new in development.

1 Like

Once the relevant Romi encoder and gyroscope websocket messages are plumbed in, trajectory generation and tracking should just work. The raspberry pi and Romi just field HAL calls over websockets; everything else works normally from the robot code’s point of view (the robot code runs on the desktop computer).

5 Likes

so I got 2 units in yesterday ( waiting on the PIs).
I’m kinda impressed with it, a cool little FRC learning platform. (

3 Likes

That is incredible. Thanks. For trajectories, we also would need battery feedback and the characterization tool to work with it (or another way to calculate the feedforward gains) correct?