Skip to content

Commit 531533c

Browse files
committed
Remove/replace deprecated use of JumpThreshold
1 parent 1fe7db4 commit 531533c

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

doc/examples/move_group_interface/src/move_group_interface_tutorial.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,10 @@ int main(int argc, char** argv)
304304
target_pose3.position.x -= 0.2;
305305
waypoints.push_back(target_pose3); // up and left
306306

307-
// We want the Cartesian path to be interpolated at a resolution of 1 cm
308-
// which is why we will specify 0.01 as the max step in Cartesian
309-
// translation. We will specify the jump threshold as 0.0, effectively disabling it.
310-
// Warning - disabling the jump threshold while operating real hardware can cause
311-
// large unpredictable motions of redundant joints and could be a safety issue
312-
moveit_msgs::msg::RobotTrajectory trajectory;
313-
const double jump_threshold = 0.0;
307+
// We want the Cartesian path to be interpolated at a resolution of 1 cm.
314308
const double eef_step = 0.01;
315-
double fraction = move_group.computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory);
309+
moveit_msgs::msg::RobotTrajectory trajectory;
310+
double fraction = move_group.computeCartesianPath(waypoints, eef_step, trajectory);
316311
RCLCPP_INFO(LOGGER, "Visualizing plan 4 (Cartesian path) (%.2f%% achieved)", fraction * 100.0);
317312

318313
// Visualize the plan in RViz

doc/how_to_guides/kinematics_cost_function/src/kinematics_cost_function_tutorial.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,15 @@ int main(int argc, char** argv)
216216
auto start_state = move_group.getCurrentState(10.0);
217217
std::vector<moveit::core::RobotStatePtr> traj;
218218
moveit::core::MaxEEFStep max_eef_step(0.01, 0.1);
219-
// Here, we're effectively disabling the jump threshold for joints. This is not recommended on real hardware.
220-
const auto jump_thresh = moveit::core::JumpThreshold::disabled();
219+
moveit::core::CartesianPrecision cartesian_precision{ .translational = 0.001,
220+
.rotational = 0.01,
221+
.max_resolution = 1e-3 };
221222

222223
// The trajectory, traj, passed to computeCartesianPath will contain several waypoints toward
223224
// the goal pose, target. For each of these waypoints, the IK solver is queried with the given cost function.
224225
const auto frac = moveit::core::CartesianInterpolator::computeCartesianPath(
225226
start_state.get(), joint_model_group, traj, joint_model_group->getLinkModel("panda_link8"), target, true,
226-
max_eef_step, jump_thresh, callback_fn, opts, cost_fn);
227+
max_eef_step, cartesian_precision, callback_fn, opts, cost_fn);
227228

228229
RCLCPP_INFO(LOGGER, "Computed %f percent of cartesian path.", frac.value * 100.0);
229230

0 commit comments

Comments
 (0)