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  " - std::size_t: number of lines.\n"
42  " - std::size_t: 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 }
dynamicgraph::sot::MatrixConstant::setValue
void setValue(const dynamicgraph::Matrix &inValue)
Definition: matrix-constant.cpp:59
dynamicgraph::TimeDependency
matrix-constant.hh
dynamicgraph::sot::command::matrixConstant::Resize
Definition: matrix-constant-command.h:26
factory.hh
dynamicgraph
rows
int rows
dynamicgraph::Entity
dynamicgraph::Matrix
Eigen::MatrixXd Matrix
dynamicgraph::sot::MatrixConstant
Definition: matrix-constant.hh:28
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(MatrixConstant, "MatrixConstant")
dynamicgraph::sot
cols
int cols
dynamicgraph::Entity::addCommand
void addCommand(const std::string &name, command::Command *command)
dynamicgraph::sot::MatrixConstant::SOUT
SignalTimeDependent< dynamicgraph::Matrix, sigtime_t > SOUT
Definition: matrix-constant.hh:45
dynamicgraph::Entity::signalRegistration
void signalRegistration(const SignalArray< sigtime_t > &signals)
compile.name
name
Definition: compile.py:23


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