diff --git a/.version b/.version new file mode 100644 index 0000000..10bf840 --- /dev/null +++ b/.version @@ -0,0 +1 @@ +2.0.1 \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe2bcd0..605b07a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,8 +8,8 @@ SET (LIBRARY_NAME ${PROJECT_NAME}) ADD_LIBRARY (${LIBRARY_NAME} SHARED cubic-interpolation.cc cubic-interpolation.hh - kinematic-planner.cc - kinematic-planner.hh + #kinematic-planner.cc + #kinematic-planner.hh cubic-interpolation-se3.cc cubic-interpolation-se3.hh oscillator.cc diff --git a/src/simpleseqplay.cc b/src/simpleseqplay.cc index 73ac20c..18de869 100644 --- a/src/simpleseqplay.cc +++ b/src/simpleseqplay.cc @@ -30,14 +30,15 @@ namespace dynamicgraph SimpleSeqPlay::SimpleSeqPlay (const std::string& name) : Entity (name), - postureSOUT_ ("SimpleSeqPlay(" + name + ")::output(vector)::posture"), + firstSINTERN( NULL, + sotNOSIGNAL,"SimpleSeqPlay("+name+")::intern(dummy)::init" ), + postureSOUT_(boost::bind (&SimpleSeqPlay::computePosture,this, _1, _2), + firstSINTERN, + "SimpleSeqPlay(" + name + ")::output(vector)::posture"), state_ (0), startTime_ (0), posture_ () { + firstSINTERN.setConstant(0); signalRegistration (postureSOUT_ ); - postureSOUT_.setFunction (boost::bind (&SimpleSeqPlay::computePosture, - this, _1, _2)); -cd - std::string docstring = "Load files describing a whole-body motion as reference feature " "trajectories\n" @@ -74,9 +75,7 @@ cd std::ifstream file; unsigned int lineNumber = 0; int postureSize = -2; - fn= filename + ".posture"; - // Open file file.open (fn.c_str ()); if (!file.is_open ()) @@ -85,7 +84,6 @@ cd fn); } - posture_.clear (); // Read posture @@ -93,7 +91,7 @@ cd { std::getline (file, line); ++lineNumber; - tokenizer_t tok (line, escaped_list_separator('\\', '\t', '\"')); + tokenizer_t tok (line, escaped_list_separator('\\', ' ', '\"' )); std::vector components; for(tokenizer_t::iterator it=tok.begin(); it!=tok.end(); ++it) { @@ -118,7 +116,7 @@ cd throw std::runtime_error (oss.str ()); } } - Vector config (static_cast (components.size () - 1)); + dg::Vector config (static_cast (components.size () - 1)); for (unsigned i = 1; i < components.size (); ++i) { config (i - 1) = components[i]; @@ -140,7 +138,7 @@ cd } } - Vector& SimpleSeqPlay::computePosture (Vector& pos, const int& t) + dg::Vector& SimpleSeqPlay::computePosture (dg::Vector& pos, int t) { if (posture_.size () == 0) { @@ -183,7 +181,7 @@ cd " Warning: pluging signals before loading trajectories will fail.\n"; } - DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (SimpleSeqPlay, "SimpleSeqplay"); + DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (SimpleSeqPlay, "SimpleSeqPlay"); } // namespace tools } //namespace sot } // namespace dynamicgraph diff --git a/src/simpleseqplay.hh b/src/simpleseqplay.hh index c4656f1..03c2ddb 100644 --- a/src/simpleseqplay.hh +++ b/src/simpleseqplay.hh @@ -16,43 +16,41 @@ # include # include # include -# include -# include -# include +# include +# include namespace dynamicgraph { namespace sot { namespace tools { - using dynamicgraph::Entity; - using dynamicgraph::Vector; - using dynamicgraph::Signal; - using dynamicgraph::sot::MatrixHomogeneous; + namespace dg = dynamicgraph; - class Seqplay : public Entity + class SimpleSeqPlay : public dg::Entity { - Signal postureSOUT_; + typedef int Dummy; + dg::SignalTimeDependent firstSINTERN; + dg::SignalTimeDependent postureSOUT_; DYNAMIC_GRAPH_ENTITY_DECL(); - Seqplay (const std::string& name); + SimpleSeqPlay (const std::string& name); void load (const std::string& filename); void start (); virtual std::string getDocString () const; private: - Vector& computePosture (Vector& pos, const int& t); + dg::Vector& computePosture (dg::Vector& pos, int t); // 0: motion not started, 1: motion in progress, 2: motion finished unsigned int state_; unsigned int configId_; int startTime_; - std::vector posture_; + std::vector posture_; bool facultativeFound_[7]; std::vector time_; - }; // class Seqplay + }; // class SimpleSeqPlay } // namespace tools } //namespace sot } // namespace dynamicgraph