# Software Architectures
###### tags: `CS233` `robotics` `presentation`
---
Warmup activity: You need to program a robot to navigate a maze.
- What are all the different "functions" you may need?
- What assumptions are you making about the nature of the maze?

---
## Types of software architectures
- Operational: describe what the system does
- Systems: Describe how the system is decomposed
- Technical: Describe implementation details
---
## Operational architectures for robots
- Described in terms of *layers*
- Which function goes to which layer depends on five attributes:
- *primitives*
- *perceptual ability*
- *planning horizon*
- *time scale*
- *use of models*
---
### Primitives
- Four primitives: SENSE, PLAN, ACT and LEARN
- SENSE: takes sensor input and produces output useful to other functions
- PLAN: takes information from sensors or world model, and produces tasks
- ACT: produces commands to the motors/actuators
- LEARN: mechanisms for improving the other operations
---
| Robot primitives | Input | Output |
|:---------------- |:-------------------------- |:----------------- |
| SENSE | Sensor data | Sensed info |
| PLAN | Info (sensed or cognitive) | Directives |
| ACT | Directives or sensed info | Actuator commands |
---
Practice. Classify the following operations:
1. Turn head 30 degrees to the right
2. Detect obstacle ahead
3. Choose between fleeing mode and roaming mode
4. Determine distance to object
5. Decide that when you encounter a wall you will move to the right along it
6. Play a sound
7. Play a sound that depends on the distance to an object
---
### Perceptual ability
- Perception is the conversion of sensory input into information
- Two kinds of perception:
- Direct perception, directly based on the incoming signals
- Recognition, based on the conversion of sensory information into symbols
---
### Planning horizon
What data does the capability need
- present
- past and present
- future, past and present
---
### Time scale
How quick must the functionality be:
- very fast
- fast
- slow
---
### World model
- local world model: sensor information collected just for that function
- global world model: sensor information is first processed into a global view
---
## AI Operational architecture layers

---
## Systems architecture layers

---
### Systems architecture paradigms
Can be clasified based on two traits:
- Interaction between primitives
- Route of sensing
---
Interactions:
- SENSE, PLAN, ACT (in sequence)
- SENSE-ACT (coupled)
- PLAN, SENSE-ACT
---
Sensing routes:
- local sensing: information goes directly to function that needs it
- global sensing: information is first compiled into the world model
- hybrid sensing: information goes in both directions
---
### Systems architecture paradigms
| Paradigm | Primitives | Sensing |
|:------------ | ---------------- | ------- |
| Hierarchical | SENSE, PLAN, ACT | Global |
| Reactive | SENSE-ACT | Local |
| Hybrid | PLAN, SENSE-ACT | Hybrid |
{"metaMigratedAt":"2023-06-17T00:32:37.754Z","metaMigratedFrom":"Content","title":"Software Architectures","breaks":false,"contributors":"[{\"id\":\"26c48a25-a9eb-4305-aea3-1c48d76b2506\",\"add\":3544,\"del\":280}]"}