3838#include < moveit/task_constructor/solvers/joint_interpolation.h>
3939#include < moveit/task_constructor/solvers/multi_planner.h>
4040#include < moveit_msgs/WorkspaceParameters.h>
41+ #include < fmt/core.h>
4142#include " utils.h"
4243
4344namespace py = pybind11;
@@ -99,6 +100,22 @@ void export_solvers(py::module& m) {
99100 .property <double >(" max_step" , " float: Limit any (single) joint change between two waypoints to this amount" )
100101 .def (py::init<>());
101102
103+ const moveit::core::CartesianPrecision default_precision;
104+ py::class_<moveit::core::CartesianPrecision>(m, " CartesianPrecision" , " precision for Cartesian interpolation" )
105+ .def (py::init ([](double translational, double rotational, double max_resolution) {
106+ return new moveit::core::CartesianPrecision{ translational, rotational, max_resolution };
107+ }),
108+ py::arg (" translational" ) = default_precision.translational ,
109+ py::arg (" rotational" ) = default_precision.rotational ,
110+ py::arg (" max_resolution" ) = default_precision.max_resolution )
111+ .def_readwrite (" translational" , &moveit::core::CartesianPrecision::translational)
112+ .def_readwrite (" rotational" , &moveit::core::CartesianPrecision::rotational)
113+ .def_readwrite (" max_resolution" , &moveit::core::CartesianPrecision::max_resolution)
114+ .def (" __str__" , [](const moveit::core::CartesianPrecision& self) {
115+ return fmt::format (" CartesianPrecision(translational={}, rotational={}, max_resolution={}" ,
116+ self.translational , self.rotational , self.max_resolution );
117+ });
118+
102119 properties::class_<CartesianPath, PlannerInterface>(m, " CartesianPath" , R"(
103120 Perform linear interpolation between Cartesian poses.
104121 Fails on collision along the interpolation path. There is no obstacle avoidance. ::
@@ -108,15 +125,12 @@ void export_solvers(py::module& m) {
108125 # Instantiate Cartesian-space interpolation planner
109126 cartesianPlanner = core.CartesianPath()
110127 cartesianPlanner.step_size = 0.01
111- cartesianPlanner.jump_threshold = 0.0 # effectively disable jump threshold.
128+ cartesianPlanner.precision.translational = 0.001
112129 )" )
113130 .property <double >(" step_size" , " float: Limit the Cartesian displacement between consecutive waypoints "
114131 " In contrast to joint-space interpolation, the Cartesian planner can also "
115132 " succeed when only a fraction of the linear path was feasible." )
116- .property <double >(
117- " jump_threshold" ,
118- " float: Limit joint displacement between consecutive waypoints, thus preventing jumps in joint space. "
119- " This values specifies the fraction of mean acceptable joint motion per step." )
133+ .property <moveit::core::CartesianPrecision>(" precision" , " Cartesian interpolation precision" )
120134 .property <double >(" min_fraction" , " float: Fraction of overall distance required to succeed." )
121135 .def (py::init<>());
122136
0 commit comments