generated from wessel/boilerplate
fix(documentation): Fix formatting, move texst to correct location
This commit is contained in:
103
README.md
103
README.md
@@ -19,109 +19,12 @@ Assignments made for the first semester of ROS2
|
||||
|
||||
## System Architecture
|
||||
|
||||
The TI Minor Grade Generator is a ROS2-based distributed system for managing student exam results and calculating final grades. The system follows a microservices architecture with clear separation of concerns.
|
||||
|
||||
### Overview
|
||||
|
||||
The system consists of multiple ROS2 nodes that communicate through topics and services to process exam data, calculate grades, and store the results in a database.
|
||||
|
||||
### Components
|
||||
|
||||
#### Core Nodes
|
||||
|
||||
1. **ExamResultGenerator** (`assignments::one::exam_resutl_generator`)
|
||||
- Publishes random exam results for students and courses
|
||||
- Simulates exam result generation for testing and demonstration
|
||||
- ([Full documentation](doc/nodes/ExamResultGenerator.md))
|
||||
|
||||
2. **FinalGradeDeterminator** (`assignments::one::final_grade_determinator`)
|
||||
- Collect grades from ExamResultGenerator
|
||||
- Send results to the GradeCalculator
|
||||
- Put resulting grade in the Database
|
||||
- ([Full documentation](doc/nodes/FinalGradeDeterminator.md))
|
||||
|
||||
3. **GradeCalculator** (`assignments::one::grade_calculator`)
|
||||
- Provides ROS2 service for calculating student exam grades
|
||||
- Ensures grade results are within valid bounds (10-100)
|
||||
- ([Full documentation](doc/nodes/GradeCalculator.md))
|
||||
|
||||
#### Database Management
|
||||
|
||||
- **DatabaseManager**: Handles all database operations including storing final course results
|
||||
- ([Full documentation](doc/DatabaseManager.md))
|
||||
|
||||
#### Configuration Management
|
||||
|
||||
- **ConfigManager**: Loads and validates system configuration from TOML files
|
||||
- Provides runtime access to configuration parameters for all nodes
|
||||
- Ensures consistent environment setup and error handling for misconfigurations
|
||||
- ([Full documentation](doc/ConfigManager.md))
|
||||
|
||||
#### Message Interfaces
|
||||
|
||||
- **Exam Messages** (`g2_2025_interfaces::msg::Exam`): Contains student name, course name, result, and timestamp
|
||||
- **Student Messages** (`g2_2025_interfaces::msg::Student`): Contains student and course information with timestamp
|
||||
- **Grade Calculation Service** (`g2_2025_interfaces::srv::Exams`): Service interface for grade calculation requests
|
||||
|
||||
### Workflow
|
||||
|
||||
1. **Exam Result Collection**: Exam results are published to the `exam_results` topic
|
||||
2. **Result Aggregation**: FinalGradeDeterminator collects results until the configured threshold is met
|
||||
3. **Grade Calculation**: When enough results are available, a service call is made to GradeCalculator
|
||||
4. **Result Processing**: Calculated grades are published and stored in the database
|
||||
5. **Student Management**: Final student information is published to `student_course_management` topic as this stops the random generation of grades
|
||||
6. **Retake scheduler**: Schedule an exam retake for the grades below 55 by resending information to `student_course_management` as this will re-enable grade generation
|
||||
7. **Retake grade determination**: repeat steps 1 through 6 using the `retake_grade_determinator` node instead of `final_grade_determinator` until every student hase a passing grade
|
||||
|
||||
### Configuration
|
||||
|
||||
The system uses TOML configuration files for environment-specific settings:
|
||||
- Database connection parameters
|
||||
- ROS2 node configurations
|
||||
- Grade collection thresholds
|
||||
For the complete system architecture see [architecture.md](doc/architecture/architecture.md) located in the `doc/architecture` folder
|
||||
|
||||
### Testing
|
||||
|
||||
Unit tests are implemented using Google Test framework:
|
||||
- Mock services and database managers for isolated testing
|
||||
- Parameterized tests for various grade calculation scenarios
|
||||
- Documentation on the tests are located in the full documentation of the nodes themselves
|
||||
The testing documentation can be found in the [doc/tests](doc/tests/) folder for each node
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- ROS2 Jazzy or newer installed ([ROS2 Installation Guide](https://docs.ros.org/en/jazzy/Installation.html))
|
||||
- CMake (version 3.8+)
|
||||
- Python 3.8+
|
||||
- libtomlplusplus-dev
|
||||
- libpqxx-dev
|
||||
- Colcon build tool
|
||||
- Docker compose
|
||||
|
||||
### Clone the Repository
|
||||
|
||||
```bash
|
||||
git clone https://git.wessel.gg/inholland/ros2-assignments.git
|
||||
cd ros2-assignments
|
||||
```
|
||||
|
||||
### Build the Workspace
|
||||
|
||||
```bash
|
||||
colcon build
|
||||
```
|
||||
Any parameters can be changed before building by editing the `grade_calculator.launch.xml` in the launch folder
|
||||
|
||||
### Source the Workspace
|
||||
|
||||
```bash
|
||||
source install/setup.bash
|
||||
```
|
||||
|
||||
### Run the System
|
||||
|
||||
```bash
|
||||
sudo docker-compose up
|
||||
ros2 launch g2_2025_grade_calculator_pkg grade_calculator.launch.xml
|
||||
```
|
||||
For installation instructions see [Installation.md](doc/installation/installation.md) located in the `doc/installation` folder
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
## Project Overview
|
||||
|
||||
The TI Minor Grade Generator is a distributed ROS2-based system designed to manage student exam results and calculate final course grades. The system follows microservices architecture principles with clear separation of concerns and robust data management.
|
||||
Giving marks to students cost a lot of time and pain. For this a automatic solution is needed.
|
||||
Therefore the overall Software architect (Tilmann K.) has designed a solution for the ROS2 architecture.
|
||||
|
||||
## System Architecture
|
||||
|
||||
@@ -14,9 +15,8 @@ The system consists of multiple ROS2 nodes that communicate through standardized
|
||||
|
||||
- **Microservices Architecture**: Each component has a single responsibility
|
||||
- **Asynchronous Communication**: Uses ROS2 topics and services for loose coupling
|
||||
- **Data Persistence**: Centralized database management for reliable storage
|
||||
- **Configurable Parameters**: TOML-based configuration for environment flexibility
|
||||
- **Comprehensive Testing**: Unit and integration tests ensure reliability
|
||||
- **Data Persistence**: Centralized database management for datastorage
|
||||
- **Comprehensive Testing**: Unit tests ensure code reliability
|
||||
|
||||
## System Components
|
||||
|
||||
@@ -145,3 +145,7 @@ max_grade = 100
|
||||
level = "INFO"
|
||||
output_file = "grade_system.log"
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
The testing documentation can be found in the [doc/tests](/doc/tests/) folder for each node
|
||||
|
||||
@@ -88,20 +88,23 @@ string course_name
|
||||
|
||||
#### Result
|
||||
```
|
||||
# Empty result section - completion indicates success
|
||||
float32 result
|
||||
```
|
||||
|
||||
#### Feedback
|
||||
```
|
||||
float32 result
|
||||
string status
|
||||
```
|
||||
|
||||
**Goal Fields**:
|
||||
- `student_name`: Student for which a retake is requested
|
||||
- `course_name`: Course for which a retake is requested
|
||||
|
||||
**Feedback Fields**:
|
||||
- `result`: Progress indicator or intermediate result (float value)
|
||||
**Result Field**
|
||||
- `result`: Progress indicator or intermediate result (float value) (*Not Implemented*)
|
||||
|
||||
**Feedback Field**:
|
||||
- `status`: Status indicator (*Not Implemented*)
|
||||
|
||||
**Usage**: Used by RetakeScheduler node to handle long-running retake management operations with progress feedback.
|
||||
|
||||
@@ -135,7 +138,7 @@ float32 result
|
||||
**Publishers**:
|
||||
- **Topic**: `student_course_management`
|
||||
- **Message Type**: `g2_2025_interfaces::msg::Student`
|
||||
- **Purpose**: Communicate end of enrollment or re-enrolment
|
||||
- **Purpose**: Communicate end of enrollment when grade has been calculated
|
||||
|
||||
### GradeCalculator Node
|
||||
|
||||
@@ -164,7 +167,3 @@ float32 result
|
||||
- **Topic**: `retake_results`
|
||||
- **Message Type**: `g2_2025_interfaces::msg::Exam`
|
||||
- **Purpose**: Processes completed retake exam results
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [System Architecture](../Orig.md): Overall system design and communication patterns
|
||||
|
||||
@@ -40,4 +40,3 @@ ExamResultGenerator()
|
||||
**`void add_student_course_combination(const StudentCourse& sc)`**
|
||||
- Enrolls student into course via database
|
||||
- Adds combination to processing queue
|
||||
|
||||
|
||||
@@ -32,11 +32,8 @@ FinalGradeDeterminator()
|
||||
- Sends async request with collected exam grades for the student-course combination
|
||||
- Uses callback to handle service response
|
||||
|
||||
|
||||
**`void grade_calculator_response(rclcpp::Client<g2_2025_interfaces::srv::Exams>::SharedFuture future, StudentCourse studentCourseCombo)`**
|
||||
- Verifies database connection
|
||||
- Publishes final student message to ROS2 topic
|
||||
- Logs final grade information
|
||||
- Stores final course result in database
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
## Unit Tests
|
||||
|
||||
Unit tests for `DatabaseManager` are implemented in `src/g2_2025_grade_calculator_pkg/test/DatabaseManager.test.cpp` using Google Test and ROS2 test utilities. The tests are designed to work reliably whether a database connection is available or not, focusing on error handling and method behavior validation.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
## Unit Tests
|
||||
|
||||
Unit tests for `ExamResultGenerator` are implemented in `src/g2_2025_grade_calculator_pkg/test/ExamResultGenerator.test.cpp` using Google Test and ROS2 test utilities. The tests use a test subscriber node to capture published messages and validate node behavior.
|
||||
|
||||
Reference in New Issue
Block a user