Skip to content

Commit 816020e

Browse files
Use typedef sigtime_t for signal time.
1 parent 4ba0037 commit 816020e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+100
-93
lines changed

include/sot/core/binary-int-to-uint.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class SOTBINARYINTTOUINT_EXPORT BinaryIntToUint : public dynamicgraph::Entity {
5151
BinaryIntToUint(const std::string &name);
5252
virtual ~BinaryIntToUint() {}
5353

54-
virtual unsigned &computeOutput(unsigned &res, int time);
54+
virtual unsigned int &computeOutput(unsigned int &res, sigtime_t time);
5555

5656
virtual void display(std::ostream &os) const;
5757
};

include/sot/core/binary-op.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class BinaryOp : public Entity {
7373
SignalTimeDependent<Tout, sigtime_t> SOUT;
7474

7575
protected:
76-
Tout &computeOperation(Tout &res, int time) {
76+
Tout &computeOperation(Tout &res, sigtime_t time) {
7777
const Tin1 &x1 = SIN1(time);
7878
const Tin2 &x2 = SIN2(time);
7979
op(x1, x2, res);

include/sot/core/clamp-workspace.hh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ class SOTCLAMPWORKSPACE_EXPORT ClampWorkspace : public dynamicgraph::Entity {
6161
ClampWorkspace(const std::string &name);
6262
virtual ~ClampWorkspace(void) {}
6363

64-
void update(int time);
64+
void update(sigtime_t time);
6565

6666
virtual dynamicgraph::Matrix &computeOutput(dynamicgraph::Matrix &res,
67-
int time);
67+
sigtime_t time);
6868
virtual dynamicgraph::Matrix &computeOutputBar(dynamicgraph::Matrix &res,
69-
int time);
70-
virtual MatrixHomogeneous &computeRef(MatrixHomogeneous &res, int time);
69+
sigtime_t time);
70+
virtual MatrixHomogeneous &computeRef(MatrixHomogeneous &res, sigtime_t time);
7171

7272
virtual void display(std::ostream &) const;
7373

7474
private:
75-
int timeUpdate;
75+
sigtime_t timeUpdate;
7676

7777
dynamicgraph::Matrix alpha;
7878
dynamicgraph::Matrix alphabar;

include/sot/core/com-freezer.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SOTCOMFREEZER_EXPORT CoMFreezer : public dynamicgraph::Entity {
5050
private:
5151
dynamicgraph::Vector m_lastCoM;
5252
bool m_previousPGInProcess;
53-
int m_lastStopTime;
53+
sigtime_t m_lastStopTime;
5454

5555
public: /* --- CONSTRUCTION --- */
5656
CoMFreezer(const std::string &name);
@@ -63,7 +63,7 @@ class SOTCOMFREEZER_EXPORT CoMFreezer : public dynamicgraph::Entity {
6363

6464
public: /* --- FUNCTION --- */
6565
dynamicgraph::Vector &computeFreezedCoM(dynamicgraph::Vector &freezedCoM,
66-
const int &time);
66+
const sigtime_t &time);
6767

6868
public: /* --- PARAMS --- */
6969
virtual void display(std::ostream &os) const;

include/sot/core/control-gr.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ControlGR_EXPORT ControlGR : public Entity {
7373

7474
protected:
7575
double &setsize(int dimension);
76-
dynamicgraph::Vector &computeControl(dynamicgraph::Vector &tau, int t);
76+
dynamicgraph::Vector &computeControl(dynamicgraph::Vector &tau, sigtime_t t);
7777
};
7878

7979
} // namespace sot

include/sot/core/control-pd.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ class ControlPD_EXPORT ControlPD : public Entity {
7676
SignalTimeDependent<dynamicgraph::Vector, sigtime_t> velocityErrorSOUT;
7777

7878
protected:
79-
dynamicgraph::Vector &computeControl(dynamicgraph::Vector &tau, int t);
79+
dynamicgraph::Vector &computeControl(dynamicgraph::Vector &tau, sigtime_t t);
8080
dynamicgraph::Vector position_error_;
8181
dynamicgraph::Vector velocity_error_;
8282
dynamicgraph::Vector &getPositionError(dynamicgraph::Vector &position_error,
83-
int t);
83+
sigtime_t t);
8484
dynamicgraph::Vector &getVelocityError(dynamicgraph::Vector &velocity_error,
85-
int t);
85+
sigtime_t t);
8686
};
8787

8888
} // namespace sot

include/sot/core/derivator.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Derivator : public dynamicgraph::Entity {
7373
dynamicgraph::Signal<double, sigtime_t> timestepSIN;
7474

7575
protected:
76-
T &computeDerivation(T &res, int time) {
76+
T &computeDerivation(T &res, sigtime_t time) {
7777
if (initialized) {
7878
res = memory;
7979
res *= -1;
@@ -92,7 +92,7 @@ class Derivator : public dynamicgraph::Entity {
9292
// TODO Derivation of unit quaternion?
9393
template <>
9494
VectorQuaternion &Derivator<VectorQuaternion>::computeDerivation(
95-
VectorQuaternion &res, int time) {
95+
VectorQuaternion &res, sigtime_t time) {
9696
if (initialized) {
9797
res = memory;
9898
res.coeffs() *= -1;

include/sot/core/exp-moving-avg.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class SOT_CORE_DLLAPI ExpMovingAvg : public Entity {
4545
void setAlpha(const double &alpha_);
4646

4747
protected:
48-
dynamicgraph::Vector &update(dynamicgraph::Vector &res, const int &inTime);
48+
dynamicgraph::Vector &update(dynamicgraph::Vector &res,
49+
const sigtime_t &inTime);
4950

5051
dynamicgraph::Vector average;
5152

include/sot/core/fir-filter.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ class FIRFilter : public Entity {
155155
"\n"
156156
" Return:\n"
157157
" - positive int: size\n";
158-
addCommand("getSize", new Getter<FIRFilter, unsigned>(
158+
addCommand("getSize", new Getter<FIRFilter, std::size_t>(
159159
*this, &FIRFilter::getBufferSize, docstring));
160160
}
161161

162162
virtual ~FIRFilter() {}
163163

164-
virtual sigT &compute(sigT &res, int time) {
164+
virtual sigT &compute(sigT &res, sigtime_t time) {
165165
const sigT &in = SIN.access(time);
166166
reset_signal(res, in);
167167
data.push_front(in);

include/sot/core/gain-adaptive.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class SOTGAINADAPTATIVE_EXPORT GainAdaptive : public dynamicgraph::Entity {
120120
dynamicgraph::SignalTimeDependent<double, sigtime_t> gainSOUT;
121121

122122
protected:
123-
double &computeGain(double &res, int t);
123+
double &computeGain(double &res, sigtime_t t);
124124

125125
private:
126126
void addCommands();

0 commit comments

Comments
 (0)