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
dynamicgraph::tutorial::command::Increment::Increment
Increment(InvertedPendulum &entity, const std::string &docstring)
Definition: command-increment.hh:23
dynamicgraph
dynamicgraph::tutorial::command::Increment::~Increment
virtual ~Increment()
Definition: command-increment.hh:19
dynamicgraph::Entity
boost
dynamicgraph::tutorial::command::Increment::doExecute
virtual Value doExecute()
Definition: command-increment.hh:25
dynamicgraph::tutorial::InvertedPendulum::incr
void incr(double inTimeStep)
Integrate equation of motion over time step given as input.
Definition: inverted-pendulum.cpp:160
dynamicgraph::tutorial::command::Increment
Definition: command-increment.hh:17
dynamicgraph::tutorial::InvertedPendulum
Inverted Pendulum on a cart.
Definition: inverted-pendulum.hh:72


dynamic-graph-tutorial
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Tue Jun 20 2023 02:35:58