vector-constant-command.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * Florent Lamiraux
4  *
5  * CNRS/AIST
6  *
7  */
8 
9 #ifndef VECTOR_CONSTANT_COMMAND_H
10 #define VECTOR_CONSTANT_COMMAND_H
11 
14 #include <dynamic-graph/command.h>
15 
16 #include <boost/assign/list_of.hpp>
17 
18 namespace dynamicgraph {
19 namespace sot {
20 namespace command {
21 namespace vectorConstant {
22 using ::dynamicgraph::command::Command;
23 using ::dynamicgraph::command::Value;
24 
25 // Command Resize
26 class Resize : public Command {
27  public:
28  virtual ~Resize() {}
32  Resize(VectorConstant &entity, const std::string &docstring)
33  : Command(entity, boost::assign::list_of(Value::UNSIGNED), docstring) {}
34  virtual Value doExecute() {
35  VectorConstant &vc = static_cast<VectorConstant &>(owner());
36  std::vector<Value> values = getParameterValues();
37  unsigned size = values[0].value();
38  Vector m(Vector::Zero(size));
39  vc.SOUT.setConstant(m);
40 
41  // return void
42  return Value();
43  }
44 }; // class Resize
45 } // namespace vectorConstant
46 } // namespace command
47 } /* namespace sot */
48 } /* namespace dynamicgraph */
49 
50 #endif // VECTOR_CONSTANT_COMMAND_H
Eigen::VectorXd Vector
SignalTimeDependent< dynamicgraph::Vector, int > SOUT
virtual void setConstant(const T &t)
list values
float m
FCL_REAL size() const
const std::vector< Value > & getParameterValues() const
Resize(VectorConstant &entity, const std::string &docstring)


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