Skip to content

Commit 5921e17

Browse files
committed
format
1 parent 96916ab commit 5921e17

22 files changed

+329
-303
lines changed

include/sot/core/device.hh

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

100-
PeriodicCall& periodicCallBefore() { return periodicCallBefore_; }
101-
PeriodicCall& periodicCallAfter() { return periodicCallAfter_; }
100+
PeriodicCall &periodicCallBefore() { return periodicCallBefore_; }
101+
PeriodicCall &periodicCallAfter() { return periodicCallAfter_; }
102102

103103
public: /* --- DISPLAY --- */
104104
virtual void display(std::ostream &os) const;

include/sot/core/flags.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include <vector>
2020

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

2525
/* --------------------------------------------------------------------- */
2626
/* --- CLASS ----------------------------------------------------------- */

include/sot/core/integrator-abstract.hh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,19 @@ 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; }
93+
const std::vector<coefT> &numCoeffs() const { return numerator; }
94+
void numCoeffs(const std::vector<coefT> &coeffs) { numerator = coeffs; }
9595

96-
const std::vector<coefT>& denomCoeffs() const { return denominator; }
97-
void denomCoeffs(const std::vector<coefT>& coeffs) { denominator = coeffs; }
96+
const std::vector<coefT> &denomCoeffs() const { return denominator; }
97+
void denomCoeffs(const std::vector<coefT> &coeffs) { denominator = coeffs; }
9898

9999
public:
100100
dynamicgraph::SignalPtr<sigT, int> SIN;
101101

102102
dynamicgraph::SignalTimeDependent<sigT, int> SOUT;
103103

104-
virtual void display(std::ostream &os) const
105-
{
106-
os << this->getClassName() << ": " << getName() << '\n'
107-
<< " ";
104+
virtual void display(std::ostream &os) const {
105+
os << this->getClassName() << ": " << getName() << '\n' << " ";
108106
if (numerator.empty() || denominator.empty()) {
109107
os << "ill-formed.";
110108
return;

include/sot/core/mailbox.hh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ namespace sot {
3333

3434
namespace dg = dynamicgraph;
3535

36-
template <class Object> struct MailboxTimestampedObject
37-
{
36+
template <class Object> struct MailboxTimestampedObject {
3837
Object obj;
3938
struct timeval timestamp;
4039
};
@@ -73,10 +72,11 @@ public: /* --- SIGNALS --- */
7372

7473
} /* namespace sot */
7574

76-
template <class Object> struct signal_io<sot::MailboxTimestampedObject<Object> >
77-
: signal_io_unimplemented<sot::MailboxTimestampedObject<Object> > {};
75+
template <class Object>
76+
struct signal_io<sot::MailboxTimestampedObject<Object> >
77+
: signal_io_unimplemented<sot::MailboxTimestampedObject<Object> > {};
7878

79-
template <> struct signal_io<timeval> : signal_io_unimplemented<timeval > {};
79+
template <> struct signal_io<timeval> : signal_io_unimplemented<timeval> {};
8080
} /* namespace dynamicgraph */
8181

8282
#endif // #ifndef __SOT_MAILBOX_HH

include/sot/core/multi-bound.hh

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

2121
/* SOT */
22-
#include <dynamic-graph/signal-caster.h>
2322
#include "sot/core/api.hh"
23+
#include <dynamic-graph/signal-caster.h>
2424
#include <sot/core/exception-task.hh>
2525

2626
/* --------------------------------------------------------------------- */
@@ -73,7 +73,8 @@ SOT_CORE_EXPORT std::istream &operator>>(std::istream &os, VectorMultiBound &v);
7373

7474
} /* namespace sot */
7575

76-
template <> struct signal_io<sot::MultiBound> : signal_io_unimplemented<sot::MultiBound> {};
76+
template <>
77+
struct signal_io<sot::MultiBound> : signal_io_unimplemented<sot::MultiBound> {};
7778
} /* namespace dynamicgraph */
7879

7980
#endif // #ifndef __SOT_MultiBound_H__

include/sot/core/trajectory.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ public:
195195
};
196196
} // namespace sot
197197

198-
template <> struct signal_io<sot::Trajectory> : signal_io_unimplemented<sot::Trajectory> {};
198+
template <>
199+
struct signal_io<sot::Trajectory> : signal_io_unimplemented<sot::Trajectory> {};
199200

200201
} // namespace dynamicgraph
201202

include/sot/core/variadic-op.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ public: /* --- SIGNAL --- */
108108

109109
int getSignalNumber() const { return (int)signalsIN.size(); }
110110

111-
signal_t* getSignalIn(int i)
112-
{
111+
signal_t *getSignalIn(int i) {
113112
if (i < 0 || i >= (int)signalsIN.size())
114113
throw std::out_of_range("Wrong signal index");
115114
return signalsIN[i];

include/sot/core/vector-to-rotation.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
namespace dynamicgraph {
4141
namespace sot {
4242

43-
class SOTVECTORTOROTATION_EXPORT VectorToRotation : public dynamicgraph::Entity {
43+
class SOTVECTORTOROTATION_EXPORT VectorToRotation
44+
: public dynamicgraph::Entity {
4445
enum sotAxis { AXIS_X, AXIS_Y, AXIS_Z };
4546

4647
unsigned int size;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#include <sot/core/admittance-control-op-point.hh>
22

3-
typedef boost::mpl::vector<dynamicgraph::sot::core::AdmittanceControlOpPoint> entities_t;
3+
typedef boost::mpl::vector<dynamicgraph::sot::core::AdmittanceControlOpPoint>
4+
entities_t;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#include <sot/core/feature-point6d-relative.hh>
22

3-
typedef boost::mpl::vector<dynamicgraph::sot::FeaturePoint6dRelative> entities_t;
3+
typedef boost::mpl::vector<dynamicgraph::sot::FeaturePoint6dRelative>
4+
entities_t;

src/feature/feature-pose-python.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace dgs = dynamicgraph::sot;
44

5-
typedef boost::mpl::vector<
6-
dgs::FeaturePose<dgs::SE3Representation>
7-
, dgs::FeaturePose<dgs::R3xSO3Representation>
8-
> entities_t;
5+
typedef boost::mpl::vector<dgs::FeaturePose<dgs::SE3Representation>,
6+
dgs::FeaturePose<dgs::R3xSO3Representation> >
7+
entities_t;

src/matrix/derivator-python.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#include <sot/core/derivator.hh>
22

33
namespace dg = ::dynamicgraph;
4-
typedef boost::mpl::vector<
5-
dg::sot::Derivator<double>
6-
, dg::sot::Derivator<dg::Vector>
7-
, dg::sot::Derivator<dg::Matrix>
8-
, dg::sot::Derivator<dg::sot::VectorQuaternion>
9-
> entities_t;
4+
typedef boost::mpl::vector<dg::sot::Derivator<double>,
5+
dg::sot::Derivator<dg::Vector>,
6+
dg::sot::Derivator<dg::Matrix>,
7+
dg::sot::Derivator<dg::sot::VectorQuaternion> >
8+
entities_t;

src/matrix/fir-filter-python.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#include <sot/core/fir-filter.hh>
22

33
namespace dg = ::dynamicgraph;
4-
typedef boost::mpl::vector<
5-
dg::sot::FIRFilter<double, double>
6-
, dg::sot::FIRFilter<dg::Vector, double>
7-
, dg::sot::FIRFilter<dg::Vector, dg::Matrix>
8-
> entities_t;
4+
typedef boost::mpl::vector<dg::sot::FIRFilter<double, double>,
5+
dg::sot::FIRFilter<dg::Vector, double>,
6+
dg::sot::FIRFilter<dg::Vector, dg::Matrix> >
7+
entities_t;

src/matrix/integrator-euler-python-module-py.cc

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,34 @@
1010
namespace dg = dynamicgraph;
1111
namespace dgc = dynamicgraph::command;
1212
namespace dgs = dynamicgraph::sot;
13-
using dg::Vector;
1413
using dg::Matrix;
14+
using dg::Vector;
1515

16-
template<typename S, typename C> void exposeIntegratorEuler()
17-
{
16+
template <typename S, typename C> void exposeIntegratorEuler() {
1817
typedef dgs::IntegratorEuler<S, C> IE_t;
1918

20-
const std::string cName =
21-
dgc::Value::typeName(dgc::ValueHelper<C>::TypeID);
19+
const std::string cName = dgc::Value::typeName(dgc::ValueHelper<C>::TypeID);
2220

2321
dg::python::exposeEntity<IE_t>()
24-
.add_property("numerators",
25-
+[](const IE_t& e) { return dg::python::to_py_list(e.numCoeffs().begin(), e.numCoeffs().end()); },
26-
+[](IE_t& e, bp::object iterable) { e.numCoeffs(dg::python::to_std_vector<C>(iterable)); })
27-
.add_property("denominators",
28-
+[](const IE_t& e) { return dg::python::to_py_list(e.denomCoeffs().begin(), e.denomCoeffs().end()); },
29-
+[](IE_t& e, bp::object iterable) { e.denomCoeffs(dg::python::to_std_vector<C>(iterable)); })
30-
;
22+
.add_property("numerators",
23+
+[](const IE_t &e) {
24+
return dg::python::to_py_list(e.numCoeffs().begin(),
25+
e.numCoeffs().end());
26+
},
27+
+[](IE_t &e, bp::object iterable) {
28+
e.numCoeffs(dg::python::to_std_vector<C>(iterable));
29+
})
30+
.add_property("denominators",
31+
+[](const IE_t &e) {
32+
return dg::python::to_py_list(e.denomCoeffs().begin(),
33+
e.denomCoeffs().end());
34+
},
35+
+[](IE_t &e, bp::object iterable) {
36+
e.denomCoeffs(dg::python::to_std_vector<C>(iterable));
37+
});
3138
}
3239

33-
BOOST_PYTHON_MODULE(wrap)
34-
{
40+
BOOST_PYTHON_MODULE(wrap) {
3541
bp::import("dynamic_graph");
3642

3743
exposeIntegratorEuler<double, double>();

0 commit comments

Comments
 (0)