-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
f76b2e1
commit e3761b5
Showing
112 changed files
with
16,892 additions
and
16,892 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,72 +1,72 @@ | ||
# Radon Ulzer - SENSORFUSION <!-- omit in toc --> | ||
|
||
* [General](#general) | ||
* [SerialMuxProt Channels](#serialmuxprot-channels) | ||
* [Tx channel "LINE\_SENS"](#tx-channel-sensor_data) | ||
* [SW Architecture](#sw-architecture) | ||
* [Logical View](#logical-view) | ||
* [Application](#application) | ||
* [Abbreviations](#abbreviations) | ||
* [Issues, Ideas And Bugs](#issues-ideas-and-bugs) | ||
* [License](#license) | ||
* [Contribution](#contribution) | ||
|
||
# General | ||
|
||
The robot sends sensor data (Odometry data and IMU data) via SerialMuxProt. | ||
|
||
On target the physical communication uses the serial. | ||
|
||
On simulation the physical communication uses a socket connection. | ||
|
||
## SerialMuxProt Channels | ||
|
||
|
||
### Tx channel "SENSOR_DATA" | ||
This channel is used to send raw sensor data used for Sensor Fusion on the ZumoComSystem. | ||
|
||
* The datatypes can be found in SerialMuxChannel.h. | ||
* Order: | ||
* 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) | ||
* Endianess: Big endian | ||
|
||
# SW Architecture | ||
The following part contains the specific details of the SensorFusion application. | ||
|
||
## Logical View | ||
|
||
### Application | ||
The application uses the same [State Machine](https://github.com/BlueAndi/RadonUlzer/blob/main/doc/architecture/LINEFOLLOWER.md) as the Line Follower Application. | ||
|
||
### 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/base/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/base/doc/architecture/uml/LogicalView/SensorFusion/HAL_IMU.puml) | ||
|
||
# Abbreviations | ||
|
||
| Abbreviation | Description | | ||
| - | - | | ||
| HAL | Hardware Abstraction Layer | | ||
| IMU | Inertial Measurement Unit | | ||
|
||
# Issues, Ideas And Bugs | ||
If you have further ideas or you found some bugs, great! Create a [issue](https://github.com/BlueAndi/RadonUlzer/issues) or if you are able and willing to fix it by yourself, clone the repository and create a pull request. | ||
|
||
# License | ||
The whole source code is published under the [MIT license](http://choosealicense.com/licenses/mit/). | ||
Consider the different licenses of the used third party libraries too! | ||
|
||
# Contribution | ||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any | ||
additional terms or conditions. | ||
# Radon Ulzer - SENSORFUSION <!-- omit in toc --> | ||
|
||
* [General](#general) | ||
* [SerialMuxProt Channels](#serialmuxprot-channels) | ||
* [Tx channel "LINE\_SENS"](#tx-channel-sensor_data) | ||
* [SW Architecture](#sw-architecture) | ||
* [Logical View](#logical-view) | ||
* [Application](#application) | ||
* [Abbreviations](#abbreviations) | ||
* [Issues, Ideas And Bugs](#issues-ideas-and-bugs) | ||
* [License](#license) | ||
* [Contribution](#contribution) | ||
|
||
# General | ||
|
||
The robot sends sensor data (Odometry data and IMU data) via SerialMuxProt. | ||
|
||
On target the physical communication uses the serial. | ||
|
||
On simulation the physical communication uses a socket connection. | ||
|
||
## SerialMuxProt Channels | ||
|
||
|
||
### Tx channel "SENSOR_DATA" | ||
This channel is used to send raw sensor data used for Sensor Fusion on the ZumoComSystem. | ||
|
||
* The datatypes can be found in SerialMuxChannel.h. | ||
* Order: | ||
* 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) | ||
* Endianess: Big endian | ||
|
||
# SW Architecture | ||
The following part contains the specific details of the SensorFusion application. | ||
|
||
## Logical View | ||
|
||
### Application | ||
The application uses the same [State Machine](https://github.com/BlueAndi/RadonUlzer/blob/main/doc/architecture/LINEFOLLOWER.md) as the Line Follower Application. | ||
|
||
### 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/base/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/base/doc/architecture/uml/LogicalView/SensorFusion/HAL_IMU.puml) | ||
|
||
# Abbreviations | ||
|
||
| Abbreviation | Description | | ||
| - | - | | ||
| HAL | Hardware Abstraction Layer | | ||
| IMU | Inertial Measurement Unit | | ||
|
||
# Issues, Ideas And Bugs | ||
If you have further ideas or you found some bugs, great! Create a [issue](https://github.com/BlueAndi/RadonUlzer/issues) or if you are able and willing to fix it by yourself, clone the repository and create a pull request. | ||
|
||
# License | ||
The whole source code is published under the [MIT license](http://choosealicense.com/licenses/mit/). | ||
Consider the different licenses of the used third party libraries too! | ||
|
||
# Contribution | ||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any | ||
additional terms or conditions. |
236 changes: 118 additions & 118 deletions
236
doc/architecture/uml/LogicalView/SensorFusion/HAL_IMU.puml
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,119 +1,119 @@ | ||
@startuml | ||
|
||
title RadonUlzer - Hardware Abstraction Layer | ||
|
||
package "HAL" as hal { | ||
|
||
package "HAL Interfaces" as halInterfaces { | ||
interface "IIMU" as iIMU { | ||
+ {abstract} init() : bool | ||
+ {abstract} readAccelerometer() : void | ||
+ {abstract} readGyro() : void | ||
+ {abstract} readMagnetometer() : void | ||
+ {abstract} accelerometerDataReady() : bool | ||
+ {abstract} gyroDataReady() : bool | ||
+ {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 : IMUData | ||
- m_gyroValues : IMUData | ||
- m_magnetometerValues : IMUData | ||
} | ||
class "Board" as BoardSim { | ||
- m_imu : IMU | ||
+ getIMU() : IMU& | ||
+ init() : void | ||
} | ||
} | ||
|
||
package "HAL Target" as target { | ||
class "IMU" as ImuTarget { | ||
- 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>> | ||
ImuTarget *- BoardTarget | ||
ImuSim *- BoardSim | ||
|
||
iIMU <|... ImuTarget: <<realize>> | ||
} | ||
package "Webots library" as webotsLib { | ||
class Accelerometer { | ||
+ getValues() : double * | ||
+ enable(int samplingPeriod) : void | ||
} | ||
class Gyro { | ||
+ getValues() : double * | ||
+ enable(int samplingPeriod) : void | ||
} | ||
class Compass { | ||
+ getValues() : double * | ||
+ enable(int samplingPeriod) : void | ||
} | ||
} | ||
|
||
package "Zumo32U4 library" as zumo32u4Lib { | ||
|
||
class Zumo32U4IMU { | ||
- a[3] : vector<int16_t> | ||
- g[3] : vector<int16_t> | ||
- m[3] : vector<int16_t> | ||
+ init() : bool | ||
+ readAcc() : void | ||
+ readGyro() : void | ||
+ readMag() : void | ||
+ accDataReady() : bool | ||
+ gyroDataReady() : bool | ||
+ magDataReady() : bool | ||
} | ||
} | ||
|
||
note bottom of zumo32u4Lib | ||
Provided by Pololu. | ||
https://pololu.github.io/zumo-32u4-arduino-library/index.html | ||
end note | ||
|
||
note bottom of webotsLib | ||
Provided by Cyberbotics. | ||
https://cyberbotics.com/doc/reference/thanks?version=R2023b | ||
end note | ||
|
||
ImuTarget *--> Zumo32U4IMU | ||
|
||
ImuSim *--> Accelerometer | ||
ImuSim *--> Gyro | ||
ImuSim *--> Compass | ||
|
||
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 Encoders | ||
are missing. | ||
end note | ||
|
||
|
||
@startuml | ||
|
||
title RadonUlzer - Hardware Abstraction Layer | ||
|
||
package "HAL" as hal { | ||
|
||
package "HAL Interfaces" as halInterfaces { | ||
interface "IIMU" as iIMU { | ||
+ {abstract} init() : bool | ||
+ {abstract} readAccelerometer() : void | ||
+ {abstract} readGyro() : void | ||
+ {abstract} readMagnetometer() : void | ||
+ {abstract} accelerometerDataReady() : bool | ||
+ {abstract} gyroDataReady() : bool | ||
+ {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 : IMUData | ||
- m_gyroValues : IMUData | ||
- m_magnetometerValues : IMUData | ||
} | ||
class "Board" as BoardSim { | ||
- m_imu : IMU | ||
+ getIMU() : IMU& | ||
+ init() : void | ||
} | ||
} | ||
|
||
package "HAL Target" as target { | ||
class "IMU" as ImuTarget { | ||
- 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>> | ||
ImuTarget *- BoardTarget | ||
ImuSim *- BoardSim | ||
|
||
iIMU <|... ImuTarget: <<realize>> | ||
} | ||
package "Webots library" as webotsLib { | ||
class Accelerometer { | ||
+ getValues() : double * | ||
+ enable(int samplingPeriod) : void | ||
} | ||
class Gyro { | ||
+ getValues() : double * | ||
+ enable(int samplingPeriod) : void | ||
} | ||
class Compass { | ||
+ getValues() : double * | ||
+ enable(int samplingPeriod) : void | ||
} | ||
} | ||
|
||
package "Zumo32U4 library" as zumo32u4Lib { | ||
|
||
class Zumo32U4IMU { | ||
- a[3] : vector<int16_t> | ||
- g[3] : vector<int16_t> | ||
- m[3] : vector<int16_t> | ||
+ init() : bool | ||
+ readAcc() : void | ||
+ readGyro() : void | ||
+ readMag() : void | ||
+ accDataReady() : bool | ||
+ gyroDataReady() : bool | ||
+ magDataReady() : bool | ||
} | ||
} | ||
|
||
note bottom of zumo32u4Lib | ||
Provided by Pololu. | ||
https://pololu.github.io/zumo-32u4-arduino-library/index.html | ||
end note | ||
|
||
note bottom of webotsLib | ||
Provided by Cyberbotics. | ||
https://cyberbotics.com/doc/reference/thanks?version=R2023b | ||
end note | ||
|
||
ImuTarget *--> Zumo32U4IMU | ||
|
||
ImuSim *--> Accelerometer | ||
ImuSim *--> Gyro | ||
ImuSim *--> Compass | ||
|
||
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 Encoders | ||
are missing. | ||
end note | ||
|
||
|
||
@enduml |
Oops, something went wrong.