Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
rtc
Stabilizer
testTwoDofController.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <vector>
3
#include "
TwoDofController.h
"
4
#include <boost/assign/std/vector.hpp>
5
#include <boost/assert.hpp>
6
7
#define ABS(x) (((x) < 0) ? (-(x)) : (x))
8
9
int
main
() {
10
double
ke = 400, tc = 0.04, dt = 0.005;
11
TwoDofController
tdc(ke, tc, dt);
12
double
q = 0, dq = 0, tau = 0, tau_d = 10.0;
13
14
double
time = 0,
start
= 0;
15
while
(
true
) {
16
tau = -ke * q;
17
dq = tdc.
update
(tau, tau_d);
18
q += dq;
19
start
= time;
20
if
(
ABS
(tau - tau_d) < 0.01 ){
21
return
0;
22
}
23
std::cout << time <<
" "
<< q <<
" "
<< tau <<
" "
<< tau_d << std::endl;
24
time += dt;
25
}
26
return
0;
27
}
ABS
#define ABS(x)
Definition:
testTwoDofController.cpp:7
TwoDofController
Definition:
TwoDofController.h:32
main
int main()
Definition:
testTwoDofController.cpp:9
TwoDofController.h
Feedback and Feedforward Controller.
TwoDofController::update
double update(double _x, double _xd)
Definition:
TwoDofController.cpp:62
start
png_size_t start
hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51