Skip to content

Instantly share code, notes, and snippets.

@felixvd
Created January 25, 2020 14:21
Show Gist options
  • Save felixvd/919ab8f7396ec66c263c8c80646b7c77 to your computer and use it in GitHub Desktop.
Save felixvd/919ab8f7396ec66c263c8c80646b7c77 to your computer and use it in GitHub Desktop.
Extract from the launch file starting up ur_robot_driver nodes
<!-- Robot parameters that are separate for a_bot and b_bot -->
<arg name="robot_ip_a" default="192.168.0.41"/>
<arg name="robot_ip_b" default="192.168.0.42"/>
<arg name="reverse_port_a" default="50001" />
<arg name="script_sender_port_a" default="50002" />
<arg name="reverse_port_b" default="50003" doc="Port that will be opened by the driver to allow direct communication between the driver and the robot controller."/>
<arg name="script_sender_port_b" default="50004" doc="The driver will offer an interface to receive the program's URScript on this port. If the robot cannot connect to this port, `External Control` will stop immediately."/>
<arg name="use_tool_communication_a" default="false"/>
<arg name="use_tool_communication_b" default="false" doc="On e-Series robots tool communication can be enabled with this argument"/>
<arg name="tool_device_name_a" default="/tmp/ttyUR_a"/>
<arg name="tool_device_name_b" default="/tmp/ttyUR_b" doc="Local device name used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tcp_port_a" default="54321"/>
<arg name="tool_tcp_port_b" default="54322" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<!-- TODO: Replace this with the actual factory calibration for each robot -->
<arg name="kinematics_config_a" default="$(find ur_description)/config/ur5_default.yaml" doc="Kinematics config file used for calibration correction. This will be used to verify the robot's calibration is matching the robot_description."/>
<arg name="kinematics_config_b" default="$(find ur_description)/config/ur5_default.yaml" doc="Kinematics config file used for calibration correction. This will be used to verify the robot's calibration is matching the robot_description."/>
<!-- Parameters that are shared between a_bot and b_bot -->
<arg name="headless_mode" default="false" doc="Automatically send URScript to robot to execute. On e-Series this does require the robot to be in 'remote-control' mode. With this, the URCap is not needed on the robot."/>
<arg name="controllers" default="joint_state_controller scaled_pos_traj_controller speed_scaling_state_controller force_torque_sensor_controller" doc="Controllers that are activated by default."/>
<arg name="stopped_controllers" default="pos_traj_controller" doc="Controllers that are initally loaded, but not started."/>
<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."/>
<arg name="tool_parity" default="0" doc="Parity configuration used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_baud_rate" default="115200" doc="Baud rate used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_stop_bits" default="1" doc="Number of stop bits used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_rx_idle_chars" default="1.5" doc="Number of idle chars in RX channel used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tx_idle_chars" default="3.5" doc="Number of idle chars in TX channel used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="controller_config_file" default="$(find ur_robot_driver)/config/ur5_controllers.yaml" doc="Config file used for defining the ROS-Control controllers."/>
<arg name="robot_description_file" default="$(find ur_description)/launch/ur5_upload.launch" doc="Robot description launch file."/>
<arg name="urscript_file" default="$(find ur_robot_driver)/resources/servoj.urscript" doc="Path to URScript that will be sent to the robot and that forms the main control program."/>
<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="limited" default="false" doc="Use the description in limited mode (Every axis rotates from -PI to PI)"/>
<!-- GDB functionality -->
<arg name="debug" default="false" doc="If set to true, will start the driver inside gdb" />
<arg unless="$(arg debug)" name="launch_prefix" value="" />
<arg if="$(arg debug)" name="launch_prefix" value="gdb --ex run --args" />
<!-- Load hardware interface -->
<node name="b_bot_ur_driver" pkg="ur_robot_driver" type="ur_robot_driver_node" output="screen" launch-prefix="$(arg launch_prefix)" required="true">
<param name="tf_prefix" value="b_bot_"/>
<param name="robot_ip" type="str" value="$(arg robot_ip_b)"/>
<param name="reverse_port" type="int" value="$(arg reverse_port_b)"/>
<param name="script_sender_port" type="int" value="$(arg script_sender_port_b)"/>
<rosparam command="load" file="$(arg kinematics_config_a)" />
<param name="script_file" value="$(arg urscript_file)"/>
<param name="output_recipe_file" value="$(arg rtde_output_recipe_file)"/>
<param name="input_recipe_file" value="$(arg rtde_input_recipe_file)"/>
<param name="headless_mode" value="$(arg headless_mode)"/>
<param name="use_tool_communication" value="$(arg use_tool_communication_b)"/>
<param name="tool_voltage" value="$(arg tool_voltage)"/>
<param name="tool_parity" value="$(arg tool_parity)"/>
<param name="tool_baud_rate" value="$(arg tool_baud_rate)"/>
<param name="tool_stop_bits" value="$(arg tool_stop_bits)"/>
<param name="tool_rx_idle_chars" value="$(arg tool_rx_idle_chars)"/>
<param name="tool_tx_idle_chars" value="$(arg tool_tx_idle_chars)"/>
</node>
<!-- Starts socat to bridge the b_bot's tool communication interface to a local tty device -->
<!-- TODO: Does the name need to be changed to work with multiple robots? Where to set this? What about roscontrol? -->
<!-- TODO: The two robots might need to be namespaced. -->
<node if="$(arg use_tool_communication_b)" name="ur_tool_communication_bridge" pkg="ur_robot_driver" type="tool_communication" respawn="false" output="screen">
<param name="robot_ip" value="$(arg robot_ip_b)"/>
<param name="reverse_port" type="int" value="$(arg reverse_port_b)"/>
<param name="script_sender_port" type="int" value="$(arg script_sender_port_b)"/>
<param name="device_name" value="$(arg tool_device_name_b)"/>
<param name="tcp_port" value="$(arg tool_tcp_port_b)"/>
</node>
<!-- Load controller settings -->
<rosparam file="$(arg controller_config_file)" command="load"/>
<!-- spawn controller manager -->
<node name="ros_control_controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" args="$(arg controllers)" />
<!-- load other controller -->
<node name="ros_control_stopped_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" args="--stopped $(arg stopped_controllers)" />
<node name="controller_stopper" pkg="controller_stopper" type="node" respawn="false" output="screen">
<remap from="robot_running" to="b_bot_ur_driver/robot_program_running"/>
<rosparam param="consistent_controllers">
- "joint_state_controller"
- "speed_scaling_state_controller"
- "force_torque_sensor_controller"
</rosparam>
</node>
<!-- Make sure to start this in the namespace of the hardware interface -->
<node ns="b_bot_ur_driver" name="ur_robot_state_helper" pkg="ur_robot_driver" type="robot_state_helper" respawn="false" output="screen">
</node>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment