Skip to content

Commit ae2e344

Browse files
olivier-stasseOlivier Stasse
authored andcommitted
[tools] Add timeStep to device
TimeStep should be provided by device
1 parent 0a4573e commit ae2e344

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/tools/device.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ Device( const std::string& n )
211211
));
212212

213213
addCommand("getTimeStep",
214-
makeDirectGetter (*this, &this->timestep_,
215-
docDirectGetter ("Time step", "double")));
214+
command::makeDirectGetter (*this, &this->timestep_,
215+
command::docDirectGetter ("Time step", "double")));
216+
216217
// Handle commands and signals called in a synchronous way.
217218
periodicCallBefore_.addSpecificCommands(*this, commandMap, "before.");
218219
periodicCallAfter_.addSpecificCommands(*this, commandMap, "after.");

src/tools/robot-simu.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ namespace dynamicgraph {
4141
command::makeCommandVoid1((Device&)*this,
4242
&Device::increment, docstring));
4343

44+
/* Set Time step. */
45+
docstring =
46+
"\n"
47+
" Set the time step provided\n"
48+
"\n"
49+
" take one floating point number as input\n"
50+
"\n";
51+
addCommand("setTimeStep",
52+
makeDirectSetter (*this, &this->timestep_,
53+
docstring));
54+
55+
4456
}
4557
} // namespace sot
4658
} // namespace dynamicgraph

0 commit comments

Comments
 (0)