Skip to content

Commit 6b80132

Browse files
committed
Documentation
Signed-off-by: Nordmann Arne (CR/ADT3) <arne.nordmann@de.bosch.com>
1 parent d62e24c commit 6b80132

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

system_modes/include/system_modes/mode.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ class ModeBase
7171
ModeImpl mode_impl_;
7272
};
7373

74+
/**
75+
* Represents a default system mode.
76+
*
77+
* For default modes of nodes it holds the according parametrization, for
78+
* default modes of systems, it holds the according states and modes of its
79+
* system parts.
80+
*/
7481
class DefaultMode : public ModeBase
7582
{
7683
public:
@@ -87,6 +94,13 @@ class DefaultMode : public ModeBase
8794
const StateAndMode stateAndMode);
8895
};
8996

97+
/**
98+
* Represents a (non-default) system mode.
99+
*
100+
* For default modes of nodes it holds the according parametrization, for
101+
* default modes of systems, it holds the according states and modes of its
102+
* system parts.
103+
*/
90104
class Mode : public ModeBase
91105
{
92106
public:

system_modes/include/system_modes/mode_handling.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ struct ModeRule
4747

4848
using RulesMap = std::map<std::string, ModeRule>;
4949

50+
/**
51+
* Reads and parses the error handling rules from the sytem modes and hierarchy file (SMH file).
52+
* Provides getters to receive all rules that are applicable for a certain system state, usually
53+
* a system deviation.
54+
*/
5055
class ModeHandling
5156
{
5257
public:

system_modes/include/system_modes/mode_inference.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ typedef std::map<std::string, StateAndMode> StatesMap;
3636
typedef std::map<std::string, std::map<std::string, rclcpp::Parameter>> ParametersMap;
3737
typedef std::map<std::string, std::pair<StateAndMode, StateAndMode>> Deviation;
3838

39+
/**
40+
* Reads and parses the sytem modes and hierarchy file (SMH file) and provides
41+
* getters to access the resulting model. Provides setters to inform inference about
42+
* the live system state (update current state and mode targets as well as current
43+
* parametization).
44+
*/
3945
class ModeInference
4046
{
4147
public:
@@ -71,6 +77,11 @@ class ModeInference
7177
* mode transitions.
7278
*/
7379
virtual Deviation infer_transitions();
80+
81+
/**
82+
* Infers deviations of the _target_ system state (state and mode of systems and nodes)
83+
* and their respective _actual_ state.
84+
*/
7485
virtual Deviation get_deviation();
7586

7687
virtual StateAndMode get_target(const std::string & part) const;

system_modes/include/system_modes/mode_monitor.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
namespace system_modes
3535
{
3636

37+
/**
38+
* Based on mode inference and live updates from the system, this class monitors the live
39+
* system state and renders a simple command-line view of the known resp. inferred state
40+
* of all systems and system parts within the SMH file.
41+
*/
3742
class ModeMonitor : public rclcpp::Node
3843
{
3944
public:

0 commit comments

Comments
 (0)