command-increment.hh
Go to the documentation of this file.
1 //
2 // Copyright 2010 CNRS
3 //
4 // Author: Florent Lamiraux
5 //
6 
7 #ifndef DYNAMIC_GRAPH_TUTORIAL_COMMAND_INCREMENT_HH
8 #define DYNAMIC_GRAPH_TUTORIAL_COMMAND_INCREMENT_HH
9 
10 #include <boost/assign/list_of.hpp>
11 
12 namespace dynamicgraph {
13 namespace tutorial {
14 namespace command {
15 using ::dynamicgraph::command::Command;
16 using ::dynamicgraph::command::Value;
17 class Increment : public Command {
18  public:
19  virtual ~Increment() {}
23  Increment(InvertedPendulum& entity, const std::string& docstring)
24  : Command(entity, boost::assign::list_of(Value::DOUBLE), docstring) {}
25  virtual Value doExecute() {
26  Entity& entity = owner();
27  InvertedPendulum& ip = static_cast<InvertedPendulum&>(entity);
28  std::vector<Value> values = getParameterValues();
29  double timeStep = values[0].value();
30  ip.incr(timeStep);
31  return Value();
32  }
33 }; // class Increment
34 } // namespace command
35 } // namespace tutorial
36 } // namespace dynamicgraph
37 #endif // DYNAMIC_GRAPH_TUTORIAL_COMMAND_INCREMENT_HH
void incr(double inTimeStep)
Integrate equation of motion over time step given as input.
Increment(InvertedPendulum &entity, const std::string &docstring)


dynamic-graph-tutorial
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:37:04