Skip to content

Commit 2627262

Browse files
authored
In servo mode always allow targets close to current pose (#273)
If the target has been interpolating too far away from the robot, so it would trigger the limit check, but the target is close to where the robot currently is, also accept the command. This can, for example, happen if a command series was too fast for the robot to follow, which triggers a path deviation on the commanding side and that is mitigated by a hold-position command.
1 parent 44b650f commit 2627262

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

resources/external_control.urscript

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ def set_servo_setpoint(q):
153153
if targetWithinLimits(cmd_servo_q, q, steptime):
154154
cmd_servo_q_last = cmd_servo_q
155155
cmd_servo_q = q
156+
# If the target has been interpolating too far away from the robot, so it would trigger the limit
157+
# check, but the target is close to where the robot currently is, also accept the command.
158+
# This can, for example, happen if a command series was too fast for the robot to follow, which
159+
# triggers a path deviation on the commanding side and that is mitigated by a hold-position
160+
# command.
161+
elif targetWithinLimits(get_joint_positions(), q, steptime):
162+
cmd_servo_q_last = cmd_servo_q
163+
cmd_servo_q = q
156164
end
157165
end
158166

0 commit comments

Comments
 (0)