Skip to content

Commit

Permalink
Updated Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jkerpe committed Nov 17, 2023
1 parent 03eb1a8 commit 3094acc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 87 deletions.
14 changes: 7 additions & 7 deletions doc/architecture/SENSORFUSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ This channel is used to send raw sensor data used for Sensor Fusion on the ZumoC

* The datatypes can be found in SerialMuxChannel.h.
* Order:
* Acceleration in X (raw sensor value)
* Acceleration in Y (raw sensor value)
* turnRateZ around Z (raw sensor value)
* Magnetometer value in X (raw sensor value)
* Magnetometer value in Y (raw sensor value)
* Acceleration in X (raw sensor value in digits)
* Acceleration in Y (raw sensor value in digits)
* turnRateZ around Z (raw sensor value in digits)
* Magnetometer value in X (raw sensor value in digits)
* Magnetometer value in Y (raw sensor value in digits)
* Angle calculated by Odometry (in mrad)
* Position in X calculated by Odometry (in mm)
* Position in Y calculated by Odometry (in mm)
Expand All @@ -47,11 +47,11 @@ The application uses the same [State Machine](https://github.com/BlueAndi/RadonU

### HAL
Some changes have been made to the HAL.
![HALSensorFusion](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/RadonUlzer/SensorFusion/doc/architecture/uml/LogicalView/SensorFusion/HAL_SensorFusion.puml)
![HALSensorFusion](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/RadonUlzer/SensorFusion/sync/doc/architecture/uml/LogicalView/SensorFusion/HAL_SensorFusion.puml)

ButtonB, ButtonC, the ProximitySensor and the Buzzer have been removed.
An IMU has been added:
![HALIMU](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/RadonUlzer/SensorFusion/doc/architecture/uml/LogicalView/SensorFusion/HAL_IMU.puml)
![HALIMU](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/RadonUlzer/SensorFusion/sync/doc/architecture/uml/LogicalView/SensorFusion/HAL_IMU.puml)

# Abbreviations

Expand Down
74 changes: 27 additions & 47 deletions doc/architecture/uml/LogicalView/SensorFusion/HAL_IMU.puml
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
@startuml HAL IMU
@startuml

title Hardware Abstraction Layer - IMU
title RadonUlzer - Hardware Abstraction Layer

package "HAL" as hal {

package "HAL Interfaces" as halInterfaces {
interface "IBoard" as iBoard {
+ {abstract} getIMU() : IIMU&
+ init() : void
}
interface "IIMU" as iIMU {
+ {abstract} init() : bool
+ {abstract} readAcc() : void
+ {abstract} readAccelerometer() : void
+ {abstract} readGyro() : void
+ {abstract} readMag() : void
+ {abstract} accDataReady() : bool
+ {abstract} readMagnetometer() : void
+ {abstract} accelerometerDataReady() : bool
+ {abstract} gyroDataReady() : bool
+ {abstract} magDataReady() : bool
+ {abstract} getAccelerationValues(int16_t* accelerationValues) : void
+ {abstract} getTurnRates(int16_t* turnRates) : void
+ {abstract} getMagnetometerValues(int16_t* magnetometerValues) : void
+ {abstract} magnetometerDataReady() : bool
+ {abstract} getAccelerationValues(IMUData* accelerationValues) : void
+ {abstract} getTurnRates(IMUData* turnRates) : void
+ {abstract} getMagnetometerValues(IMUData* magnetometerValues) : void

}
struct IMUData {
+ valueX: int16_t
+ valueY: int16_t
+ valueZ: int16_t
}
}

package "HAL Simulation" as simulation {
class "IMU" as ImuSim {
- m_accelerationValues[3] : int16_t
- m_gyroValues[3] : int16_t
- m_magnetometerValues[3] : int16_t
+ init() : bool
+ readAcc() : void
+ readGyro() : void
+ readMag() : void
+ accDataReady() : bool
+ gyroDataReady() : bool
+ magDataReady() : bool
+ getAccelerationValues(int16_t* accelerationValues) : void
+ getTurnRates(int16_t* turnRates) : void
+ getMagnetometerValues(int16_t* magnetometerValues) : void
- m_accelerationValues : IMUData
- m_gyroValues : IMUData
- m_magnetometerValues : IMUData
}
class "Board" as BoardSim {
- m_imu : IMU
Expand All @@ -49,35 +40,24 @@ package "HAL" as hal {

package "HAL Target" as target {
class "IMU" as ImuTarget {
- m_accelerationValues[3] : vector<int16_t>
- m_gyroValues[3] : vector<int16_t>
- m_magnetometerValues[3] : vector<int16_t>
+ init() : bool
+ readAcc() : void
+ readGyro() : void
+ readMag() : void
+ accDataReady() : bool
+ gyroDataReady() : bool
+ magDataReady() : bool
+ getAccelerationValues(int16_t* accelerationValues) : void
+ getTurnRates(int16_t* turnRates) : void
+ getMagnetometerValues(int16_t* magnetometerValues) : void
- m_accelerationValues : IMUData
- m_gyroValues : IMUData
- m_magnetometerValues : IMUData
}
class "Board" as BoardTarget{
- m_imu : IMU
+ getIMU() : IMU&
+ init() : void
}
}
}

iIMU ..> IMUData: <<use>>
iIMU <|... ImuSim: <<realize>>
iBoard <|... BoardSim: <<realize>>
iBoard *-- iIMU
ImuTarget *- BoardTarget
ImuSim *- BoardSim

iIMU <|... ImuTarget: <<realize>>
iBoard <|... BoardTarget: <<realize>>


}
package "Webots library" as webotsLib {
class Accelerometer {
+ getValues() : double *
Expand Down Expand Up @@ -125,13 +105,13 @@ ImuSim *--> Accelerometer
ImuSim *--> Gyro
ImuSim *--> Compass

note left of iIMU
note right of iIMU
IMU stands for Inertial Measurement Unit.
end note

note left of hal
This diagram shows the added IMU component.
Classes like the LineSensors or Motors
Classes like the LineSensors or Encoders
are missing.
end note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ package "HAL" as hal {
+ {abstract} getResolution() const : uint16_t
}

interface "IDisplay" as iDisplay {
+ {abstract} clear() : void
+ {abstract} gotoXY(xCoord : uint8_t, yCoord : uint8_t) : void
+ {abstract} print(str : const String&) : size_t
+ {abstract} print(str : const char[]) : size_t
+ {abstract} print(value : uint8_t) : size_t
+ {abstract} print(value : uint16_t) : size_t
+ {abstract} print(value : uint32_t) : size_t
+ {abstract} print(value : int8_t) : size_t
+ {abstract} print(value : int16_t) : size_t
+ {abstract} print(value : int32_t) : size_t
}

interface "ILed" as iLed {
+ {abstract} enable(enableIt : bool) : void
}
Expand All @@ -52,28 +39,25 @@ package "HAL" as hal {
+ {abstract} getMaxSpeed() const : int16_t
}

interface "IIMU" as iIMU {
interface "IIMU" as iIMU {
+ {abstract} init() : bool
+ {abstract} readAcc() : void
+ {abstract} readAccelerometer() : void
+ {abstract} readGyro() : void
+ {abstract} readMag() : void
+ {abstract} accDataReady() : bool
+ {abstract} readMagnetometer() : void
+ {abstract} accelerometerDataReady() : bool
+ {abstract} gyroDataReady() : bool
+ {abstract} magDataReady() : bool
+ {abstract} getAccelerationValues(int16_t* accelerationValues) : void
+ {abstract} getTurnRates(int16_t* turnRates) : void
+ {abstract} getMagnetometerValues(int16_t* magnetometerValues) : void
+ {abstract} magnetometerDataReady() : bool
+ {abstract} getAccelerationValues(IMUData* accelerationValues) : void
+ {abstract} getTurnRates(IMUData* turnRates) : void
+ {abstract} getMagnetometerValues(IMUData* magnetometerValues) : void

}
}

class Board << namespace >> {
+ getButtonA() : IButton&
+ getDisplay() : IDisplay&
+ getEncoders() : IEncoders&
+ getLedRed() : ILed&
+ getLedYellow() : ILed&
+ getLedGreen() : iLed&
+ getLineSensors() : ILineSensors&
+ getMotors() : IMotors&
+ getIMU() : IIMU&
Expand Down Expand Up @@ -106,22 +90,16 @@ package "HAL" as hal {
class LineSensors
class ButtonA
class Motors
class Display
class Encoders
class LedRed
class LedYellow
class LedGreen
class IMU
}

iLineSensors <|... LineSensors: <<realize>>
iButton <|... ButtonA: <<realize>>
iMotors <|... Motors: <<realize>>
iDisplay <|... Display: <<realize>>
iEncoders <|... Encoders: <<realize>>
iLed <|... LedRed: <<realize>>
iLed <|... LedYellow: <<realize>>
iLed <|... LedGreen: <<realize>>
iIMU <|... IMU: <<realize>>
}

Expand All @@ -146,12 +124,9 @@ hal -[hidden]-- zumo32u4Lib
LineSensors *--> Zumo32U4LineSensors
ButtonA *--> Zumo32U4ButtonA
Motors *--> Zumo32U4Motors
Display *--> Zumo32U4LCD
Encoders *--> Zumo32U4Encoders
IMU *--> Zumo32U4IMU
LedRed ..> Zumo32U4: <<use>>
LedYellow ..> Zumo32U4: <<use>>
LedGreen ..> Zumo32U4: <<use>>

note bottom of hal
The hardware abstraction layer contains
Expand Down

0 comments on commit 3094acc

Please sign in to comment.