File tree Expand file tree Collapse file tree 2 files changed +18
-23
lines changed Expand file tree Collapse file tree 2 files changed +18
-23
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,15 @@ code documentation of the dynamicgraph::Tracer class.
23
23
\n\n
24
24
25
25
\section tracerdoc_sample Sample usage
26
- The following code creates a TracerRealTime entity, then sets the tracing buffer
27
- size to 10MB . It then tells the tracer to create files with names of the form:
28
- jl_XXX .dat where XXX is the signal name, and adds a few signals after
29
- clearing the traces;
26
+ The following code creates a TracerRealTime entity and sets the tracing buffer
27
+ size to 80MB . It then tells the tracer to create files with names of the form:
28
+ /tmp/dg_XXX .dat where XXX is the signal name, and call the signal
29
+ after the device has evaluated the control law:
30
30
\code
31
- new TracerRealTime tr
32
- tr.bufferSize 10485760
33
-
34
- tr.open ${TRACE_REPOSITORY} jl_ .dat
35
- OpenHRP.periodicCall addSignal tr.triger
36
- (...)
37
- # --- TRACE ---
38
- tr.clear
39
- tr.add OpenHRP.forceRARM
40
- tr.add dyn.0
41
- tr.add jgain.gain
31
+ robot.tracer = TracerRealTime("com_tracer")
32
+ robot.tracer.setBufferSize(80*(2**20))
33
+ robot.tracer.open('/tmp','dg_','.dat')
34
+ robot.device.after.addSignal('{0}.triger'.format(robot.tracer.name))
42
35
\endcode
43
36
44
37
\section tracerdoc_addi Additional information
Original file line number Diff line number Diff line change @@ -66,6 +66,13 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
66
66
*dynamicgraph::FactoryStorage::getInstance ()->newEntity (" MyEntity" ,
67
67
" my-entity" );
68
68
69
+ std::string rootdir (" /tmp" );
70
+ std::string basename (" my-tracer" );
71
+ std::string suffix (" .dat" );
72
+
73
+ // / Test openfiles
74
+ atracer.openFiles (rootdir, basename, suffix);
75
+
69
76
// / Add trace by name
70
77
atracer.addSignalToTraceByName (" my-entity.out_double" , " output" );
71
78
@@ -80,13 +87,6 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
80
87
81
88
aSignalInt.setConstant (1.5 );
82
89
83
- std::string rootdir (" /tmp" );
84
- std::string basename (" my-tracer" );
85
- std::string suffix (" .dat" );
86
-
87
- // / Test openfiles
88
- atracer.openFiles (rootdir, basename, suffix);
89
-
90
90
atracer.start ();
91
91
92
92
for (int i = 0 ; i < 1000 ; i++) {
@@ -96,6 +96,8 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
96
96
}
97
97
98
98
atracer.stop ();
99
-
99
+ atracer. clearSignalToTrace ();
100
100
atracer.closeFiles ();
101
+
102
+ atracer.record ();
101
103
}
You can’t perform that action at this time.
0 commit comments