Fixup: Provide wrapper for moveit::core::MoveItErrorCode

This commit is contained in:
Robert Haschke 2022-01-07 16:09:46 +01:00
parent 86093be94a
commit a08face4a0
2 changed files with 8 additions and 0 deletions

View File

@ -144,6 +144,12 @@ void export_core(pybind11::module& m) {
.def_property_readonly("scene", &InterfaceState::scene)
;
py::classh<moveit::core::MoveItErrorCode>(m, "MoveItErrorCode")
.def_readonly("val", &moveit::core::MoveItErrorCode::val)
.def(PYBIND11_BOOL_ATTR, [](const moveit::core::MoveItErrorCode& err) {
return pybind11::cast(static_cast<bool>(err));
});
auto stage = properties::class_<Stage, PyStage<>>(m, "Stage")
.property<double>("timeout")
.property<std::string>("marker_ns")

View File

@ -37,6 +37,7 @@
#include <moveit/task_constructor/stage.h>
#include <moveit/task_constructor/container.h>
#include <moveit/task_constructor/cost_queue.h>
#include <moveit/utils/moveit_error_code.h>
#include <pybind11/smart_holder.h>
/** Trampoline classes to allow inheritance in Python (overriding virtual functions) */
@ -116,6 +117,7 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(moveit::task_constructor::SolutionBase)
PYBIND11_SMART_HOLDER_TYPE_CASTERS(moveit::task_constructor::SubTrajectory)
PYBIND11_SMART_HOLDER_TYPE_CASTERS(ordered<moveit::task_constructor::SolutionBaseConstPtr>)
PYBIND11_SMART_HOLDER_TYPE_CASTERS(moveit::task_constructor::InterfaceState)
PYBIND11_SMART_HOLDER_TYPE_CASTERS(moveit::core::MoveItErrorCode)
PYBIND11_SMART_HOLDER_TYPE_CASTERS(moveit::task_constructor::Stage)
PYBIND11_SMART_HOLDER_TYPE_CASTERS(moveit::task_constructor::PropagatingEitherWay)