@@ -95,6 +95,8 @@ void export_core(pybind11::module& m) {
9595 }
9696 });
9797
98+ py::classh<Introspection>(m, " Introspection" , " Introspection class" );
99+
98100 py::classh<SolutionBase>(m, " Solution" , " Abstract base class for solutions of a stage" )
99101 .def_property (" cost" , &SolutionBase::cost, &SolutionBase::setCost, " float: Cost associated with the solution" )
100102 .def_property (" comment" , &SolutionBase::comment, &SolutionBase::setComment,
@@ -109,12 +111,12 @@ void export_core(pybind11::module& m) {
109111 " :visualization_msgs:`Marker`: Markers to visualize important aspects of the trajectory (read-only)" )
110112 .def (
111113 " toMsg" ,
112- [](const SolutionBase& self) {
114+ [](const SolutionBase& self, moveit::task_constructor::Introspection* introspection ) {
113115 moveit_task_constructor_msgs::Solution msg;
114- self.toMsg (msg);
116+ self.toMsg (msg, introspection );
115117 return msg;
116118 },
117- " Convert to the ROS message ``Solution``" );
119+ " Convert to the ROS message ``Solution``" , py::arg ( " introspection " ) = nullptr );
118120
119121 py::classh<SubTrajectory, SolutionBase>(m, " SubTrajectory" ,
120122 " Solution trajectory connecting two InterfaceStates of a stage" )
@@ -462,6 +464,8 @@ void export_core(pybind11::module& m) {
462464 .def (
463465 " setCostTerm" , [](Task& self, const LambdaCostTerm::SubTrajectoryShortSignature& f) { self.setCostTerm (f); },
464466 " Specify a function to calculate trajectory costs" )
467+ .def (" introspection" , &Task::introspection, py::return_value_policy::reference_internal,
468+ " Access introspection object" )
465469 .def (" reset" , &Task::reset, " Reset task (and all its stages)" )
466470 .def (" init" , py::overload_cast<>(&Task::init), " Initialize the task (and all its stages)" )
467471 .def (" plan" , &Task::plan, " max_solutions" _a = 0 , R"(
0 commit comments