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 }
Eigen::VectorXd Vector
int rows
void signalRegistration(const SignalArray< int > &signals)
SignalTimeDependent< dynamicgraph::Vector, int > SOUT
virtual void setConstant(const T &t)
void setDependencyType(DependencyType dep)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(VectorConstant, "VectorConstant")
void setValue(const dynamicgraph::Vector &inValue)
Set value of vector (and therefore of output signal)
void addCommand(const std::string &name, command::Command *command)


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26