Control Libraries
7.4.0
Loading...
Searching...
No Matches
source
dynamical_systems
include
dynamical_systems
DefaultDynamicalSystem.hpp
1
#pragma once
2
3
#include "dynamical_systems/IDynamicalSystem.hpp"
4
#include "state_representation/exceptions/InvalidParameterException.hpp"
5
6
namespace
dynamical_systems
{
7
13
template
<
class
S>
14
class
DefaultDynamicalSystem
:
public
IDynamicalSystem
<S> {
15
public
:
19
[[nodiscard]] S
compute_dynamics
(
const
S& state)
const override
;
20
private
:
24
void
validate_and_set_parameter(
const
std::shared_ptr<state_representation::ParameterInterface>& parameter)
override
;
25
};
26
27
template
<
class
S>
28
void
DefaultDynamicalSystem<S>::validate_and_set_parameter
(
29
const
std::shared_ptr<state_representation::ParameterInterface>&
30
) {
31
throw
state_representation::exceptions::InvalidParameterException
(
"No parameter to be set on this type of DS."
);
32
}
33
34
template
<
class
S>
35
S
DefaultDynamicalSystem<S>::compute_dynamics
(
const
S&)
const
{
36
return
S();
37
}
38
}
// namespace dynamical_systems
dynamical_systems::DefaultDynamicalSystem
A default dynamical system that just returns an empty state.
Definition
DefaultDynamicalSystem.hpp:14
dynamical_systems::DefaultDynamicalSystem::compute_dynamics
S compute_dynamics(const S &state) const override
Compute the dynamics of the input state. Internal function, to be redefined based on the type of dyna...
Definition
DefaultDynamicalSystem.hpp:35
dynamical_systems::IDynamicalSystem
Abstract class for a dynamical system.
Definition
IDynamicalSystem.hpp:21
state_representation::exceptions::InvalidParameterException
Definition
InvalidParameterException.hpp:7
dynamical_systems
Systems of equations relating state variables to their derivatives.
Definition
Circular.hpp:7
Generated by
1.9.8