Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F66235559
OncillaL01.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 9, 04:57
Size
2 KB
Mime Type
text/x-c
Expires
Tue, Jun 11, 04:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18189896
Attached To
R6622 liboncilla
OncillaL01.cpp
View Options
#include "OncillaL01.h"
using namespace std;
namespace rci {
namespace oncilla {
OncillaL0::OncillaL0(const std::string &name) :
ResourceNode(name), Controlled(), PositionControlled() {
}
bool OncillaL0::isConverged() const {
return false;
}
bool OncillaL0::setJointPosition(JointAnglesPtr position) {
// Successfull
this->_lastCommandedPosition = position;
return true;
}
JointAnglesPtr OncillaL0::getLastPositionCommand() const {
// TODO: The second part f this condition shouldn`t be necessary
if (this->_lastCommandedPosition && this->_lastCommandedPosition.get()) {
//std::cout << this->_lastCommandedPosition->print();
return this->_lastCommandedPosition;
}
return JointAnglesPtr();
}
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();
}
OncillaL1::OncillaL1(OncillaSynchronizer &s, const std::string &name) :
ResourceNode(name), Controlled(), Sensing(), PositionControlled(),
PositionSensing(), TorqueControlled(), ImpedanceControlled() {
this->_dimension = 2; // Two encoder values - should always be the same
}
bool OncillaL1::isConverged() const {
throw std::runtime_error("Not yet implemented.");
return false;
}
bool OncillaL1::setJointPosition(JointAnglesPtr position) {
// Successfull
this->_lastCommandedPosition = position;
return true;
}
JointAnglesPtr OncillaL1::getJointPosition() const {
return this->_latestJointPosition;
}
bool OncillaL1::setJointVelocity(JointVelocitiesPtr vel) {
throw std::runtime_error("Not yet implemented.");
}
bool OncillaL1::setJointTorque(JointTorquesPtr torque) {
throw std::runtime_error("Not yet implemented.");
}
bool OncillaL1::setJointImpedance(JointImpedancePtr imped) {
throw std::runtime_error("Not yet implemented.");
}
JointAnglesPtr OncillaL1::getLastPositionCommand() const {
// TODO: The second part f this condition shouldn`t be necessary
if (this->_lastCommandedPosition && this->_lastCommandedPosition.get()) {
//std::cout << this->_lastCommandedPosition->print();
return this->_lastCommandedPosition;
}
// No command set yet. Returning current joint values instead
return this->_latestJointPosition;
}
OncillaL1::~OncillaL1() {
}
std::string OncillaL1::print() const {
ostringstream outstream(ostringstream::out);
outstream.precision(3); // Precision when printing double values
outstream << "<Oncilla Hip>" << endl;
return outstream.str();
}
}
}
Event Timeline
Log In to Comment