Skip to content
Snippets Groups Projects
Commit 2c98e430 authored by Francesco Morsillo's avatar Francesco Morsillo
Browse files

Added explicit set of velocity in device.cpp

parent 3e5164db
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,7 @@ namespace dynamicgraph {
void setStateSize(const unsigned int& size);
void setState(const ml::Vector& st);
void setVelocitySize(const unsigned int& size);
void setVelocity(const ml::Vector & vel);
void setSecondOrderIntegration();
void increment(const double & dt = 5e-2);
......
......@@ -166,6 +166,14 @@ Device( const std::string& n )
new command::Setter<Device, Vector>
(*this, &Device::setState, docstring));
docstring =
"\n"
" Set velocity vector value\n"
"\n";
addCommand("setVelocity",
new command::Setter<Device, Vector>
(*this, &Device::setVelocity, docstring));
void(Device::*setRootPtr)(const ml::Matrix&) = &Device::setRoot;
docstring
= command::docCommandVoid1("Set the root position.",
......@@ -223,6 +231,13 @@ setState( const ml::Vector& st )
motorcontrolSOUT .setConstant( state_ );
}
void Device::
setVelocity( const ml::Vector& vel )
{
velocity_ = vel;
velocitySOUT .setConstant( velocity_ );
}
void Device::
setRoot( const ml::Matrix & root )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment