Skip to content

Commit afa50c1

Browse files
Olivier StasseOlivier Stasse
authored andcommitted
Merge pull request #33 from andreadelprete/master
Make methods of Device virtual (second attempt)
2 parents f6c550d + 1cbd53b commit afa50c1

File tree

2 files changed

+114
-114
lines changed

2 files changed

+114
-114
lines changed

include/sot/core/device.hh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ namespace dynamicgraph {
4343
/* --------------------------------------------------------------------- */
4444

4545
class SOT_CORE_EXPORT Device
46-
:public Entity
46+
:public Entity
4747
{
4848
public:
4949
static const std::string CLASS_NAME;
5050
virtual const std::string& getClassName(void) const {
51-
return CLASS_NAME;
51+
return CLASS_NAME;
5252
}
5353

5454
enum ForceSignalSource
5555
{
56-
FORCE_SIGNAL_RLEG,
57-
FORCE_SIGNAL_LLEG,
58-
FORCE_SIGNAL_RARM,
59-
FORCE_SIGNAL_LARM
56+
FORCE_SIGNAL_RLEG,
57+
FORCE_SIGNAL_LLEG,
58+
FORCE_SIGNAL_RARM,
59+
FORCE_SIGNAL_LARM
6060
};
6161

6262
protected:
@@ -75,18 +75,18 @@ namespace dynamicgraph {
7575
/* --- DESTRUCTION --- */
7676
virtual ~Device();
7777

78-
void setStateSize(const unsigned int& size);
79-
void setState(const ml::Vector& st);
78+
virtual void setStateSize(const unsigned int& size);
79+
virtual void setState(const ml::Vector& st);
8080
void setVelocitySize(const unsigned int& size);
81-
void setVelocity(const ml::Vector & vel);
82-
void setSecondOrderIntegration();
83-
void increment(const double & dt = 5e-2);
81+
virtual void setVelocity(const ml::Vector & vel);
82+
virtual void setSecondOrderIntegration();
83+
virtual void increment(const double & dt = 5e-2);
8484

8585
public: /* --- DISPLAY --- */
8686
virtual void display(std::ostream& os) const;
8787
SOT_CORE_EXPORT friend std::ostream&
88-
operator<<(std::ostream& os,const Device& r) {
89-
r.display(os); return os;
88+
operator<<(std::ostream& os,const Device& r) {
89+
r.display(os); return os;
9090
}
9191

9292
public: /* --- SIGNALS --- */
@@ -110,11 +110,11 @@ namespace dynamicgraph {
110110

111111
public: /* --- COMMANDS --- */
112112
void commandLine(const std::string&, std::istringstream&,
113-
std::ostream&){}
113+
std::ostream&){}
114114
protected:
115115
/// Compute roll pitch yaw angles of freeflyer joint.
116116
void integrateRollPitchYaw(ml::Vector& state, const ml::Vector& control,
117-
double dt);
117+
double dt);
118118
/// Store Position of free flyer joint
119119
MatrixHomogeneous ffPose_;
120120
/// Compute the new position, from the current control.
@@ -123,8 +123,8 @@ namespace dynamicgraph {
123123
/// Get freeflyer pose
124124
const MatrixHomogeneous& freeFlyerPose() const;
125125
public:
126-
void setRoot( const ml::Matrix & root );
127-
void setRoot( const MatrixHomogeneous & worldMwaist );
126+
virtual void setRoot( const ml::Matrix & root );
127+
virtual void setRoot( const MatrixHomogeneous & worldMwaist );
128128
private:
129129
// Intermediate variable to avoid dynamic allocation
130130
ml::Vector forceZero6;

0 commit comments

Comments
 (0)