Skip to content
Snippets Groups Projects
Commit 39062197 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Guilhem Saurel
Browse files

Add function to get state of SimpleSeqPlay

parent 8b45b345
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,11 @@ class SimpleSeqPlay : public dg::Entity {
void unhold();
virtual std::string getDocString() const;
bool waiting () const;
bool initializing () const;
bool executing () const;
bool finished () const;
private:
dg::Vector& computePosture(dg::Vector& pos, int t);
// 0: motion not started,
......
......@@ -5,7 +5,7 @@
IF(BUILD_PYTHON_INTERFACE)
DYNAMIC_GRAPH_PYTHON_MODULE(${PYTHON_DIR} ${PROJECT_NAME} wrap
MODULE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/python.hh
SOURCE_PYTHON_MODULE ${CMAKE_CURRENT_SOURCE_DIR}/python-module.cc
)
SET(${PROJECT_NAME}_PYTHON
......
#include "dynamic-graph/python/module.hh"
#include <sot/tools/cubic-interpolation.hh>
#include <sot/tools/cubic-interpolation-se3.hh>
#include <sot/tools/kinematic-planner.hh>
......@@ -12,5 +14,27 @@ typedef boost::mpl::vector<
, dgst::CubicInterpolationSE3
, dgst::Oscillator
, dgst::Seqplay
, dgst::SimpleSeqPlay
> entities_t;
struct register_entity
{
template<typename T> inline void operator()(boost::type<T>) const
{
dynamicgraph::python::exposeEntity<T>();
}
};
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)
;
}
......@@ -186,6 +186,11 @@ void SimpleSeqPlay::hold() {
void SimpleSeqPlay::unhold() { hold_ = false; }
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"
"\n"
......
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