Control Libraries 7.4.0
Loading...
Searching...
No Matches
IDynamicalSystem.hpp
1#pragma once
2
3#include <list>
4#include <map>
5#include <memory>
6
7#include "state_representation/parameters/ParameterMap.hpp"
8
13namespace dynamical_systems {
14
20template<class S>
22public:
26 IDynamicalSystem() = default;
27
33 [[nodiscard]] virtual bool is_compatible(const S& state) const;
34
40 [[nodiscard]] S evaluate(const S& state) const;
41
46 [[nodiscard]] S get_base_frame() const;
47
52 virtual void set_base_frame(const S& base_frame);
53
54protected:
62 [[nodiscard]] virtual S compute_dynamics(const S& state) const = 0;
63
64private:
65 S base_frame_;
66};
67
68template<class S>
70 return this->base_frame_;
71}
72
73template<class S>
74void IDynamicalSystem<S>::set_base_frame(const S& base_frame) {
75 this->base_frame_ = base_frame;
76}
77
78}// namespace dynamical_systems
Abstract class for a dynamical system.
virtual bool is_compatible(const S &state) const
Check compatibility between a state and the dynamical system.
S evaluate(const S &state) const
Evaluate the value of the dynamical system at a given state.
S get_base_frame() const
Return the base frame of the dynamical system.
IDynamicalSystem()=default
Empty constructor.
virtual S compute_dynamics(const S &state) const =0
Compute the dynamics of the input state. Internal function, to be redefined based on the type of dyna...
virtual void set_base_frame(const S &base_frame)
Set the base frame of the dynamical system.
A wrapper class to contain a map of Parameter pointers by name and provide robust access methods.
Systems of equations relating state variables to their derivatives.
Definition Circular.hpp:7