Page MenuHomec4science

OncillaL0.cpp
No OneTemporary

File Metadata

Created
Tue, May 7, 17:09

OncillaL0.cpp

#include "OncillaL0.h"
using namespace std;
namespace rci {
namespace oncilla {
OncillaL0::OncillaL0(const std::string &name)
: ResourceNode(name)
, Controlled()
, PositionControlled() {
// \todo add default value as a setting
_controlMode = modeJointPositionControl;
_lastCommandedPosition = JointAngles::create(1,0.0);
}
bool OncillaL0::isConverged() const {
return false;
}
void OncillaL0::unsafeSetCommand(double value){
this->_lastCommandedPosition->setValue(value);
}
double OncillaL0::unsafeGetCommand() const{
return this->_lastCommandedPosition->asDouble(0,false);
}
bool OncillaL0::setJointPosition(JointAnglesPtr position) {
// Successfull
this->_lastCommandedPosition = position;
return true;
}
JointAnglesPtr OncillaL0::getLastPositionCommand() const {
if (this->_lastCommandedPosition) {
return this->_lastCommandedPosition;
}
throw runtime_error("No position command received yet.");
}
OncillaL0::~OncillaL0() {
}
std::string OncillaL0::print() const {
ostringstream outstream(ostringstream::out);
outstream.precision(3); // Precision when printing double values
outstream << "<Oncilla Hip>" << endl;
return outstream.str();
}
}
}

Event Timeline