42 namespace moveit_py_utils
47 std::size_t pos = ros_msg_name.find(
'/');
49 py::module m = py::module::import((ros_msg_name.substr(0, pos) +
".msg").c_str());
51 py::object cls = m.attr(ros_msg_name.substr(pos + 1).c_str());
56 bool convertible(
const pybind11::handle& h,
const std::string& ros_msg_name)
58 PyObject* o = h.attr(
"__class__").attr(
"__name__").ptr();
59 std::size_t pos = ros_msg_name.find_last_of(
'/');
60 std::string class_name = ros_msg_name.substr(pos + 1);
61 return py::cast<std::string>(o) == class_name;
PYBIND11_EXPORT bool convertible(const pybind11::handle &h, const std::string &ros_msg_name)
PYBIND11_EXPORT pybind11::object createMessage(const std::string &ros_msg_name)