Skip to content

Commit 316be38

Browse files
committed
Add velocity-related debug output to joint tolerance
1 parent 01b8105 commit 316be38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ur_controllers/src/passthrough_trajectory_controller.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,16 @@ bool PassthroughTrajectoryController::check_goal_tolerance()
806806
if (!active_joint_traj_.points.back().velocities.empty() && !joint_velocity_state_interface_.empty()) {
807807
const auto joint_vel = joint_velocity_state_interface_[i].get().get_optional();
808808
if (!joint_vel.has_value()) {
809+
RCLCPP_ERROR(get_node()->get_logger(), "Could not read velocity for joint %s, cannot check velocity tolerance.",
810+
joint_velocity_state_interface_[i].get().get_name().c_str());
809811
return false;
810812
}
811813
const auto& expected_vel = active_joint_traj_.points.back().velocities[joint_mapping->at(joint_name)];
812814
if (std::abs(joint_vel.value() - expected_vel) > joint_tol.velocity) {
815+
RCLCPP_ERROR(get_node()->get_logger(),
816+
"Joint %s should be at velocity %f, but is at velocity %f, where tolerance is %f",
817+
joint_velocity_state_interface_[i].get().get_name().c_str(), expected_vel, joint_vel.value(),
818+
joint_tol.velocity);
813819
return false;
814820
}
815821
}

0 commit comments

Comments
 (0)