diff --git a/include/sot/tools/simpleseqplay.hh b/include/sot/tools/simpleseqplay.hh index 107f1ebf54d6f68c4faab5f391414acec2a99746..ef1272800124e9734e35fb27774841723a910495 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 4e9b01cb6a142fa1a4c517151f35105acc1877a7..2977784060b78055396f67e9e5bd68e1ec2ba393 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 ffdbeb9796bca77900c6b3beb20116ba50ced4c7..434cdeba00dc4f11964b050a9d1df2720409dcec 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 7c4e5af2ec136ca4abc7d3da28a3092780602691..b5ee5fb7e72958e6f7b3b3a68066c6e52806d461 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());