Skip to content
Snippets Groups Projects
Commit 3ef00a21 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

format

parent 6bf136e5
No related branches found
No related tags found
No related merge requests found
...@@ -40,10 +40,10 @@ class SimpleSeqPlay : public dg::Entity { ...@@ -40,10 +40,10 @@ class SimpleSeqPlay : public dg::Entity {
void start(); void start();
virtual std::string getDocString() const; virtual std::string getDocString() const;
bool waiting () const; bool waiting() const;
bool initializing () const; bool initializing() const;
bool executing () const; bool executing() const;
bool finished () const; bool finished() const;
private: private:
dg::Vector& computePosture(dg::Vector& pos, int t); dg::Vector& computePosture(dg::Vector& pos, int t);
......
...@@ -9,32 +9,24 @@ ...@@ -9,32 +9,24 @@
namespace dgst = dynamicgraph::sot::tools; namespace dgst = dynamicgraph::sot::tools;
typedef boost::mpl::vector< typedef boost::mpl::vector<dgst::CubicInterpolation, dgst::CubicInterpolationSE3, dgst::Oscillator, dgst::Seqplay>
dgst::CubicInterpolation entities_t;
, dgst::CubicInterpolationSE3
, dgst::Oscillator
, dgst::Seqplay
> entities_t;
struct register_entity struct register_entity {
{ template <typename T>
template<typename T> inline void operator()(boost::type<T>) const inline void operator()(boost::type<T>) const {
{ dynamicgraph::python::exposeEntity<T>();
dynamicgraph::python::exposeEntity<T>(); }
}
}; };
BOOST_PYTHON_MODULE(wrap) BOOST_PYTHON_MODULE(wrap) {
{
bp::import("dynamic_graph"); bp::import("dynamic_graph");
boost::mpl::for_each<entities_t, boost::type<boost::mpl::_> >(register_entity()); boost::mpl::for_each<entities_t, boost::type<boost::mpl::_> >(register_entity());
using dgst::SimpleSeqPlay; using dgst::SimpleSeqPlay;
dynamicgraph::python::exposeEntity<SimpleSeqPlay>() dynamicgraph::python::exposeEntity<SimpleSeqPlay>()
.def("waiting", &SimpleSeqPlay::waiting) .def("waiting", &SimpleSeqPlay::waiting)
.def("initializing", &SimpleSeqPlay::initializing) .def("initializing", &SimpleSeqPlay::initializing)
.def("executing", &SimpleSeqPlay::executing) .def("executing", &SimpleSeqPlay::executing)
.def("finished", &SimpleSeqPlay::finished) .def("finished", &SimpleSeqPlay::finished);
;
} }
...@@ -175,10 +175,10 @@ dg::Vector& SimpleSeqPlay::computePosture(dg::Vector& pos, int t) { ...@@ -175,10 +175,10 @@ dg::Vector& SimpleSeqPlay::computePosture(dg::Vector& pos, int t) {
return pos; return pos;
} }
bool SimpleSeqPlay::waiting () const { return state_ == 0; } bool SimpleSeqPlay::waiting() const { return state_ == 0; }
bool SimpleSeqPlay::initializing () const { return state_ == 1; } bool SimpleSeqPlay::initializing() const { return state_ == 1; }
bool SimpleSeqPlay::executing () const { return state_ == 2; } bool SimpleSeqPlay::executing() const { return state_ == 2; }
bool SimpleSeqPlay::finished () const { return state_ == 3; } bool SimpleSeqPlay::finished() const { return state_ == 3; }
std::string SimpleSeqPlay::getDocString() const { std::string SimpleSeqPlay::getDocString() const {
return "Provide joint references for a whole-body motion\n" return "Provide joint references for a whole-body motion\n"
......
...@@ -11,8 +11,10 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE) ...@@ -11,8 +11,10 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
BOOST_AUTO_TEST_CASE(test_simpleseqplay) { BOOST_AUTO_TEST_CASE(test_simpleseqplay) {
dg::sot::tools::SimpleSeqPlay aSimpleSeqPlay("simpleseqplay"); dg::sot::tools::SimpleSeqPlay aSimpleSeqPlay("simpleseqplay");
dg::Vector initial (32); 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; 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); aSimpleSeqPlay.currentPostureSIN_.setConstant(initial);
BOOST_CHECK(aSimpleSeqPlay.waiting()); BOOST_CHECK(aSimpleSeqPlay.waiting());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment