Skip to content

Commit 1a807b9

Browse files
committed
Add command Sot::getSize
1 parent e36422b commit 1a807b9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/sot/core/sot.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ namespace dynamicgraph {
201201
defineFreeFloatingJoints(const unsigned int& jointIdFirst,
202202
const unsigned int& jointIdLast = -1);
203203
virtual void defineNbDof( const unsigned int& nbDof );
204+
virtual const unsigned int& getNbDof() const { return nbJoints; }
204205

205206
/*! @} */
206207
public: /* --- CONTROL --- */

src/sot/sot.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ Sot( const std::string& name )
110110
new dynamicgraph::command::Setter<Sot, unsigned int>
111111
(*this, &Sot::defineNbDof, docstring));
112112

113+
docstring =" \n"
114+
" getNumberDofs.\n"
115+
" \n"
116+
" Output:\n"
117+
" - a positive integer : number of degrees of freedom of the robot.\n"
118+
" \n";
119+
addCommand("getSize",
120+
new dynamicgraph::command::Getter<Sot, const unsigned int&>
121+
(*this, &Sot::getNbDof, docstring));
122+
113123
docstring =" \n"
114124
" push a task into the stack.\n"
115125
" \n"

0 commit comments

Comments
 (0)