@@ -68,8 +68,8 @@ JOINT_IGNORE_SPEED = 20.0
68
68
global violation_popup_counter = 0
69
69
global cmd_servo_state = SERVO_UNINITIALIZED
70
70
global cmd_servo_qd = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
71
- global cmd_servo_q = get_actual_joint_positions ()
72
- global cmd_servo_q_last = get_actual_joint_positions()
71
+ global cmd_servo_q = get_joint_positions ()
72
+ global cmd_servo_q_last = cmd_servo_q
73
73
global cmd_twist = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
74
74
global extrapolate_count = 0
75
75
global extrapolate_max_count = 0
158
158
thread servoThread():
159
159
textmsg("ExternalControl: Starting servo thread")
160
160
state = SERVO_IDLE
161
- local q_last = get_target_joint_positions ()
161
+ local q_last = get_joint_positions ()
162
162
while control_mode == MODE_SERVOJ:
163
163
enter_critical
164
164
q = cmd_servo_q
@@ -221,13 +221,13 @@ def cubicSplineRun(end_q, end_qd, time, is_last_point=False, is_first_point=Fals
221
221
local str = str_cat(end_q, str_cat(end_qd, time))
222
222
textmsg("Cubic spline arg: ", str)
223
223
224
- local start_q = get_target_joint_positions ()
224
+ local start_q = get_joint_positions ()
225
225
# Zero time means infinite velocity to reach the target and is therefore impossible
226
226
if time <= 0.0:
227
227
if is_first_point and time == 0.0:
228
228
# If users specify the current joint position with time 0 that may be fine, in that case just
229
229
# ignore that point
230
- local distance = norm(end_q - get_target_joint_positions() )
230
+ local distance = norm(end_q - start_q )
231
231
if distance < 0.01:
232
232
local splineTimerTraveled = 0.0
233
233
# USED_IN_TEST_SPLINE_INTERPOLATION write_output_float_register(1, splineTimerTraveled)
@@ -263,13 +263,13 @@ def quinticSplineRun(end_q, end_qd, end_qdd, time, is_last_point=False, is_first
263
263
local str = str_cat(end_q, str_cat(end_qd, str_cat(end_qdd, time)))
264
264
textmsg("Quintic spline arg: ", str)
265
265
266
- local start_q = get_target_joint_positions ()
266
+ local start_q = get_joint_positions ()
267
267
# Zero time means infinite velocity to reach the target and is therefore impossible
268
268
if time <= 0.0:
269
269
if is_first_point and time == 0.0:
270
270
# If users specify the current joint position with time 0 that may be fine, in that case just
271
271
# ignore that point
272
- local distance = norm(end_q - get_target_joint_positions() )
272
+ local distance = norm(end_q - start_q )
273
273
if distance < 0.01:
274
274
return False
275
275
end
553
553
thread servoThreadP():
554
554
textmsg("Starting pose servo thread")
555
555
state = SERVO_IDLE
556
- local q_last = get_target_joint_positions ()
556
+ local q_last = get_joint_positions ()
557
557
while control_mode == MODE_POSE:
558
558
enter_critical
559
559
q = cmd_servo_q
0 commit comments