Skip to content

Commit 72453e1

Browse files
carebare47carebare47
andauthored
Add prefix to wrench hw interface (UniversalRobots#217)
Use a parameter to set the wrench name This name will be picked up by the `force_torque_sensor_controller` in order to name the respective topic. Co-authored-by: carebare47 <[email protected]>
1 parent 83c5e8c commit 72453e1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ur_robot_driver/doc/ROS_INTERFACE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Controllers that are initally loaded, but not started.
5858

5959
tf_prefix used for the robot.
6060

61+
##### wrench_frame_id (default: "wrench")
62+
63+
Parameter to set the id of the wrench frame, required if using multiple robots
64+
6165
##### tool_baud_rate (default: "115200")
6266

6367
Baud rate used for tool communication. Only used, when `use_tool_communication` is set to true.

ur_robot_driver/src/ros/hardware_interface.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
6969
joint_velocities_ = { { 0, 0, 0, 0, 0, 0 } };
7070
joint_efforts_ = { { 0, 0, 0, 0, 0, 0 } };
7171
std::string script_filename;
72+
std::string wrench_frame_id;
7273
std::string output_recipe_filename;
7374
std::string input_recipe_filename;
7475

@@ -89,6 +90,9 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
8990
// to publish correct frame names for frames reported by the robot directly.
9091
robot_hw_nh.param<std::string>("tf_prefix", tf_prefix_, "");
9192

93+
// Optional parameter to change the id of the wrench frame
94+
robot_hw_nh.param<std::string>("wrench_frame_id", wrench_frame_id, "wrench");
95+
9296
// Path to the urscript code that will be sent to the robot.
9397
if (!robot_hw_nh.getParam("script_file", script_filename))
9498
{
@@ -309,7 +313,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
309313
ur_controllers::SpeedScalingHandle("speed_scaling_factor", &speed_scaling_combined_));
310314

311315
fts_interface_.registerHandle(hardware_interface::ForceTorqueSensorHandle(
312-
"wrench", tf_prefix_ + "tool0_controller", fts_measurements_.begin(), fts_measurements_.begin() + 3));
316+
wrench_frame_id, tf_prefix_ + "tool0_controller", fts_measurements_.begin(), fts_measurements_.begin() + 3));
313317

314318
robot_status_interface_.registerHandle(industrial_robot_status_interface::IndustrialRobotStatusHandle(
315319
"industrial_robot_status_handle", robot_status_resource_));

0 commit comments

Comments
 (0)