OpenCat‑Quadruped‑Robot – Technical Briefing

Clone (verbatim) git clone https://github.com/moses-y/OpenCat-Quadruped-Robot


The Problem

This repository is a portfolio of five semi‑independent projects (ModuleTests, src, serialMaster, pyUI, OpenCatPythonAPI) that together form an open‑source quadruped‑robot framework. There is no single entry point, no shared build pipeline, and no lockfile for the Python dependencies. A contributor who clones the repo and tries to run a demo faces an ad‑hoc set of install steps, missing test coverage, and large binaries that inflate clone size.


What This Does

OpenCat supplies low‑level control for four‑legged robots: servo timing, IMU integration, and gait coordination. The code base is split into distinct domains:

ProjectSizePrimary languageRole
ModuleTests78 files (15 code)C/C++, Python, YAMLTest‑infra for individual sensors, drivers, and Arduino sketches
src68 files (13 code)C/C++Core robotics libraries (motor drivers, IMU, sensor packs)
serialMaster12 files (10 code)PythonSerial‑port orchestration for communicating with the robot’s board
pyUI127 files (9 code)Python/MarkdownUI / debugging tools (Debugger.py, commonVar.py, FirmwareUploader.py)
OpenCatPythonAPI11 files (8 code)PythonHigh‑level Python API; contains requirements.txt and demo scripts

The React tag detected by the scanner appears only in the pyUI front‑end fragments; the bulk of the functionality is C/C++ firmware and Python glue code.

Key files and their responsibilities (derived from the internal call graph):

  • OpenCatPythonAPI/requirements.txt – declares pyserial, numpy etc.; no lockfile → non‑reproducible builds.
  • serialMaster/SerialCommunication.py – opens the serial port without a context manager (resource‑safety finding).
  • pyUI/Debugger.pyopen(...) not wrapped in with (resource‑safety finding).
  • pyUI/commonVar.py – same pattern (resource‑safety finding).

The import graph resolves 27 internal modules with zero import edges and no circular dependencies, indicating each project can be built/understood in isolation.


How It Is Wired

Execution flow depends on which sub‑project you target:

Entry pointWhat it doesOut‑of‑repo effects
OpenCatPythonAPI/demos/*.pyRuns a demo (keyboard control, serial example, skill playback). Calls serialMaster/SerialCommunication.open() to talk to the board over USB.Sends UART commands to the robot’s firmware; no network or DB involvement.
ModuleTests/*.ino (Arduino)Compiles and uploads to an ATmega328P (NyBoard) or ESP32 board. Uses src/ drivers for IMU, infrared, etc.Programs the onboard microcontroller; no external services.
src/mpu6050/MPU6050.cppLow‑level MPU‑6050 driver (I²C). Called by higher‑level gait code.Pure firmware; no external I/O.

The most connected module according to the measured graph is OpenCatPythonAPI/demos/BittleHitKeyboard (Ca 0, Ce 0), i.e., a leaf demo with no importers or importers. No hubs or cycles exist, so changing one component does not automatically ripple through the others—each project must be wired independently.


How To Use It

Setup

# 1️⃣ Clone
git clone https://github.com/moses-y/OpenCat-Quadruped-Robot
cd OpenCat-Quadruped-Robot

# 2️⃣ Python API dependencies (OpenCatPythonAPI)
python -m venv .venv && source .venv/bin/activate
pip install -r OpenCatPythonAPI/requirements.txt   # pyserial, numpy

No lockfile is present; pin versions manually if reproducibility is required.

Configuration

  • No environment variables or secret keys are required for the basic demos.
  • For serial communication, ensure the correct port is selected (e.g., /dev/ttyUSB0 on Linux, COM3 on Windows).

Running a demo

# Example: keyboard‑controlled Bittle demo
python OpenCatPythonAPI/demos/BittleHitKeyboard.py

The script opens the serial port, sends posture commands, and displays real‑time joint angles in the console.

Building firmware (Arduino)

# Install Arduino IDE, then open any *.ino under ModuleTests/ or src/
# Use “Upload” to target the NyBoard (ATmega328P) or an ESP32 board.

Real‑World Use

A graduate‑level RL lab can use the OpenCatPythonAPI to script gait experiments on a Bittle X robot. The researcher writes a Python controller that calls serialMaster/SerialCommunication.send() to transmit way‑points; the robot’s firmware (C++ in src/) converts those way‑points into servo pulses. The loop runs at ~100 Hz, allowing reinforcement‑learning policies to be evaluated on hardware without custom driver code.


Code Health & Issues

Measured findings (static analysis, 77 total)

SeverityIssueFiles
HIGHNo test suite – 55 source files have no corresponding tests
HIGHNo CI configuration – changes merge without a built‑test run
MEDIUMDependencies declared without a lockfile – non‑reproducible buildsOpenCatPythonAPI/requirements.txt
MEDIUMFile opened without context manager (resource leak)pyUI/Debugger.py, pyUI/commonVar.py, serialMaster/SerialCommunication.py
MEDIUMBroad exception handling swallows errorspyUI/FirmwareUploader.py, serialMaster/ardSerial.py
MEDIUMHigh branching density in IRremote and sensor tests (23 branches / 58 lines)ModuleTests/testInfraredRemote/IRremote.cpp, .../IRremote.h
LOWDeep nesting (max indent 15) in test infra filesModuleTests/testInfraredRemote/private/IRremoteBoardDefs.h, …

SDLC observations (structure‑driven)

  • Tests present: yes (78 test files) but no CI to run them.
  • CI: GitHub Actions configured? No explicit workflow found.
  • Dockerfile: absent – no containerised build.
  • Licence: present (LICENSE file).
  • Lockfile: absent (Python dependencies).
  • Committed secrets: none detected.

The Bottom Line

OpenCat‑Quadruped‑Robot is a collection of five focused projects that together deliver a capable quadruped‑control framework. The C++ firmware and Python API are functional and well‑structured for their individual scopes, but the repo lacks a unified build/test pipeline, a dependency lockfile, and basic CI. It is well‑suited for educators, hobbyists, and researchers who are comfortable wiring their own serial/Arduino workflows, but teams requiring reproducible CI/CD or robust test coverage will need to add those layers themselves.

If you need a ready‑to‑run robot platform with out‑of‑the‑box CI, consider the upstream PetoiCamp/OpenCat-Quadruped-Robot (5200 ⭐) which provides a more mature monorepo structure.