Since the 2020-2021 season is looking to be completely online, with no access to our buildspace, 1076 has decided to experiment this year with sending every member of the team a cheap, Raspberry Pi robot kit to use for training and development. This is the kit we are using: https://www.amazon.com/Freenove-Raspberry-Tracking-Avoidance-Ultrasonic/dp/B07YD2LT9D/. The built in library is in python, but it is written really badly and is fairly unwieldy. Therefore we have started development on a robotpy wpilib-equivalent library for this robot, such that any robot.py files can be used with trivial modifications with either the FRC robot or these robot kits. Currently we have driving fully working with our own barebones driver station program.
Our approach in the development of this wpilib-equivalent library has been to reuse as much robotpy code as possible, then writing a thin API to communicate with the different hardware of this robot, so we can keep as much of the structure of robotpy as possible. We did not want to have to reverse-engineer the driver station protocol, so instead we are using NetworkTables to publish the controller state.
Because we were evaluating whether or not this platform would be suitable, we concentrated on getting something working quickly. This need for haste has driven our efforts so far.
The main elements of our system are 1. Driverstation.py, which interfaces with the joystick on the controller host and sends the controller state to the robot host through networktables. 2. run.py is the robot runner. It takes care of calling the typical robot entry points, handles motor safety and robot enable/disable. 3. Robot.py, which should look familiar to those who has programmed their bot in python. 4. pikitlib - this is our clone of wpilib (just the parts we have needed so far to get things working)
We wanted to put this out there because we think this could be an option for other teams facing the contactless season. At about $130 for the entire setup, it could be a good investment in developing your team’s skills.
We also wanted to inquire with the robotpy experts about just how much of the wpilib pyfrc infrastructure we could pull in and use (things like SendableBase don’t require anything special, so we could make sure to incorporate that into any things that we’d like to display on the dashboard?) But it isn’t completely clear to us how we could make the break in the code so that end up with pure python operating environment (field-runtime, driverstation, robot.py) without having to fully implement HAL, having to replicate driverstation protocol, and all of the other things we don’t know about.
The robot kit itself is about 70$, (you can probably get a discount for your school if you contact the seller), then you will also need a Pi+sd card (we are using the 3B+). Unfortunately these robots need some non household batteries, but they aren’t too expensive. You can get the chargers for them fairly cheap on ebay or amazon. You do have to be more careful with these batteries than your standard double a.
Link to where we got the batteries: Samsung 25R 18650 2500mAh 20A Battery INR18650-25R - 18650 Battery Store
Here’s our code so far: GitHub - FRC1076/RobotKitLib