Team 401: Copperhead Robotics Release Thread

Offseason Code Release

Team 401 is pleased to release our software written during the offseason. This past summer, we focused on improving our reusable codebase as well as improved vision processing. Below are some brief summaries of the different projects we worked on:

SnakeSkin
SnakeSkin was our primary focus over the offseason. SnakeSkin is a Kotlin framework that provides a DSL to organize robot subsystems and components. It consists of three modules (Core, FRC, and CTRE), allowing the user to pick only the components that they need. The Core module is platform independent and provides most of the base functionality, including a state machine based subsystem model (based on 254’s 2016 design), as well as many utility classes (such as a fully thread-safe PIDF controller, simple low pass filter, etc.) The FRC module provides the majority of features for an FRC robot, such as access to joysticks (several mappings created so far, as well as the ability to create your own), autonomous scheduling, and sensors. Finally, the CTRE module provides compatibility and drop-in replacements for CTRE’s Phoenix framework, including the “drivetrain model" for organizing motor controllers, and integrates with SnakeSkin’s auto executor. In terms of overhead, SnakeSkin has a very low impact (CPU usage for the user code process measured around 4% on an empty project). SnakeSkin makes heavy use of the Java Executor framework to allow flexibly timed tasks to be executed reliably and concurrently. While SnakeSkin is (we think, at least) stable for competition use, we do plan to add more features in the near future including better logging and power management.

SnakeEyes
SnakeEyes was created late in the offseason, and is far from completion. In the end, it is intended to provide common, reusable vision utilities (such as data and video streaming, config, etc.) for custom vision code. Deviating from previous years, and attempting to standardize our codebase, this is also written in Kotlin (as opposed to C++ or Python from 2017 or 2016). Despite its similarity in name to SnakeSkin, it does not provide a DSL, but instead many utility classes that can be used in any way needed. This project will experience most of its development during the 2018 season, to ensure that it is usable. Currently SnakeEyes offers tiling picture-in-picture view and configurable targeting crosshairs.

JV4L2
One of our simplest projects this offseason, JV4L2 provides a simple JNI wrapper around the property system in V4L2. It allows Java (and Kotlin, of course) code to set properties such as exposure, contrast, brightness, or any of the other properties from the extensive list available. It was developed to be used within SnakeEyes, however is fully capable of being used standalone.

MP-Generator
MP-Generator provides a GUI based motion profiling generator that allows easy creation and previewing of waypoints. Currently MP-Generator can generate profiles using FalconPathPlanner and export them to CSV files. MP-Generator profiles have not yet been tested. We’re working on adding Pathfinder as an option for path generation and adding functionality for displaying velocity graphs.

LightLink and LightLink-Java
LightLink and LightLink-Java provide both RIO and Arduino side code for driving Adafruit’s Neopixel addressable LED strips and rings in a variety of patterns useful for FRC. It employs a simple I2C based command system for transferring commands from the RIO to the Arduino. The Arduino code is fully state machine based, so no calls to “delay" when rendering effects. This means that transitions between effects are instant. In addition, a special mode “SIGNAL" is provided, which quickly pulses the strip in the commanded color 6 times. Signals interrupt any previously running effects, and cannot be interrupted by anything but other signals. When a signal is finished, the strip returns to its previous effect. LightLink supports up to 16 light strips simultaneously, and is fully capable of rendering each strip separately. LightLink-Java provides a simple API that should be accessible to most teams. A C++ API is planned for the future. Oh, and did I mention it has rainbows?

2017-Rumble-Code
This repository holds the code used on our offseason robot “Kaplan". This robot made it to finals at the Rumble in the Roads offseason in Virginia, and was our first practical test of most of our offseason code. It allowed us to verify SnakeSkin’s reliability in a competition environment, and also made use of LightLink for signaling gear status (and pretty rainbows, of course). We also used this opportunity to test the 2018 beta software with SnakeSkin. Unfortunately, in the heat of the competition, we didn’t maintain our version control “best practices", so the repository is a bit of a mess. The “2018-Beta" branch represents the most recent version of the code.

All of the code we write is always publicly available on our GitHub, so please feel free to take a look at what we’ve been working on!

Of course, if you have any questions, please don’t hesitate to ask!

4 Likes

Offseason CAD Release

During the fall Team 401 built our first ever offseason bot and competed in our first offseason event. After having issues with an overly complex bot that was constantly pushing the weight limits as we changed parts and systems during season last year we decided to focus on building a simple, light weight, quick robot. Having seen the success that 2451 and other teams had last year with using 775pro gearboxes for significant space and weight savings we decided to try and build our own. We also used this as an opportunity for students to gain experience using our Haas TM1P CNC mill and Techno LC 3024 CNC router.

Here’s a render of our offseason robot “Kaplan”:

Specs:

  • 76 pounds with battery and bumpers
  • 8 wheel chain-in-tube West Coast Drive with 4” Colson wheels
  • Custom ballshifting 4x775pro gearboxes (5.1 lb each)
  • 5.7 / 15.7 FPS adjusted speeds
  • PID controlled gear arm with stow, score, intake positions and controlled scoring action
  • Current sensing gear intake that can signal, stow, and switch to low voltage to keep gear retained.
  • “Auto” Climber with current sensing that switches to low voltage stall to keep touchpad triggered
  • LightLink light bar used for signalling last 30 seconds, successful climb, wants gear, has gear, and of course rainbow for disabled.

Here’s some footage from our offseason competition. Overall the robot performed well all the way through the competition. The only issue we had was with a piece of HDPE on the gear intake. After competition we’ve pulled off the climber and gear intake and have attached an 8020 upper frame that we used (with a little help from our football team) for full weight testing and will use for prototype testing in 2018.

More pictures in imgur album

CAD files for offseason robot

1 Like

The best off season robot name in my book.

1 Like

Agreed.

Did you guys have any issues with your drivetrain at rumble? If not, did you use any type of voltage limiting? You said you tested it under load/ were performing tests. How have the results been, and how much weight did you test it under?

The drivetrain worked really well at Rumble. We were running a current limit of 30 amps, which effectively limits voltage under high torque conditions. We tested it with 90 pounds of additional weight and were still able to maneuver very well. We saw robot voltage drop as low as 8v when doing quick turns in high gear, but we feel this is caused by several old motors on the left side of the drivetrain which were not treated well during their use on the 2017 robot, and thus had an increased resistance. We also feel that we can voltage limit in software to compensate if needed.

2 Likes