matrix-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/matrix-constant-command.h"
14 
15 using namespace std;
16 using namespace dynamicgraph::sot;
17 using namespace dynamicgraph;
18 
20 
21 /* --------------------------------------------------------------------- */
22 /* --- MATRIX ---------------------------------------------------------- */
23 /* --------------------------------------------------------------------- */
24 
25 MatrixConstant::MatrixConstant(const std::string &name)
26  : Entity(name),
27  rows(0),
28  cols(0),
29  SOUT("sotMatrixConstant(" + name + ")::output(matrix)::sout") {
32  //
33  // Commands
34 
35  // Resize
36  std::string docstring;
37  docstring =
38  " \n"
39  " Resize the matrix and set it to zero.\n"
40  " Input\n"
41  " - unsigned int: number of lines.\n"
42  " - unsigned int: number of columns.\n"
43  "\n";
44  addCommand("resize", new command::matrixConstant::Resize(*this, docstring));
45  // set
46  docstring =
47  " \n"
48  " Set value of output signal\n"
49  " \n"
50  " input:\n"
51  " - a matrix\n"
52  " \n";
53  addCommand(
54  "set",
55  new ::dynamicgraph::command::Setter<MatrixConstant, dynamicgraph::Matrix>(
56  *this, &MatrixConstant::setValue, docstring));
57 }
58 
60  SOUT.setConstant(inValue);
61 }
int rows
void signalRegistration(const SignalArray< int > &signals)
virtual void setConstant(const T &t)
void setDependencyType(DependencyType dep)
void setValue(const dynamicgraph::Matrix &inValue)
Eigen::MatrixXd Matrix
SignalTimeDependent< dynamicgraph::Matrix, int > SOUT
int cols
void addCommand(const std::string &name, command::Command *command)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(MatrixConstant, "MatrixConstant")


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