Skip to content

Commit d94aaee

Browse files
committed
Merge branch 'cpp11' into release/4.11.0
2 parents b34ea9c + c90194d commit d94aaee

File tree

85 files changed

+1655
-1469
lines changed

Some content is hidden

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

85 files changed

+1655
-1469
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ IF(BUILD_PYTHON_INTERFACE)
4646
STRING(REGEX REPLACE "-" "_" PYTHON_DIR ${CUSTOM_HEADER_DIR})
4747
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED
4848
PKG_CONFIG_REQUIRES dynamic-graph-python)
49-
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
49+
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED PKG_CONFIG_REQUIRES dynamic-graph-python)
5050
ENDIF(BUILD_PYTHON_INTERFACE)
5151

5252
SEARCH_FOR_BOOST()

doc/sphinx/conf.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import sys
1818
# add these directories to sys.path here. If the directory is relative to the
1919
# documentation root, use os.path.abspath to make it absolute, like shown here.
2020
sys.path = [os.path.abspath('@CMAKE_INSTALL_PREFIX@/@PYTHON_SITELIB@')] + sys.path
21-
sys.path = [os.path.abspath('@CMAKE_BINARY_DIR@/src')] + sys.path
2221
sys.path = [os.path.abspath('@CMAKE_SOURCE_DIR@/src')] + sys.path
22+
sys.path = [os.path.abspath('@CMAKE_BINARY_DIR@/src')] + sys.path
2323

2424
# -- General configuration -----------------------------------------------------
2525

doc/sphinx/index.rst.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ Entities
4646
.. autoclass:: dynamic_graph.sot.core.task.Task
4747
:members:
4848

49-
.. autoclass:: dynamic_graph.sot.core.constraint.Constraint
50-
:members:
51-
5249
.. autoclass:: dynamic_graph.sot.core.gain_adaptive.GainAdaptive
5350
:members:
5451

include/sot/core/device.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ public:
9797
void setTorqueBounds(const Vector &lower, const Vector &upper);
9898
/// \}
9999

100+
PeriodicCall& periodicCallBefore() { return periodicCallBefore_; }
101+
PeriodicCall& periodicCallAfter() { return periodicCallAfter_; }
102+
100103
public: /* --- DISPLAY --- */
101104
virtual void display(std::ostream &os) const;
102105
virtual void cmdDisplay();

include/sot/core/double-constant.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ namespace dynamicgraph {
1717
namespace sot {
1818

1919
class DoubleConstant : public Entity {
20+
public:
2021
static const std::string CLASS_NAME;
2122
virtual const std::string &getClassName(void) const { return CLASS_NAME; }
2223

23-
public:
2424
DoubleConstant(const std::string &name);
2525

2626
virtual ~DoubleConstant(void) {}

include/sot/core/flags.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <vector>
2020

2121
/* SOT */
22+
#include <dynamic-graph/signal-caster.h>
2223
#include "sot/core/api.hh"
2324

2425
/* --------------------------------------------------------------------- */
@@ -81,6 +82,8 @@ SOT_CORE_EXPORT extern const Flags FLAG_LINE_7;
8182
SOT_CORE_EXPORT extern const Flags FLAG_LINE_8;
8283

8384
} // namespace sot
85+
86+
template <> struct signal_io<sot::Flags> : signal_io_unimplemented<sot::Flags> {};
8487
} // namespace dynamicgraph
8588

8689
#endif /* #ifndef __SOT_FLAGS_H */

include/sot/core/integrator-abstract.hh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public:
6666
"pushDenomCoef",
6767
makeCommandVoid1(
6868
*this, &IntegratorAbstract::pushDenomCoef,
69-
docCommandVoid1("Push a new denomicator coefficient", typeName)));
69+
docCommandVoid1("Push a new denominator coefficient", typeName)));
7070

7171
addCommand(
7272
"popNumCoef",
@@ -75,7 +75,7 @@ public:
7575
addCommand(
7676
"popDenomCoef",
7777
makeCommandVoid0(*this, &IntegratorAbstract::popDenomCoef,
78-
docCommandVoid0("Pop a new denomicator coefficient")));
78+
docCommandVoid0("Pop a new denominator coefficient")));
7979
}
8080

8181
virtual ~IntegratorAbstract() {}
@@ -90,11 +90,33 @@ public:
9090
void popNumCoef() { numerator.pop_back(); }
9191
void popDenomCoef() { denominator.pop_back(); }
9292

93+
const std::vector<coefT>& numCoeffs() const { return numerator; }
94+
void numCoeffs(const std::vector<coefT>& coeffs) { numerator = coeffs; }
95+
96+
const std::vector<coefT>& denomCoeffs() const { return denominator; }
97+
void denomCoeffs(const std::vector<coefT>& coeffs) { denominator = coeffs; }
98+
9399
public:
94100
dynamicgraph::SignalPtr<sigT, int> SIN;
95101

96102
dynamicgraph::SignalTimeDependent<sigT, int> SOUT;
97103

104+
virtual void display(std::ostream &os) const
105+
{
106+
os << this->getClassName() << ": " << getName() << '\n'
107+
<< " ";
108+
if (numerator.empty() || denominator.empty()) {
109+
os << "ill-formed.";
110+
return;
111+
}
112+
os << numerator[0];
113+
for (std::size_t i = 1; i < numerator.size(); ++i)
114+
os << " + " << numerator[i] << " s^" << i;
115+
os << "\n " << denominator[0];
116+
for (std::size_t i = 1; i < denominator.size(); ++i)
117+
os << " + " << denominator[i] << " s^" << i;
118+
}
119+
98120
protected:
99121
std::vector<coefT> numerator;
100122
std::vector<coefT> denominator;

include/sot/core/integrator-euler.hh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ public:
168168
double getSamplingPeriod() const { return dt; }
169169

170170
void initialize() {
171+
if (denominator.empty() || numerator.empty())
172+
throw dynamicgraph::ExceptionSignal(
173+
dynamicgraph::ExceptionSignal::GENERIC,
174+
"The numerator or the denominator is empty.");
175+
176+
// Check that denominator.back is the identity
177+
if (!internal::integratorEulerCoeffIsIdentity(denominator.back()))
178+
throw dynamicgraph::ExceptionSignal(
179+
dynamicgraph::ExceptionSignal::GENERIC,
180+
"The coefficient of the highest order derivative of denominator "
181+
"should be 1 (the last pushDenomCoef should be the identity).");
182+
171183
std::size_t numsize = numerator.size();
172184
inputMemory.resize(numsize);
173185

@@ -181,13 +193,6 @@ public:
181193
for (std::size_t i = 0; i < denomsize; ++i) {
182194
outputMemory[i] = inputMemory[0];
183195
}
184-
185-
// Check that denominator.back is the identity
186-
if (!internal::integratorEulerCoeffIsIdentity(denominator.back()))
187-
throw dynamicgraph::ExceptionSignal(
188-
dynamicgraph::ExceptionSignal::GENERIC,
189-
"The coefficient of the highest order derivative of denominator "
190-
"should be 1 (the last pushDenomCoef should be the identity).");
191196
}
192197
};
193198

include/sot/core/mailbox.hh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,21 @@
3131
namespace dynamicgraph {
3232
namespace sot {
3333

34-
template <class Object> class Mailbox : public dynamicgraph::Entity {
34+
namespace dg = dynamicgraph;
35+
36+
template <class Object> struct MailboxTimestampedObject
37+
{
38+
Object obj;
39+
struct timeval timestamp;
40+
};
41+
42+
template <class Object> class Mailbox : public dg::Entity {
3543
public:
3644
static const std::string CLASS_NAME;
3745
virtual const std::string &getClassName(void) const { return CLASS_NAME; }
3846

3947
public:
40-
struct sotTimestampedObject {
41-
Object obj;
42-
struct timeval timestamp;
43-
};
48+
typedef MailboxTimestampedObject<Object> sotTimestampedObject;
4449

4550
public:
4651
Mailbox(const std::string &name);
@@ -61,12 +66,17 @@ protected:
6166
bool update;
6267

6368
public: /* --- SIGNALS --- */
64-
dynamicgraph::SignalTimeDependent<struct sotTimestampedObject, int> SOUT;
69+
dynamicgraph::SignalTimeDependent<sotTimestampedObject, int> SOUT;
6570
dynamicgraph::SignalTimeDependent<Object, int> objSOUT;
6671
dynamicgraph::SignalTimeDependent<struct timeval, int> timeSOUT;
6772
};
6873

6974
} /* namespace sot */
75+
76+
template <class Object> struct signal_io<sot::MailboxTimestampedObject<Object> >
77+
: signal_io_unimplemented<sot::MailboxTimestampedObject<Object> > {};
78+
79+
template <> struct signal_io<timeval> : signal_io_unimplemented<timeval > {};
7080
} /* namespace dynamicgraph */
7181

7282
#endif // #ifndef __SOT_MAILBOX_HH

0 commit comments

Comments
 (0)