Skip to content

Commit

Permalink
(moveit_py) add __bool__ to ExecutionStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Oct 6, 2023
1 parent 4a3c754 commit be8b177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions moveit_py/moveit/core/controller_manager.pyi
Expand Up @@ -4,3 +4,4 @@ class ExecutionStatus:
def __init__(self, *args, **kwargs) -> None: ...
@property
def status(self) -> Any: ...
def __bool__(self) -> Any: ...
Expand Up @@ -46,7 +46,11 @@ void init_execution_status(py::module& m)

py::class_<moveit_controller_manager::ExecutionStatus, std::shared_ptr<moveit_controller_manager::ExecutionStatus>>(
controller_manager, "ExecutionStatus", R"( Execution status of planned robot trajectory. )")
.def_property_readonly("status", &moveit_controller_manager::ExecutionStatus::asString);
.def_property_readonly("status", &moveit_controller_manager::ExecutionStatus::asString)

.def("__bool__", [](std::shared_ptr<moveit_controller_manager::ExecutionStatus>& status) {
return static_cast<bool>(status);
});
}
} // namespace bind_controller_manager
} // namespace moveit_py

0 comments on commit be8b177

Please sign in to comment.