Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for improvement of primary interface #600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur10_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<arg name="robot_description_file" default="$(find ur_description)/launch/load_ur10.launch" doc="Robot description launch file."/>
<arg name="kinematics_config" default="$(find ur_description)/config/ur10/default_kinematics.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="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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true">
Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur10e_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<arg name="tool_device_name" default="/tmp/ttyUR" doc="Local device name used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tcp_port" default="54321" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true"/>
Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur16e_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<arg name="tool_device_name" default="/tmp/ttyUR" doc="Local device name used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tcp_port" default="54321" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true"/>
Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur3_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<arg name="robot_description_file" default="$(find ur_description)/launch/load_ur3.launch" doc="Robot description launch file."/>
<arg name="kinematics_config" default="$(find ur_description)/config/ur3/default_kinematics.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="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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true">
Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur3e_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<arg name="tool_device_name" default="/tmp/ttyUR" doc="Local device name used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tcp_port" default="54321" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true"/>
Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur5_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<arg name="robot_description_file" default="$(find ur_description)/launch/load_ur5.launch" doc="Robot description launch file."/>
<arg name="kinematics_config" default="$(find ur_description)/config/ur5/default_kinematics.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="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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true">
Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/launch/ur5e_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<arg name="tool_device_name" default="/tmp/ttyUR" doc="Local device name used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tcp_port" default="54321" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true" />
Expand Down
4 changes: 3 additions & 1 deletion ur_robot_driver/launch/ur_common.launch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<arg name="tool_tcp_port" default="54321" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<arg name="robot_description_file" doc="Robot description launch file."/>
<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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>

<!-- robot model -->
Expand Down Expand Up @@ -56,6 +57,7 @@
<arg name="tool_tx_idle_chars" value="$(arg tool_tx_idle_chars)"/>
<arg name="tool_device_name" value="$(arg tool_device_name)"/>
<arg name="tool_tcp_port" value="$(arg tool_tcp_port)"/>
<arg name="ur_hardware_interface_node_required" value="$(arg ur_hardware_interface_node_required)"/>
<arg name="simulated_robot" value="$(arg simulated_robot)"/>
<arg name="ur_hardware_interface_node_required" value="$(arg ur_hardware_interface_node_required)"/>
</include>
</launch>
2 changes: 2 additions & 0 deletions ur_robot_driver/launch/ur_control.launch
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<arg name="tool_device_name" default="/tmp/ttyUR" doc="Local device name used for tool communication. Only used, when `use_tool_communication` is set to true."/>
<arg name="tool_tcp_port" default="54321" doc="Port on which the robot controller publishes the tool comm interface. Only used, when `use_tool_communication` is set to true."/>
<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="simulated_robot" default="false" doc="Determine whether the robot to control is simulated or not."/>
<arg name="servoj_gain" default="2000" doc="Specify gain for servoing to position in joint space. A higher gain can sharpen the trajectory."/>
<arg name="servoj_lookahead_time" default="0.03" doc="Specify lookahead time for servoing to position in joint space. A longer lookahead time can smooth the trajectory."/>
<arg name="ur_hardware_interface_node_required" default="true" doc="Shut down ros environment if ur_hardware_interface-node dies."/>
Expand All @@ -56,6 +57,7 @@
<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)"/>
<param name="simulated_robot" value="$(arg simulated_robot)"/>
<param name="servoj_gain" value="$(arg servoj_gain)"/>
<param name="servoj_lookahead_time" value="$(arg servoj_lookahead_time)"/>
</node>
Expand Down
22 changes: 7 additions & 15 deletions ur_robot_driver/src/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
// endeffector might be inaccurate. See the "ur_calibration" package on help how to generate your
// own hash matching your actual robot.
std::string calibration_checksum = robot_hw_nh.param<std::string>("kinematics/hash", "");
bool simulated_robot = false;
if (!robot_hw_nh.getParam("simulated_robot", simulated_robot))
{
ROS_ERROR_STREAM("Required parameter " << robot_hw_nh.resolveName("simulated_robot") << " not given.");
return false;
}
ROS_INFO_STREAM("Initializing dashboard client");
ros::NodeHandle dashboard_nh(robot_hw_nh, "dashboard");
dashboard_client_.reset(new DashboardClientROS(dashboard_nh, robot_ip_));
Expand All @@ -286,7 +292,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
ur_driver_.reset(new urcl::UrDriver(
robot_ip_, script_filename, output_recipe_filename, input_recipe_filename,
std::bind(&HardwareInterface::handleRobotProgramState, this, std::placeholders::_1), headless_mode,
std::move(tool_comm_setup), (uint32_t)reverse_port, (uint32_t)script_sender_port, servoj_gain,
std::move(tool_comm_setup), calibration_checksum, simulated_robot, (uint32_t)reverse_port, (uint32_t)script_sender_port, servoj_gain,
servoj_lookahead_time, non_blocking_read_, reverse_ip, trajectory_port, script_command_port));
}
catch (urcl::ToolCommNotAvailable& e)
Expand All @@ -299,20 +305,6 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
ROS_FATAL_STREAM(e.what());
return false;
}
URCL_LOG_INFO("Checking if calibration data matches connected robot.");
if (ur_driver_->checkCalibration(calibration_checksum))
{
ROS_INFO_STREAM("Calibration checked successfully.");
}
else
{
ROS_ERROR_STREAM("The calibration parameters of the connected robot don't match the ones from the given kinematics "
"config file. Please be aware that this can lead to critical inaccuracies of tcp positions. Use "
"the ur_calibration tool to extract the correct calibration from the robot and pass that into the "
"description. See "
"[https://github.com/UniversalRobots/Universal_Robots_ROS_Driver#extract-calibration-information] "
"for details.");
}
ur_driver_->registerTrajectoryDoneCallback(
std::bind(&HardwareInterface::passthroughTrajectoryDoneCb, this, std::placeholders::_1));

Expand Down
1 change: 1 addition & 0 deletions ur_robot_driver/test/driver.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<include file="$(find ur_robot_driver)/launch/$(arg robot_type)_bringup.launch">
<arg name="robot_ip" value="$(arg robot_ip)"/>
<arg name="headless_mode" value="true"/>
<arg name="simulated_robot" value="true"/>
<arg name="stopped_controllers" value="forward_joint_traj_controller forward_cartesian_traj_controller twist_controller pose_based_cartesian_traj_controller joint_based_cartesian_traj_controller"/>
</include>

Expand Down