Page MenuHomec4science

OncillaHip.h
No OneTemporary

File Metadata

Created
Thu, May 9, 16:20

OncillaHip.h

#pragma once
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <cca/dto/debug/DebugDTO.h>
#include <rci/nodes/ResourceNode.h>
#include <rci/nodes/Controlled.h>
#include <rci/nodes/Configurable.h>
#include <rci/nodes/Sensing.h>
#include <rci/dto/JointAngles.h>
namespace cca {
namespace rci {
namespace driver {
class OncillaHipSagittal;
typedef boost::shared_ptr<OncillaHipSagittal> OncillaHipSagittalPtr;
/**
* Node class, representing the hip node of the quadruped robot.
*
* @todo In case of simulation, this node can also sense the power consumption.
*/
class OncillaHipSagittal: 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:
/**
* Special constructor to also link to webots
*/
OncillaHipSagittal(std::string name = "Oncilla Hip");
virtual ~OncillaHipSagittal();
/**
* Returns, if controller is converged.
* @return True, if controller is converged after last command.
*/
bool isConverged() const;
/**
* Commanding a joint position.
* @param position Position command
* @return Return, if successfull. (e.g. not exceeding joint limits)
* @todo Check for correct control mode
*/
bool setJointPosition(JointAnglesPtr position);
/**
* Returns current joint position.
* @return Current joint position
*/
virtual JointAnglesPtr getJointPosition() const;
/**
* Commanding a joint velocity.
* @param position Position command
* @return Return, if successfull. (e.g. not exceeding joint limits)
* @todo Check for correct control mode
*/
virtual bool setJointVelocity(cca::rci::JointVelocitiesPtr vel);
/**
* Returns current joint torque.
* @return Current joint torque
*/
virtual bool setJointTorque(JointTorquesPtr torque);
/**
* Returns current joint torque.
* @return Current joint torque
*/
virtual bool setJointImpedance(JointImpedancePtr imped);
/**
* Returns latest position command. Note, that this is the latest valid
* commanded position. If the position command exceeds limits and is
* therefore rejected, it ..
*/
virtual JointAnglesPtr getLastPositionCommand() const;
/**
* Main data-flow process method
* Main data-flow process method. Every time called, when a new data-flow
* item arrives.
* @todo marshalling and calling control methods
*/
void onProcess();
/**
* Print
*/
std::string print() const;
/**
* Shared Pointer Factory
*/
static CCANodePtr create(std::string name = "Oncilla Hip");
};
class OncillaHipTransverse;
typedef boost::shared_ptr<OncillaHipTransverse> OncillaHipTwoPtr;
/**
* Node class, representing the hip node of the quadruped robot.
* @todo In case of simulation, this node can also sense the power consumption.
*/
class OncillaHipTransverse: public rci::ResourceNode,
public rci::Controlled,
public rci::PositionControlled {
public:
/**
* Special constructor to also link to webots
*/
OncillaHipTransverse(std::string name = "Oncilla Hip");
virtual ~OncillaHipTransverse();
/**
* Returns, if controller is converged.
* @return True, if controller is converged after last command.
*/
bool isConverged() const;
/**
* Commanding a joint position.
* @param position Position command
* @return Return, if successfull. (e.g. not exceeding joint limits)
* @todo Check for correct control mode
*/
bool setJointPosition(JointAnglesPtr position);
/**
* Returns latest position command. Note, that this is the latest valid
* commanded position. If the position command exceeds limits and is
* therefore rejected, it ..
*/
virtual JointAnglesPtr getLastPositionCommand() const;
/**
* Main data-flow process method
* Main data-flow process method. Every time called, when a new data-flow
* item arrives.
* @todo marshalling and calling control methods
*/
void onProcess();
/**
* Print
*/
std::string print() const;
/**
* Shared Pointer Factory
*/
static CCANodePtr create(std::string name = "Oncilla Hip");
};
}
}
}

Event Timeline