From 3ef00a216b32edc1d5a1e4b49d8357b0e1b7588b Mon Sep 17 00:00:00 2001 From: Guilhem Saurel <guilhem.saurel@laas.fr> Date: Wed, 25 Nov 2020 10:39:04 +0100 Subject: [PATCH] format --- include/sot/tools/simpleseqplay.hh | 8 ++++---- src/python-module.cc | 32 +++++++++++------------------- src/simpleseqplay.cc | 8 ++++---- tests/test_simpleseqplay.cc | 6 ++++-- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/include/sot/tools/simpleseqplay.hh b/include/sot/tools/simpleseqplay.hh index 107f1eb..ef12728 100644 --- a/include/sot/tools/simpleseqplay.hh +++ b/include/sot/tools/simpleseqplay.hh @@ -40,10 +40,10 @@ class SimpleSeqPlay : public dg::Entity { void start(); virtual std::string getDocString() const; - bool waiting () const; - bool initializing () const; - bool executing () const; - bool finished () const; + bool waiting() const; + bool initializing() const; + bool executing() const; + bool finished() const; private: dg::Vector& computePosture(dg::Vector& pos, int t); diff --git a/src/python-module.cc b/src/python-module.cc index 4e9b01c..2977784 100644 --- a/src/python-module.cc +++ b/src/python-module.cc @@ -9,32 +9,24 @@ namespace dgst = dynamicgraph::sot::tools; -typedef boost::mpl::vector< - dgst::CubicInterpolation -, dgst::CubicInterpolationSE3 -, dgst::Oscillator -, dgst::Seqplay -> entities_t; +typedef boost::mpl::vector<dgst::CubicInterpolation, dgst::CubicInterpolationSE3, dgst::Oscillator, dgst::Seqplay> + entities_t; -struct register_entity -{ -template<typename T> inline void operator()(boost::type<T>) const -{ - dynamicgraph::python::exposeEntity<T>(); -} +struct register_entity { + template <typename T> + inline void operator()(boost::type<T>) const { + dynamicgraph::python::exposeEntity<T>(); + } }; -BOOST_PYTHON_MODULE(wrap) -{ +BOOST_PYTHON_MODULE(wrap) { bp::import("dynamic_graph"); boost::mpl::for_each<entities_t, boost::type<boost::mpl::_> >(register_entity()); using dgst::SimpleSeqPlay; dynamicgraph::python::exposeEntity<SimpleSeqPlay>() - .def("waiting", &SimpleSeqPlay::waiting) - .def("initializing", &SimpleSeqPlay::initializing) - .def("executing", &SimpleSeqPlay::executing) - .def("finished", &SimpleSeqPlay::finished) - ; + .def("waiting", &SimpleSeqPlay::waiting) + .def("initializing", &SimpleSeqPlay::initializing) + .def("executing", &SimpleSeqPlay::executing) + .def("finished", &SimpleSeqPlay::finished); } - diff --git a/src/simpleseqplay.cc b/src/simpleseqplay.cc index ffdbeb9..434cdeb 100644 --- a/src/simpleseqplay.cc +++ b/src/simpleseqplay.cc @@ -175,10 +175,10 @@ dg::Vector& SimpleSeqPlay::computePosture(dg::Vector& pos, int t) { return pos; } -bool SimpleSeqPlay::waiting () const { return state_ == 0; } -bool SimpleSeqPlay::initializing () const { return state_ == 1; } -bool SimpleSeqPlay::executing () const { return state_ == 2; } -bool SimpleSeqPlay::finished () const { return state_ == 3; } +bool SimpleSeqPlay::waiting() const { return state_ == 0; } +bool SimpleSeqPlay::initializing() const { return state_ == 1; } +bool SimpleSeqPlay::executing() const { return state_ == 2; } +bool SimpleSeqPlay::finished() const { return state_ == 3; } std::string SimpleSeqPlay::getDocString() const { return "Provide joint references for a whole-body motion\n" diff --git a/tests/test_simpleseqplay.cc b/tests/test_simpleseqplay.cc index 7c4e5af..b5ee5fb 100644 --- a/tests/test_simpleseqplay.cc +++ b/tests/test_simpleseqplay.cc @@ -11,8 +11,10 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE) BOOST_AUTO_TEST_CASE(test_simpleseqplay) { dg::sot::tools::SimpleSeqPlay aSimpleSeqPlay("simpleseqplay"); - dg::Vector initial (32); - initial << 0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708, 0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708, 0.0, 0.006761, 0.25847, 0.173046, -0.0002, -0.525366, 0.0, -0.0, 0.1, -0.005, -0.25847, -0.173046, 0.0002, -0.525366, 0.0, 0.0, 0.1, -0.005, 0.0, 0.0; + dg::Vector initial(32); + initial << 0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708, 0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708, + 0.0, 0.006761, 0.25847, 0.173046, -0.0002, -0.525366, 0.0, -0.0, 0.1, -0.005, -0.25847, -0.173046, 0.0002, + -0.525366, 0.0, 0.0, 0.1, -0.005, 0.0, 0.0; aSimpleSeqPlay.currentPostureSIN_.setConstant(initial); BOOST_CHECK(aSimpleSeqPlay.waiting()); -- GitLab