update READMEs

This commit is contained in:
Robin Müller 2022-09-28 21:39:13 +02:00
parent 39584aa56b
commit 879f7ec4ac
No known key found for this signature in database
GPG Key ID: BE6480244DFE612C
2 changed files with 19 additions and 6 deletions

View File

@ -7,6 +7,15 @@ for people with basic C++ skills who want to learn how the FSFW works and how to
On-Board Software (OBSW) in general. This workshop does not rely on external hardware On-Board Software (OBSW) in general. This workshop does not rely on external hardware
and can be done on a host machine (e.g. laptop). and can be done on a host machine (e.g. laptop).
# Requirements
1. [`git`](https://git-scm.com/) installed
2. [`cmake`](https://cmake.org/) installed as the build system generator
3. C++ compiler installed. On Windows, you can use [MinGW64](https://www.msys2.org/) or
[clang](https://releases.llvm.org/download.html). On Unix, you can use the pre-installed GCC
4. Build system for C/C++ installed. For Windows, it is recommended to use [ninja](https://ninja-build.org/).
On Unix, you can use the pre-installed `make` tool.
# Getting started # Getting started
Start by cloning this repository and updating the submodules to also clone Start by cloning this repository and updating the submodules to also clone
@ -60,7 +69,7 @@ by example and how to intgerate a library without CMake support.
This chapter will introduce the object manager and expand the knowledge of the tasks workshop This chapter will introduce the object manager and expand the knowledge of the tasks workshop
by showing how to conveniently create global addressable objects. It also provides an by showing how to conveniently create global addressable objects. It also provides an
introduction into TMTC handling, as virtually all space systems are remote systems where introduction into TMTC handling, as virtually all space systems are remote systems where
telemetry and telecommands are the pŕimary data interface available to communicate with the satellite. telemetry and telecommands are the primary data interface available to communicate with the satellite.
## Controller workshop ## Controller workshop

View File

@ -100,12 +100,14 @@ pure virtual functions.
```cpp ```cpp
virtual ~<Class>() = default; virtual ~<Class>() = default;
``` ```
3. Add a abstract virtual function `performOperation`. 3. Add a abstract virtual function `performOperation`.
Abstract virtual functions look like this in general Abstract virtual functions look like this in general
```cpp ```cpp
virtual <functionName>(...) = 0; virtual <functionName>(...) = 0;
``` ```
4. Implement you custom interface for `MyExecutableObject` by re-using the exsiting 4. Implement you custom interface for `MyExecutableObject` by re-using the exsiting
`performOperation` function. In general, when implementing `performOperation` function. In general, when implementing
an interface or overriding a virtual function, it is recommended to add the `override` keyword an interface or overriding a virtual function, it is recommended to add the `override` keyword
@ -122,14 +124,15 @@ pure virtual functions.
to inheritance for flexible software designs. The new `MyPeriodicTask` class should to inheritance for flexible software designs. The new `MyPeriodicTask` class should
have a ctor which expects a `MyExecutableObjectIF` by reference and the task frequency in have a ctor which expects a `MyExecutableObjectIF` by reference and the task frequency in
milliseconds as an `uint32_t`. It caches both the executbale object and the task frequency milliseconds as an `uint32_t`. It caches both the executbale object and the task frequency
as private member variables. Also add a `std::thread` member variable. as private member variables.
6. Add a public `start` function and leave it empty for now. 6. Add a public `start` function which returns a `std::thread` and leave it empty for now.
7. Add a private static `executeTask` method which expects `MyPeriodicTask` by reference. 7. Add a private static `executeTask` method which expects `MyPeriodicTask` by reference.
Its implementation is similar to the `executeTask` method of `MyExecutableObject`. Its implementation is similar to the `executeTask` method of `MyExecutableObject`.
Remove the `executeTask` implementation from `MyExecutableObject`. Remove the `executeTask` implementation from `MyExecutableObject`.
8. In the start method, use `std::thread` API with `MyPeriodicTask::executeTask` as the 8. In the start method, use `std::thread` API with `MyPeriodicTask::executeTask` as the
executed function. Pass the task itself by reference similarly to how it was done in task 2. executed function. Pass the task itself by reference similarly to how it was done in task 2.
Cache the created thread into the thread member variable. Return the created thread directly, so callers can use the `join` method to block on thread
completion.
We now have two separate classes where one class only contains application logic and the other We now have two separate classes where one class only contains application logic and the other
one only contains scheduling logic. The `MyPeriodicTask` is also able to schedule arbitrary one only contains scheduling logic. The `MyPeriodicTask` is also able to schedule arbitrary
@ -169,7 +172,8 @@ It also offers a unform API to execute periodic tasks in form of the
[`PeriodicTaskIF`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/PeriodicTaskIF.h). [`PeriodicTaskIF`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/PeriodicTaskIF.h).
These tasks can then be created using the These tasks can then be created using the
[`TaskFactory`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/TaskFactory.h) singleton. [`TaskFactory`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/TaskFactory.h)
singleton.
An arbitrary number of executable objects can then be passed to a periodic task. These objects An arbitrary number of executable objects can then be passed to a periodic task. These objects
are then executed sequentially. This allows a granular design of executable tasks. are then executed sequentially. This allows a granular design of executable tasks.
@ -228,7 +232,7 @@ the execution slot. This is useful for objects where there are multiple processi
but the steps take different amount of times. but the steps take different amount of times.
In examples or other OBSW implementations using the framework, you will often In examples or other OBSW implementations using the framework, you will often
see the distrinction between an `ObjectFactory.cpp` and an `InitMission.cpp`. see the distinction between an `ObjectFactory.cpp` and an `InitMission.cpp`.
In the first file, all global (executable) objects will be created. In the second file, In the first file, all global (executable) objects will be created. In the second file,
all of these objects will be scheduled. Another chapter will introduce the Object Manager all of these objects will be scheduled. Another chapter will introduce the Object Manager
to show what exactly is happening here. to show what exactly is happening here.