Commit 77bd7357 authored by Olivier Stasse's avatar Olivier Stasse

Improve doc.

Fix debug-tracer.cpp
parent 7002bb1a
Pipeline #6400 passed with stage
in 6 minutes and 41 seconds
......@@ -23,22 +23,15 @@ code documentation of the dynamicgraph::Tracer class.
\n\n
\section tracerdoc_sample Sample usage
The following code creates a TracerRealTime entity, then sets the tracing buffer
size to 10MB. It then tells the tracer to create files with names of the form:
jl_XXX.dat where XXX is the signal name, and adds a few signals after
clearing the traces;
The following code creates a TracerRealTime entity and sets the tracing buffer
size to 80MB. It then tells the tracer to create files with names of the form:
/tmp/dg_XXX.dat where XXX is the signal name, and call the signal
after the device has evaluated the control law:
\code
new TracerRealTime tr
tr.bufferSize 10485760
tr.open ${TRACE_REPOSITORY} jl_ .dat
OpenHRP.periodicCall addSignal tr.triger
(...)
# --- TRACE ---
tr.clear
tr.add OpenHRP.forceRARM
tr.add dyn.0
tr.add jgain.gain
robot.tracer = TracerRealTime("com_tracer")
robot.tracer.setBufferSize(80*(2**20))
robot.tracer.open('/tmp','dg_','.dat')
robot.device.after.addSignal('{0}.triger'.format(robot.tracer.name))
\endcode
\section tracerdoc_addi Additional information
......
......@@ -66,6 +66,13 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
*dynamicgraph::FactoryStorage::getInstance()->newEntity("MyEntity",
"my-entity");
std::string rootdir("/tmp");
std::string basename("my-tracer");
std::string suffix(".dat");
/// Test openfiles
atracer.openFiles(rootdir, basename, suffix);
/// Add trace by name
atracer.addSignalToTraceByName("my-entity.out_double", "output");
......@@ -80,13 +87,6 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
aSignalInt.setConstant(1.5);
std::string rootdir("/tmp");
std::string basename("my-tracer");
std::string suffix(".dat");
/// Test openfiles
atracer.openFiles(rootdir, basename, suffix);
atracer.start();
for (int i = 0; i < 1000; i++) {
......@@ -96,6 +96,8 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
}
atracer.stop();
atracer.clearSignalToTrace();
atracer.closeFiles();
atracer.record();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment