diff --git a/.spelling b/.spelling index c564e52..065d632 100644 --- a/.spelling +++ b/.spelling @@ -1,11 +1,14 @@ 6pm blocklyscienceday +BoardMeta +BoardRunner CircleCI compstate-smallpeice2017 dfu-bootloader dropdown GitHub Mainroad +MasterProcess mixtape-smallpeice2017 motor-v4-fw motor-v4-hw @@ -23,6 +26,8 @@ sb2018-game-presentation sb2018-rules sb-techday sb-vision +seqpacket SourceBots srcomp-kiosk +subgraph sym diff --git a/content/codebase/_index.md b/content/codebase/_index.md index f29d750..83156ae 100644 --- a/content/codebase/_index.md +++ b/content/codebase/_index.md @@ -11,71 +11,71 @@ This page contains a summary of the repositories on [GitHub][sb-github]. ## Administration -| Name | GitHub Repository | More Info | -| ------------------------ | ---------------------------------------------------- | ---------- | -| bunfight-form | {{< github "sourcebots/bunfight-form" >}} | | -| compstate-smallpeice2017 | {{< github "sourcebots/compstate-smallpeice2017" >}} | | -| emails | {{< github "sourcebots/emails" >}} | | -| media-consent | {{< github "sourcebots/media-consent" >}} | | -| minutes | {{< github "sourcebots/minutes" >}} | | -| mixtape-smallpeice2017 | {{< github "sourcebots/mixtape-smallpeice2017" >}} | | -| sb-techday | {{< github "sourcebots/sb-techday" >}} | | -| sb2018-game-presentation | {{< github "sourcebots/sb2018-game-presentation" >}} | | -| sb2018-rules | {{< github "sourcebots/sb2018-rules" >}} | | -| wiki | {{< github "sourcebots/wiki" >}} | | +| Name | GitHub Repository | +| ------------------------ | ---------------------------------------------------- | +| bunfight-form | {{< github "sourcebots/bunfight-form" >}} | +| compstate-smallpeice2017 | {{< github "sourcebots/compstate-smallpeice2017" >}} | +| emails | {{< github "sourcebots/emails" >}} | +| media-consent | {{< github "sourcebots/media-consent" >}} | +| minutes | {{< github "sourcebots/minutes" >}} | +| mixtape-smallpeice2017 | {{< github "sourcebots/mixtape-smallpeice2017" >}} | +| sb-techday | {{< github "sourcebots/sb-techday" >}} | +| sb2018-game-presentation | {{< github "sourcebots/sb2018-game-presentation" >}} | +| sb2018-rules | {{< github "sourcebots/sb2018-rules" >}} | +| wiki | {{< github "sourcebots/wiki" >}} | ## Hardware -| Name | GitHub Repository | More Info | -| ----------- | --------------------------------------- | --------- | -| motor-v4-hw | {{< github "sourcebots/motor-v4-hw" >}} | | -| pcbmedals | {{< github "sourcebots/pcbmedals" >}} | | -| pkg | {{< github "sourcebots/pkg" >}} | | -| power-v4-hw | {{< github "sourcebots/power-v4-hw" >}} | | -| sym | {{< github "sourcebots/sym" >}} | | +| Name | GitHub Repository | +| ----------- | --------------------------------------- | +| motor-v4-hw | {{< github "sourcebots/motor-v4-hw" >}} | +| pcbmedals | {{< github "sourcebots/pcbmedals" >}} | +| pkg | {{< github "sourcebots/pkg" >}} | +| power-v4-hw | {{< github "sourcebots/power-v4-hw" >}} | +| sym | {{< github "sourcebots/sym" >}} | ## Media -| Name | GitHub Repository | More Info | -| -------------- | ------------------------------------------ | --------- | -| art | {{< github "sourcebots/art" >}} | | -| docs | {{< github "sourcebots/docs" >}} | | -| Mainroad | {{< github "sourcebots/Mainroad" >}} | | -| volunteer-docs | {{< github "sourcebots/volunteer-docs" >}} | | +| Name | GitHub Repository | +| -------------- | ------------------------------------------ | +| art | {{< github "sourcebots/art" >}} | +| docs | {{< github "sourcebots/docs" >}} | +| Mainroad | {{< github "sourcebots/Mainroad" >}} | +| volunteer-docs | {{< github "sourcebots/volunteer-docs" >}} | ## Misc -| Name | GitHub Repository | More Info | -| ----------------- | --------------------------------------------- | --------- | -| blocklyscienceday | {{< github "sourcebots/blocklyscienceday" >}} | | -| testing-repo | {{< github "sourcebots/testing-repo" >}} | | +| Name | GitHub Repository | +| ----------------- | --------------------------------------------- | +| blocklyscienceday | {{< github "sourcebots/blocklyscienceday" >}} | +| testing-repo | {{< github "sourcebots/testing-repo" >}} | ## Robot Code -| Module Name | GitHub Repository | Presentation | More Info | -| -------------- | ------------------------------------------ | ------------ | --------- | -| dfu-bootloader | {{< github "sourcebots/dfu-bootloader" >}} | | | -| motor-v4-fw | {{< github "sourcebots/motor-v4-fw" >}} | | | -| pi-image | {{< github "sourcebots/pi-image" >}} | | | -| powerman | {{< github "sourcebots/powerman" >}} | | | -| power-v4-fw | {{< github "sourcebots/power-v4-fw" >}} | | | -| robot-api | {{< github "sourcebots/robot-api" >}} | | | -| robotd | {{< github "sourcebots/robotd" >}} | | | -| runusb | {{< github "sourcebots/runusb" >}} | | | -| sb-vision | {{< github "sourcebots/sb-vision" >}} | | | -| servo-firmware | {{< github "sourcebots/servo-firmware" >}} | | | -| simulator | {{< github "sourcebots/simulator" >}} | | | -| zone-script | {{< github "sourcebots/zone-script" >}} | | | +| Module Name | GitHub Repository | Presentation | +| -------------- | ------------------------------------------ | ------------ | +| dfu-bootloader | {{< github "sourcebots/dfu-bootloader" >}} | | +| motor-v4-fw | {{< github "sourcebots/motor-v4-fw" >}} | | +| pi-image | {{< github "sourcebots/pi-image" >}} | | +| powerman | {{< github "sourcebots/powerman" >}} | | +| power-v4-fw | {{< github "sourcebots/power-v4-fw" >}} | | +| robot-api | {{< github "sourcebots/robot-api" >}} | | +| robotd | {{< github "sourcebots/robotd" >}} | | +| runusb | {{< github "sourcebots/runusb" >}} | | +| sb-vision | {{< github "sourcebots/sb-vision" >}} | | +| servo-firmware | {{< github "sourcebots/servo-firmware" >}} | | +| simulator | {{< github "sourcebots/simulator" >}} | | +| zone-script | {{< github "sourcebots/zone-script" >}} | | ## Utilities -| Name | GitHub Repository | More Info | -| ------------- | ----------------------------------------- | --------- | -| Arturo | {{< github "sourcebots/Arturo" >}} | | -| barcode-gen | {{< github "sourcebots/barcode-gen" >}} | | -| kit-testing | {{< github "sourcebots/kit-testing" >}} | | -| marker-to-pdf | {{< github "sourcebots/marker-to-pdf" >}} | | -| pcb-util | {{< github "sourcebots/pcb-util" >}} | | -| srcomp-kiosk | {{< github "sourcebots/srcomp-kiosk" >}} | | -| tools | {{< github "sourcebots/tools" >}} | | +| Name | GitHub Repository | +| ------------- | ----------------------------------------- | +| Arturo | {{< github "sourcebots/Arturo" >}} | +| barcode-gen | {{< github "sourcebots/barcode-gen" >}} | +| kit-testing | {{< github "sourcebots/kit-testing" >}} | +| marker-to-pdf | {{< github "sourcebots/marker-to-pdf" >}} | +| pcb-util | {{< github "sourcebots/pcb-util" >}} | +| srcomp-kiosk | {{< github "sourcebots/srcomp-kiosk" >}} | +| tools | {{< github "sourcebots/tools" >}} | [sb-github]: https://github.com/sourcebots diff --git a/content/codebase/robotd.md b/content/codebase/robotd.md new file mode 100644 index 0000000..ad79e5b --- /dev/null +++ b/content/codebase/robotd.md @@ -0,0 +1,36 @@ +--- +title: RobotD +--- + +{{% notice info %}} +This page details information about how the code works that is beyond the scope of the README file. The information is not guaranteed to be completely up to date, but is intended to give a general overview of the structure and workings of the module. +{{% /notice %}} + +RobotD runs a master process which monitors for robot peripherals. For each peripheral it finds, it opens a UNIX seqpacket socket in `/var/robotd//`. + +You can find out more about how to use it at the GitHub page: {{< github "sourcebots/robotd" >}}. + +## Diagram of RobotD + +{{}} +graph TB +subgraph "" +BoardMeta --> Board +Board --> Camera +Board --> Motor +Board --> Servo +Board --> Game +Board --> Power +end +subgraph "" +MasterProcess -.-> BoardRunner +BoardRunner -.-> Connection +BoardRunner -.-> Board +end +{{}} + +This diagram represents a simplified structure of the classes inside robotD and how they interact with each other. More information on the individual classes can be found below. + +## Classes + +{{% display_classes "robotd" %}} diff --git a/data/codebase/robotd.yml b/data/codebase/robotd.yml new file mode 100644 index 0000000..aaba61d --- /dev/null +++ b/data/codebase/robotd.yml @@ -0,0 +1,20 @@ +classes: + - class: + name: BoardMeta + file: devices_base.py + inherits: type + subclasses: + - Board + description: This is a MetaClass that manages the creation of Boards. It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. + - class: + name: Board + file: devices_base.py + subclasses: + - Camera + - MotorBoard + - etc + description: This class defines a generic device with empty methods. Subclasses of `Board` define how to detect these boards and how to interact with them. It is created using a MetaClass `BoardMeta`. It is worth noting that `Board` is likely to be renamed in the future as not all peripherals are boards + - class: + name: Connection + file: master.py + description: This class provides an abstraction around the socket such that `robot-api` can communicate with the `Board` classes using diff --git a/layouts/shortcodes/display_classes.html b/layouts/shortcodes/display_classes.html new file mode 100644 index 0000000..0c6698e --- /dev/null +++ b/layouts/shortcodes/display_classes.html @@ -0,0 +1,28 @@ +{{ with (index .Site.Data.codebase (.Get 0)) }} + {{ range .classes }} +

{{ .class.name }}

+ + + + + + {{ if isset .class "inherits" }} + + + + + {{ end }} + {{ if isset .class "subclasses" }} + + + + + {{ end }} +
File:{{ .class.file }}
Inherits From:{{ .class.inherits }}
Subclasses: + {{ range .class.subclasses }} + {{ . }}  + {{ end }} +
+

{{ .class.description | markdownify | safeHTML }}

+ {{ end }} +{{ end }}