Creature Controller

There’s two parts to the Creature Controller. They work together and both are required.

  • The computer application. (Runs on macOS and Linux.)
  • The hardware that the computer application is talking to.

These two things were once all together and running on a Pi Pico. I’ve re-written most of into a Linux application to make it easier for me to use. When it’s was running on the Pi Pico alone, when I need to make changes to the creature’s configuration I need to do the edit code → compile code → flash to the Pi Pico dance. While I can do that pretty quickly, it’s not a super fast process. The Linux version defines the creature as a JSON file and loads its configuration at runtime.

The Computer Application part of the Creature Controller

The Creature Controller computer application talks over the network to the Creature Server. The computer application talks to the hardware Creature Controller over a simple USB Serial (CDC) connection. Since TinyUSB implements the CDC protocol correctly, I don’t even need drivers on the Linux (and macOS!) host. Just plug it in and look for the device node.

How to Build It

First off, grab the source from GitHub.

Inside the source there are two distinct projects. One is called controller, which is the Linux software itself, and one is called firmware. This is what runs on the Creature Controller hardware.

The controller software complies down to a normal Linux binary, and the firmware compiles down to a uf2 file, as is typical on all Pi Pico projects.

You have to build each project independently. (See the GitHub action for how I do it for CI.) This is because CLion, the IDE that I use, is unable to handle two different toolchains in one project. If I try to combine them together it will attempt to use the normal C++ compiler on it, and it will fail in horrible ways.

cd into each of controller and firmware and type mkdir build && cd build && cmake .. && make -j4 to get binaries. The controller has unit tests that get built at the same time.