Page MenuHomec4science

L1L2.h
No OneTemporary

File Metadata

Created
Tue, Jul 9, 21:44
#pragma once
#include <boost/shared_ptr.hpp>
#include <rci/dto/JointAngles.h>
#include <rci/ResourceNode.h>
#include <rci/Controlled.h>
#include <rci/Sensing.h>
namespace rci{
namespace oncilla{
class Synchronizer;
class L1L2;
/**
* Node class, representing the hip node of the quadruped robot.
*
* @todo In case of simulation, this node can also sense the power consumption.
*/
class L1L2: public rci::ResourceNode,
public rci::Controlled,
public rci::Sensing,
public rci::PositionControlled,
public rci::PositionSensing, // Two encoder values
public rci::VelocityControlled,
public rci::TorqueControlled,
public rci::ImpedanceControlled {
public:
typedef boost::shared_ptr<L1L2> Ptr;
const static unsigned int MotorAxisIndex = 0;
const static unsigned int MagneticEncoderIndex = 1;
/**
* Special constructor to also link to webots
*/
L1L2(rci::oncilla::Synchronizer & s,
const std::string & name = "Oncilla Hip");
virtual ~L1L2();
virtual void setControlMode(ControlModePtr controlMode);
bool setJointImpedance(JointImpedancePtr );
bool isConverged() const;
/**
* Print
*/
std::string print() const;
protected :
void unsafeSetCommand(double value);
double unsafeGetCommand() const;
double unsafeGetMotorAxisPosition() const;
double unsafeGetMagneticEncoderPosition() const;
void unsafeUpdateMotorAxisPosition(double value);
void unsafeUpdateMagneticEncoderPosition(double value);
private:
/**
* Reference to OncillaSynchronizer
* @todo This is a dangerous reference which will become invalid as soon as
* OncillaSynchronizer gets deleted outside.
*/
rci::oncilla::Synchronizer & d_synchronizer;
};
typedef L1L2 L1;
typedef L1L2 L2;
}
}

Event Timeline