Control Libraries 7.4.0
Loading...
Searching...
No Matches
PointAttractor.hpp
1#pragma once
2
3#include "dynamical_systems/IDynamicalSystem.hpp"
4#include "state_representation/parameters/Parameter.hpp"
5
6namespace dynamical_systems {
7
13template<class S>
15public:
20
25 explicit PointAttractor(const std::list<std::shared_ptr<state_representation::ParameterInterface>>& parameters);
26
30 void set_base_frame(const S& base_frame) override;
31
35 [[nodiscard]] S compute_dynamics(const S& state) const override;
36
40 [[nodiscard]] bool is_compatible(const S& state) const override;
41
42private:
46 void validate_and_set_parameter(const std::shared_ptr<state_representation::ParameterInterface>& parameter) override;
47
52 void set_attractor(const S& attractor);
53
58 void set_gain(const std::shared_ptr<state_representation::ParameterInterface>& parameter, unsigned int expected_size);
59
60 std::shared_ptr<state_representation::Parameter<S>> attractor_;
61 std::shared_ptr<state_representation::Parameter<Eigen::MatrixXd>> gain_;
62};
63
64template<class S>
66 const std::list<std::shared_ptr<state_representation::ParameterInterface>>& parameters
67) : PointAttractor<S>() {
68 this->set_parameters(parameters);
69}
70
71}// namespace dynamical_systems
Abstract class for a dynamical system.
Represents a dynamical system to move towards an attractor.
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...
void set_base_frame(const S &base_frame) override
Set the base frame of the dynamical system.
bool is_compatible(const S &state) const override
Check compatibility between a state and the dynamical system.
PointAttractor()
Empty constructor.
void set_parameters(const ParameterInterfaceList &parameters)
Set parameters from a list of parameters.
Systems of equations relating state variables to their derivatives.
Definition Circular.hpp:7