Skip to content
Snippets Groups Projects
Commit eb5a846f authored by andreadelprete's avatar andreadelprete
Browse files

Make methods of Device virtuals so that they can be overloaded by subclasses

parent f6c550d6
No related branches found
No related tags found
No related merge requests found
......@@ -48,17 +48,17 @@ namespace dynamicgraph {
public:
static const std::string CLASS_NAME;
virtual const std::string& getClassName(void) const {
return CLASS_NAME;
return CLASS_NAME;
}
enum ForceSignalSource
{
FORCE_SIGNAL_RLEG,
FORCE_SIGNAL_LLEG,
FORCE_SIGNAL_RARM,
FORCE_SIGNAL_LARM
FORCE_SIGNAL_RLEG,
FORCE_SIGNAL_LLEG,
FORCE_SIGNAL_RARM,
FORCE_SIGNAL_LARM
};
protected:
ml::Vector state_;
ml::Vector velocity_;
......@@ -69,24 +69,24 @@ namespace dynamicgraph {
PeriodicCall periodicCallBefore_;
PeriodicCall periodicCallAfter_;
public:
/* --- CONSTRUCTION --- */
Device(const std::string& name);
/* --- DESTRUCTION --- */
virtual ~Device();
void setStateSize(const unsigned int& size);
void setState(const ml::Vector& st);
virtual void setStateSize(const unsigned int& size);
virtual void setState(const ml::Vector& st);
void setVelocitySize(const unsigned int& size);
void setVelocity(const ml::Vector & vel);
void setSecondOrderIntegration();
void increment(const double & dt = 5e-2);
virtual void setVelocity(const ml::Vector & vel);
virtual void setSecondOrderIntegration();
virtual void increment(const double & dt = 5e-2);
public: /* --- DISPLAY --- */
virtual void display(std::ostream& os) const;
SOT_CORE_EXPORT friend std::ostream&
operator<<(std::ostream& os,const Device& r) {
r.display(os); return os;
operator<<(std::ostream& os,const Device& r) {
r.display(os); return os;
}
public: /* --- SIGNALS --- */
......@@ -110,11 +110,11 @@ namespace dynamicgraph {
public: /* --- COMMANDS --- */
void commandLine(const std::string&, std::istringstream&,
std::ostream&){}
std::ostream&){}
protected:
/// Compute roll pitch yaw angles of freeflyer joint.
void integrateRollPitchYaw(ml::Vector& state, const ml::Vector& control,
double dt);
double dt);
/// Store Position of free flyer joint
MatrixHomogeneous ffPose_;
/// Compute the new position, from the current control.
......@@ -123,8 +123,8 @@ namespace dynamicgraph {
/// Get freeflyer pose
const MatrixHomogeneous& freeFlyerPose() const;
public:
void setRoot( const ml::Matrix & root );
void setRoot( const MatrixHomogeneous & worldMwaist );
virtual void setRoot( const ml::Matrix & root );
virtual void setRoot( const MatrixHomogeneous & worldMwaist );
private:
// Intermediate variable to avoid dynamic allocation
ml::Vector forceZero6;
......@@ -134,7 +134,3 @@ namespace dynamicgraph {
#endif /* #ifndef SOT_DEVICE_HH */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment