7 #include <dynamic-graph/signal.h> 9 #include <boost/python.hpp> 10 #include <boost/python/stl_iterator.hpp> 18 using ::dynamicgraph::SignalBase;
29 return Value(bp::extract<bool>(o));
30 case (Value::UNSIGNED):
31 return Value(bp::extract<unsigned>(o));
33 return Value(bp::extract<int>(o));
35 return Value(bp::extract<float>(o));
37 return Value(bp::extract<double>(o));
39 return Value(bp::extract<std::string>(o));
43 return Value(bp::extract<Vector>(o));
47 return Value(bp::extract<Matrix>(o));
48 case (Value::MATRIX4D):
49 return Value(bp::extract<Eigen::Matrix4d>(o));
54 throw std::invalid_argument(
55 "not implemented: cannot create a vector of values");
58 std::cerr <<
"Only int, double and string are supported." << std::endl;
65 switch (value.
type()) {
68 case (Value::UNSIGNED):
82 case (Value::MATRIX4D):
84 case (Value::VALUES): {
boost::python::object fromValue(const command::Value &value)
std::string stringValue() const
double doubleValue() const
unsigned unsignedValue() const
const Values & constValuesValue() const
Eigen::Matrix4d matrix4dValue() const
command::Value toValue(boost::python::object o, const command::Value::Type &type)
Vector vectorValue() const
Eigen::MatrixXd matrixXdValue() const