tests
traces
test_traces.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2010,
3
* François Bleibel,
4
* Olivier Stasse,
5
*
6
* CNRS/AIST
7
*
8
*/
9
10
#include <
dynamic-graph/linear-algebra.h
>
11
#include <
dynamic-graph/signal-base.h
>
12
#include <
dynamic-graph/signal-time-dependent.h
>
13
#include <dynamic-graph/signal.h>
14
#include <
dynamic-graph/tracer.h
>
15
16
#include <iostream>
17
#include <
sot/core/debug.hh
>
18
19
using namespace
std;
20
using namespace
dynamicgraph
;
21
using namespace
dynamicgraph::sot
;
22
23
double
&
f
(
double
&res,
const
int
&
/*t*/
) {
24
cout <<
"SIGM!"
<< endl;
25
return
res
;
26
}
27
28
int
main
() {
29
Signal<Vector, sigtime_t>
sig1(
"sig1"
);
30
Vector
v1(2);
31
v1.fill(1.1);
32
sig1 = v1;
33
34
Signal<Vector, sigtime_t>
sig2(
"sig2"
);
35
Vector
v2(4);
36
v2.fill(2.);
37
sig2 = v2;
38
39
Signal<Vector, sigtime_t>
sig3(
"sig3"
);
40
Vector
v3(6);
41
v3.fill(3.);
42
sig3 = v3;
43
44
SignalTimeDependent<double, sigtime_t>
sigM(
f
,
sotNOSIGNAL
,
"sigM"
);
45
sigM.
access
(0);
46
47
Tracer
*tracer =
new
Tracer
(
"trace"
);
48
tracer->
addSignalToTrace
(sig1);
49
tracer->
openFiles
(
"/tmp/sot-core"
,
"tr_"
,
".dat"
);
50
51
tracer->
addSignalToTrace
(sig2);
52
53
return
0;
54
}
dynamicgraph::Signal< Vector, sigtime_t >
signal-time-dependent.h
dynamicgraph::SignalTimeDependent::access
const T & access(const Time &t1)
signal-base.h
dynamicgraph
dynamicgraph::Tracer::addSignalToTrace
void addSignalToTrace(const SignalBase< sigtime_t > &sig, const std::string &filename="")
debug.hh
res
res
f
double & f(double &res, const int &)
Definition:
test_traces.cpp:23
tracer.h
main
int main()
Definition:
test_traces.cpp:28
Vector
Eigen::VectorXd Vector
linear-algebra.h
dynamicgraph::SignalTimeDependent< double, sigtime_t >
dynamicgraph::sot
dynamicgraph::Tracer
sotNOSIGNAL
DYNAMIC_GRAPH_DLLAPI SignalArray< sigtime_t > sotNOSIGNAL
dynamicgraph::Tracer::openFiles
void openFiles(const std::string &rootdir, const std::string &basename, const std::string &suffix)
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:32