This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| : ' | |
| Put the below lines inside a separate version file: root/cmake/SDLVersions.cmake | |
| set(SDL_VERSION 3.4.0) | |
| set(SDL_IMAGE_VERSION 3.4.0) | |
| set(SDL_TTF_VERSION 3.2.2) | |
| set(SDL_MIXER_VERSION 3.1.2) | |
| Or alternatively hard code them down below if your CMake does not need the versions | |
| ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <functional> | |
| #include <unordered_map> | |
| #include <type_traits> | |
| #include <cstdint> | |
| struct Event { | |
| public: | |
| virtual ~Event() = default; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <array> | |
| #include <cstdint> | |
| #include <iostream> // for debugging only | |
| #include <type_traits> | |
| #include <utility> | |
| #include <vector> | |
| // Luple from: https://github.com/alexpolt/luple | |
| template <typename... TT> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <Servo.h> | |
| #include <string.h> | |
| class ServoMotor { | |
| public: | |
| ServoMotor(int pin, int cw, int stop, int ccw, int delay) | |
| : pin_{ pin }, cw_{ cw }, stop_{ stop }, ccw_{ ccw }, delay_{ delay } {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input = true; | |
| h = 0.01; | |
| data = load('no_input_test.mat').IO_data; | |
| if (input) | |
| data = load('stair_test.mat').IO_data; | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input = true; | |
| h = 0.01; | |
| data = load('no_input_test.mat').IO_data; | |
| if (input) | |
| data = load('stair_test.mat').IO_data; | |
| %data = load('/MATLAB Drive/data/n_04_06_08_stair_45_2.mat').IO_data; | |
| %data = load('/MATLAB Drive/data/0_step_20_2.mat').IO_data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Example usage | |
| eq_angle_deg = 15; % degrees | |
| data = load('/MATLAB Drive/ramp_test.mat').IO_data; | |
| [x_eq, u_eq] = get_eq_conditions(eq_angle_deg, data); | |
| % Output | |
| fprintf('x_eq(1) = %.3f\n',x_eq(1)); | |
| fprintf('x_eq(2) = %.3f\n',x_eq(2)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| N = 4; | |
| A = [5 6 7; 8 9 10; 11 12 13]; | |
| B = [1 2 3]'; | |
| Q = [5 0 0; 0 1 0; 0 0 0.01]; | |
| R = 0.1; | |
| x0 = [1, 2, 3]'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <utility> | |
| #include <type_traits> | |
| namespace luple_ns { | |
| //type list | |
| template<typename... TT> struct type_list { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| h = 0.001; | |
| c = [-10.6561, 0.0018, 0.237, -4.8731e-05, 828.106, 0.0063898, -1.7446, -0.485]; | |
| x_eq = [0.27, 0, 200]; | |
| [Ad, Bd, Cd, Dd] = discrete_matrices(x_eq, c); | |
| Ld = -place(Ad', Cd', [0.9, 0.91, 0.92])' | |
| obsmat = obsv(Ad,Cd); |
NewerOlder