@@ -270,7 +270,17 @@ thread torqueThread():
270270 textmsg("ExternalControl: Starting torque thread")
271271 while control_mode == MODE_TORQUE:
272272 torque = cmd_torque
273+ {% if ROBOT_SOFTWARE_VERSION >= v5.23.0 %}
274+ {% if ROBOT_SOFTWARE_VERSION < v6.0.0 %}
273275 torque_command(torque, friction_comp=friction_compensation_enabled)
276+ {% elif ROBOT_SOFTWARE_VERSION >= v10.10.0 %}
277+ torque_command(torque, friction_comp=friction_compensation_enabled)
278+ {% else %}
279+ popup("Torque control is only supported from software 10.10.0 and upwards.", error=True, blocking=True)
280+ {% endif %}
281+ {% else %}
282+ popup("Torque control is only supported from software 5.23.0 and upwards.", error=True, blocking=True)
283+ {% endif %}
274284 end
275285 textmsg("ExternalControl: torque thread ended")
276286 stopj(STOPJ_ACCELERATION)
@@ -680,7 +690,17 @@ thread PDControlThread():
680690 local q_err = cmd_servo_q - get_actual_joint_positions()
681691 local tau = pd_controller_gains.kp * q_err - pd_controller_gains.kd * get_actual_joint_speeds()
682692 tau = clamp_array(tau, max_joint_torques)
693+ {% if ROBOT_SOFTWARE_VERSION >= v5.23.0 %}
694+ {% if ROBOT_SOFTWARE_VERSION < v6.0.0 %}
695+ torque_command(tau, friction_comp=friction_compensation_enabled)
696+ {% elif ROBOT_SOFTWARE_VERSION >= v10.10.0 %}
683697 torque_command(tau, friction_comp=friction_compensation_enabled)
698+ {% else %}
699+ popup("Torque control is only supported from software 10.10.0 and upwards.", error=True, blocking=True)
700+ {% endif %}
701+ {% else %}
702+ popup("Torque control is only supported from software 5.23.0 and upwards.", error=True, blocking=True)
703+ {% endif %}
684704 end
685705 textmsg("PD Control thread ended")
686706 stopj(STOPJ_ACCELERATION)
0 commit comments