-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
139 changed files
with
24,618 additions
and
11,690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# MicroSquad documentation | ||
|
||
## Design philosophy | ||
|
||
**MicroSquad** combines physical devices with virtual devices through Internet of Things (**IoT**) concepts. | ||
|
||
Interactions and readings from the physical world are captured through **Terminals** - i.e. devices such as a Microbit microcontroller (which is equipped with sensors such as buttons, temperature, motion sensors, touch pads) or even a mobile phone (for more complex interactions support). | ||
|
||
By combining an interaction logic loop (or **Workflow**), one can use **MicroSquad** to create games and team exercises. | ||
|
||
The state of **Terminals** and of the **Workflow** are maintained and made available through a hierarchy of variables and their respective values. These values are made available through an **MQTT broker** and accessible via standard Internet protocols (**TCP** and **Websockets**). | ||
|
||
From then on, it becomes possible to create interactive **Scenes**, such as 3D environments where the players of a team game can be represented as 3D avatars, or augmented reality experiences combining virtual and physical elements. | ||
|
||
On the **scene**, relying on the same design philosophy, all composing elements (3D characters, decor elements, heads up displays, cameras, lighting) are also represented and interacted with via the **MQTT broker**. | ||
|
||
The **MQTT broker** values hierarchy relies on a naming convention called [Homie](https://homieiot.github.io/) - Homie exposes a **device** and **property** model that is compatible with **IoT** software such as **HomeAssistant** - so all **MicroSquad** devices (be they physical or virtual) can be mixed and matched with other home automation devices (such as lightbulbs, smart power sockets etc...). | ||
|
||
## Implementation | ||
|
||
The following architecture diagram summarizes the organization of a typical MicroSquad setup : | ||
|
||
![Architecture](https://github.com/CMCRobotics/microsquad/blob/develop/docs/plantuml/MicroSquad%20Architecture.png?raw=true) |
Binary file renamed
BIN
+71.4 KB
...ntuml/game-management/game-management.png → docs/plantuml/Game Management.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+24.6 KB
...gateway-components/Gateway components.png → docs/plantuml/Gateway components.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@startuml MicroSquad Architecture | ||
title MicroSquad Architecture | ||
|
||
actor Player as player | ||
agent Terminal as terminal | ||
database "MQTT Broker" as broker | ||
|
||
|
||
agent "Bitio Gateway" as gateway | ||
|
||
interface Websocket as websocket | ||
interface TCP as tcp | ||
|
||
package "Game workflow" as workflow | ||
|
||
agent "3D Scene Manager" as scene | ||
|
||
player ..> terminal : Interacts | ||
terminal <..> gateway : Read and control terminal state | ||
websocket <--> broker | ||
gateway <--> tcp : Update game workflow | ||
tcp <--> broker | ||
workflow <--> tcp : Manage game | ||
scene <--> websocket : Update game visuals | ||
|
||
actor Avatar as avatar | ||
actor "Virtual Display" as display | ||
avatar <-- scene | ||
display <-- scene | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@startuml | ||
@startuml Game Management | ||
|
||
|
||
actor "Game Organiser" as Organiser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@startuml Microbit Client | ||
autonumber 1.1 | ||
queue "Broker" as broker | ||
control "Gateway" as gateway | ||
actor "Player" as player | ||
boundary "Microbit Terminal" as microbit | ||
|
||
activate player | ||
activate gateway | ||
|
||
player -> microbit : Turn on | ||
|
||
activate microbit | ||
|
||
microbit -> gateway : bonjour | ||
gateway -> microbit : bonjour | ||
|
||
microbit -> microbit : alive() | ||
loop For ever | ||
microbit -> microbit : incoming= poll_messages() | ||
alt message | ||
autonumber inc A | ||
gateway -> microbit : radio_send() | ||
loop while incoming | ||
microbit -> microbit : message,tags,timestamp = parse_line_protocol() | ||
alt For this terminal | ||
alt show | ||
microbit -> microbit : display() | ||
end | ||
alt vote | ||
microbit -> microbit : vote_particles() | ||
end | ||
alt emote | ||
microbit -> microbit : vote_emotes() | ||
end | ||
alt buttons | ||
microbit -> microbit : read_buttons() | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
deactivate microbit | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
yotta_modules/ | ||
yotta_targets/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"build": { | ||
"target": "bbc-microbit-classic-gcc,https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# How to compile | ||
|
||
```bash | ||
docker run -v `pwd`:/home --rm ghcr.io/carlosperate/microbit-toolchain:latest yotta build | ||
``` | ||
|
||
Find the resulting firmware in : | ||
|
||
``` | ||
build/bbc-microbit-classic-gcc/source/microsquad-arm0-combined.hex | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"microbit-dal":{ | ||
"bluetooth":{ | ||
"enabled": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "microsquad-arm0", | ||
"version": "1.0.0", | ||
"description": "A MicroSquad client for Microbit v1", | ||
"license": "GPLv3", | ||
"dependencies": { | ||
"microbit": "lancaster-university/microbit#v2.1.1" | ||
}, | ||
"targetDependencies": {}, | ||
"bin": "./source" | ||
} |
Oops, something went wrong.