Page MenuHomec4science

L1L2.cpp
No OneTemporary

File Metadata

Created
Wed, May 1, 19:41

L1L2.cpp

#include "L1L2.h"
#include <liboncilla/exceptions/NotImplementedError.h>
using namespace std;
namespace rci{
namespace oncilla{
L1L2::L1L2(Synchronizer &s, const std::string &name)
: ResourceNode(name)
, Controlled()
, Sensing()
, PositionControlled()
, PositionSensing()
, TorqueControlled()
, ImpedanceControlled()
, synchronizer(s) {
/// \todo add default value as setting
this->_controlMode = modeJointPositionControl;
this->_lastCommandedPosition = JointAngles::create(1,0.0);
this->_latestJointPosition = JointAngles::create(2,0.0);
}
L1L2::~L1L2() {
}
std::string L1L2::print() const {
ostringstream outstream(ostringstream::out);
outstream.precision(3); // Precision when printing double values
outstream << "<Oncilla Hip>" << endl;
return outstream.str();
}
bool L1L2::isConverged() const{
throw NotImplementedError("liboncilla","isConverged","L1L2");
}
void L1L2::unsafeSetCommand(double value){
this->_lastCommandedPosition->setValue(0,value);
}
double L1L2::unsafeGetCommand() const{
return this->_lastCommandedPosition->asDouble(0);
}
double L1L2::unsafeGetMotorAxisPosition() const{
return this->_latestJointPosition->asDouble(MotorAxisIndex);
}
double L1L2::unsafeGetMagneticEncoderPosition() const{
return this->_latestJointPosition->asDouble(MagneticEncoderIndex);
}
void L1L2::unsafeUpdateMotorAxisPosition(double value){
this->_latestJointPosition->setValue(MotorAxisIndex,value);
}
void L1L2::unsafeUpdateMagneticEncoderPosition(double value){
this->_latestJointPosition->setValue(MagneticEncoderIndex,value);
}
}
}

Event Timeline