Project Structure¶
Hedgehog’s source files are divided into several repositories hosted on GitHub. This page shortly describes their roles and relations to each other.
Hardware¶
- Hedgehog_PCB
- KiCad schematics and layouts of Hedgehog’s hardware controller.
- HedgehogCase
- 3D models and SVG laser cutting files of Hedgehog’s case.
HWC Software & Tools¶
- HedgehogFirmware
- Firmware to run on the HWC’s STM32 microcontroller, written in C.
Common Python Packages¶
- HedgehogUtils
- Collection of Python utilities for Hedgehog, but not specific to a particular part of the software. Utilities are mostly for Protocol Buffers and ZeroMQ,
- HedgehogPlatform
Python library that detects the “platform” that Hedgehog software is run on, i.e. the kind of software controller used, and provides platform independent interfaces on top of features that differ by platform. Right now, the only feature that is abstracted in this way is access to the HWC, used by HedgehogServer.
The only platform that is currently used for Hedgehog is the Raspberry Pi 3. In the past, an Orange Pi 2 was used instead. As there is only one platform in use at the moment, and it is hard to anticipate what platform differences may arise, this repository’s code is currently somewhat stale.
- HedgehogProtocol
Contains protocol buffers definitions and Python classes for the Hedgehog Protocol. In addition to the classes generated from the protobuf definition, this repository contains:
- Exception classes that correspond to error acknowledgement codes
- Wrapper classes that correspond to Hedgehog protocol messages: a single protobuf message type may correspond to multiple Hedgehog message types; for example, sensor requests and sensor replies are transported as the same message type. The wrapper classes convey what Hedgehog message is represented, and provide message-specific validation.
- helpers for working with Hedgehog protocol messages over ZeroMQ sockets, such as sockets that encode and decode single- or multipart messages.
HedgehogProtocol depends on HedgehogUtils for its ZeroMQ and Protobuf capabilities.
Server Software¶
- HedgehogServer
- Serves clients that use the Hedgehog protocol. The server is written in Python and builds on HedgehogProtocol. To handle client requests, the server communicates with the HWC, utilizing HedgehogPlatform to determine how to do that.
- hedgehog-ide
- Hedgehog’s web IDE. The server part uses Node.js, the browser side Angular 4; both parts are written in TypeScript. To communicate with the HedgehogServer, HedgehogNodeClient is used.
Client Software¶
- HedgehogClient
- Python client library for Hedgehog. The library builds on top of HedgehogProtocol.
- HedgehogNodeClient
- Node.js client library for Hedgehog. At the moment, this library also includes the protocol implementation for Node.js. The hedgehog-ide uses this to communicate to the HedgehogServer.
Miscellaneous¶
- Hedgehog
- Contains this documentation, and also a Makefile that serves as the entry point into Hedgehog software installation.
- HedgehogBundle
- Bundles installation scripts into one repository. The bundle contains folders for installations of Python, Node, OpenCV, protoc, the HWC firmware, server, IDE, client, and boot service.
- HedgehogTester
- A simple client program that helps testing all of Hedgehog’s hardware.