vector-constant.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #include <sot/core/factory.hh>
12 
13 #include "../src/matrix/vector-constant-command.h"
14 
15 using namespace std;
16 using namespace dynamicgraph::sot;
17 using namespace dynamicgraph;
18 
20 
21 /* --------------------------------------------------------------------- */
22 /* --- VECTOR ---------------------------------------------------------- */
23 /* --------------------------------------------------------------------- */
24 VectorConstant::VectorConstant(const std::string &name)
25  : Entity(name),
26  rows(0),
27  SOUT("sotVectorConstant(" + name + ")::output(vector)::sout") {
30 
31  //
32  // Commands
33  //
34  // Resize
35  std::string docstring;
36  docstring =
37  " \n"
38  " Resize the vector and set it to zero.\n"
39  " Input\n"
40  " unsigned size.\n"
41  "\n";
42  addCommand("resize", new command::vectorConstant::Resize(*this, docstring));
43  // set
44  docstring =
45  " \n"
46  " Set value of output signal\n"
47  " \n"
48  " input:\n"
49  " - a vector\n"
50  " \n";
51  addCommand(
52  "set",
53  new ::dynamicgraph::command::Setter<VectorConstant, dynamicgraph::Vector>(
54  *this, &VectorConstant::setValue, docstring));
55 }
56 
58  SOUT.setConstant(inValue);
59 }
dynamicgraph::TimeDependency
factory.hh
dynamicgraph::sot::command::vectorConstant::Resize
Definition: vector-constant-command.h:26
dynamicgraph
rows
int rows
dynamicgraph::Entity
dynamicgraph::sot::VectorConstant
Definition: vector-constant.hh:31
vector-constant.hh
dynamicgraph::Vector
Eigen::VectorXd Vector
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(VectorConstant, "VectorConstant")
dynamicgraph::sot::VectorConstant::SOUT
SignalTimeDependent< dynamicgraph::Vector, sigtime_t > SOUT
Definition: vector-constant.hh:43
dynamicgraph::sot
dynamicgraph::Entity::addCommand
void addCommand(const std::string &name, command::Command *command)
dynamicgraph::Entity::signalRegistration
void signalRegistration(const SignalArray< sigtime_t > &signals)
dynamicgraph::sot::VectorConstant::setValue
void setValue(const dynamicgraph::Vector &inValue)
Set value of vector (and therefore of output signal)
Definition: vector-constant.cpp:57
compile.name
name
Definition: compile.py:23


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:32