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