Commit 6142793b authored by Felix Exner's avatar Felix Exner
Browse files

Renamed the urscript as it is now general purpose ros_control

parent 36edb50c
......@@ -234,7 +234,7 @@ Robot bringup launchfile without the robot description. Include this, if you wan
Tool voltage set at the beginning of the UR program. Only used, when `use_tool_communication` is set to true.
* "**urscript_file**" (default: "$(find ur_robot_driver)/resources/servoj.urscript")
* "**urscript_file**" (default: "$(find ur_robot_driver)/resources/ros_control.urscript")
Path to URScript that will be sent to the robot and that forms the main control program.
......
......@@ -15,7 +15,7 @@
<arg name="tf_prefix" default="" doc="tf_prefix used for the robot."/>
<arg name="controllers" default="joint_state_controller vel_based_pos_traj_controller force_torque_sensor_controller"/>
<arg name="stopped_controllers" default="joint_group_vel_controller"/>
<arg name="urscript_file" default="$(find ur_robot_driver)/resources/servoj.urscript"/>
<arg name="urscript_file" default="$(find ur_robot_driver)/resources/ros_control.urscript"/>
<arg name="rtde_output_recipe_file" default="$(find ur_robot_driver)/resources/rtde_output_recipe.txt" doc="Recipe file used for the RTDE-outputs. Only change this if you know what you're doing."/>
<arg name="rtde_input_recipe_file" default="$(find ur_robot_driver)/resources/rtde_input_recipe.txt" doc="Recipe file used for the RTDE-inputs. Only change this if you know what you're doing."/>
<arg name="tool_voltage" default="0" doc="Tool voltage set at the beginning of the UR program. Only used, when `use_tool_communication` is set to true."/>
......
{{BEGIN_REPLACE}}
global steptime = get_steptime()
global speedj_time = steptime - 0.1*steptime
textmsg("steptime=", steptime)
MULT_jointstate = {{JOINT_STATE_REPLACE}}
global cmd_servo_qd = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
cmd_speedj_active = True
keepalive = -2
def set_speed(qd):
enter_critical
cmd_servo_qd = qd
cmd_speedj_active = True
exit_critical
end
thread speedThread():
while True:
enter_critical
qd = cmd_servo_qd
exit_critical
#textmsg("loop")
if cmd_speedj_active:
# Having this shortly under steptime seems to help
speedj(qd, 40.0, speedj_time)
else:
stopj(5.0)
end
sync()
end
stopj(5.0)
end
socket_open("{{SERVER_IP_REPLACE}}", {{SERVER_PORT_REPLACE}}, "reverse_socket")
thread_speed = run speedThread()
params_mult = socket_read_binary_integer(1+6, "reverse_socket")
keepalive = params_mult[1]
while keepalive > 0:
params_mult = socket_read_binary_integer(1+6, "reverse_socket", 0.02)
if params_mult[0] > 0:
keepalive = params_mult[1]
if keepalive > 1:
qd = [params_mult[2] / MULT_jointstate, params_mult[3] / MULT_jointstate, params_mult[4] / MULT_jointstate, params_mult[5] / MULT_jointstate, params_mult[6] / MULT_jointstate, params_mult[7] / MULT_jointstate]
set_speed(qd)
#speedj(qd, 40.0, 0.007)
else:
cmd_speedj_active = False
keepalive = 1
end
else:
textmsg("Missing package from remote pc")
keepalive = keepalive - 1
end
end
sleep(.1)
socket_close()
kill thread_speed
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment