/home/runner/work/kynema/kynema/kynema/src/utilities/controllers/turbine_controller.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/utilities/controllers/turbine_controller.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
turbine_controller.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <string>
5
8
9namespace kynema::util {
10
14public:
17
26 std::string shared_lib_path, std::string controller_function_name,
27 std::string input_file_path, std::string output_file_path, double initial_yaw_angle = 0.0,
28 bool yaw_control_enabled = false
29 );
30
32 void CallController();
33
35 [[nodiscard]] double YawAngleCommand() const { return this->yaw_angle_command_; }
36
37private:
38 std::string input_file_path_; //< Path to the input file
39 std::string output_file_path_; //< Path to the output file
40 std::string shared_lib_path_; //< Path to shared library
41 std::string controller_function_name_; //< Name of the controller function in the shared library
42
43 util::dylib lib_; //< Handle to the shared library
44 std::function<void(float*, int*, const char* const, char* const, char* const)>
45 controller_function_; //< Function pointer to the controller function
46
47 //< Commanded yaw angle (rad) integrated from yaw rate command
48 double yaw_angle_command_{0.0};
49
50 //< Flag to enable yaw control
51 bool yaw_control_enabled_{false};
52};
53
54} // namespace kynema::util
Definition turbine_controller.hpp:13
double YawAngleCommand() const
Get the commanded yaw angle (rad) integrated from yaw rate command.
Definition turbine_controller.hpp:35
ControllerIO io
Pointer to structure mapping swap array -> named fields i.e. ControllerIO.
Definition turbine_controller.hpp:16
void CallController()
Method to call the controller function from the shared library.
Definition turbine_controller.cpp:54
Definition dylib.hpp:62
C++ cross-platform wrapper around dynamic loading of shared libraries.
Definition aerodyn_inflow.hpp:14
Definition controller_io.hpp:11