Control Libraries 7.4.0
Loading...
Searching...
No Matches
Ring.hpp
1#pragma once
2
3#include "dynamical_systems/IDynamicalSystem.hpp"
4#include "state_representation/parameters/Parameter.hpp"
5#include "state_representation/space/cartesian/CartesianPose.hpp"
6#include "state_representation/space/cartesian/CartesianState.hpp"
7#include <cmath>
8#include <vector>
9
10namespace dynamical_systems {
11
16class Ring : public IDynamicalSystem<state_representation::CartesianState> {
17public:
21 Ring();
22
27 explicit Ring(const std::list<std::shared_ptr<state_representation::ParameterInterface>>& parameters);
28
32 void set_base_frame(const state_representation::CartesianState& base_frame) override;
33
38 compute_dynamics(const state_representation::CartesianState& state) const override;
39
40private:
41 typedef std::shared_ptr<state_representation::Parameter<double>> ptr_param_double_t;
42
46 void validate_and_set_parameter(const std::shared_ptr<state_representation::ParameterInterface>& parameter) override;
47
52 void set_center(const state_representation::CartesianPose& center);
53
58 void set_rotation_offset(const Eigen::Quaterniond& rotation);
59
64 [[nodiscard]] Eigen::Quaterniond get_rotation_offset() const;
65
66 [[nodiscard]] Eigen::Vector3d calculate_local_linear_velocity(
67 const state_representation::CartesianPose& pose, double& local_field_strength
68 ) const;
69
70 [[nodiscard]] Eigen::Vector3d calculate_local_angular_velocity(
71 const state_representation::CartesianPose& pose, const Eigen::Vector3d& linear_velocity,
72 double local_field_strength
73 ) const;
74
75 std::shared_ptr<state_representation::Parameter<state_representation::CartesianPose>> center_;
76 std::shared_ptr<state_representation::Parameter<state_representation::CartesianPose>>
77 rotation_offset_;
78 ptr_param_double_t radius_;
79 ptr_param_double_t width_;
80 ptr_param_double_t speed_;
81 ptr_param_double_t field_strength_;
82 ptr_param_double_t normal_gain_;
83 ptr_param_double_t angular_gain_;
84};
85}// namespace dynamical_systems
Abstract class for a dynamical system.
Represent a Ring dynamical system limit cycle to move around a radius within a fixed width.
Definition Ring.hpp:16
state_representation::CartesianState compute_dynamics(const state_representation::CartesianState &state) const override
Compute the dynamics of the input state. Internal function, to be redefined based on the type of dyna...
Definition Ring.cpp:205
void set_base_frame(const state_representation::CartesianState &base_frame) override
Set a parameter.
Definition Ring.cpp:71
Ring()
Empty constructor.
Definition Ring.cpp:13
Class to define Cartesian pose in Cartesian space as 3D position and quaternion based orientation.
Class to represent a state in Cartesian space.
Systems of equations relating state variables to their derivatives.
Definition Circular.hpp:7