Skip to content

Commit 7a38912

Browse files
committed
Add deprecation warning for tool comm script
This will be removed in ROS M
1 parent b5e3278 commit 7a38912

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

ur_robot_driver/scripts/tool_communication.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from pathlib import Path
3636
from ament_index_python.packages import get_package_prefix
3737

38+
3839
class UrToolCommunication(Node):
3940
"""
4041
Wrapper node for tool communication.
@@ -47,6 +48,11 @@ class UrToolCommunication(Node):
4748
def __init__(self):
4849
super().__init__("ur_tool_communication")
4950

51+
self.get_logger().warning(
52+
"[DEPRECATION_WARNING] This node is deprecated and will be removed in ROS M. "
53+
"Please use the ur_client_library tool_communication.py script directly."
54+
)
55+
5056
self.get_logger().info("Initializing tool communication wrapper node")
5157

5258
# IP address of the robot
@@ -62,25 +68,32 @@ def __init__(self):
6268

6369
# Path where the refactored (canonical) tool_communication script is located
6470
ur_client_lib_prefix = get_package_prefix("ur_client_library")
65-
tool_comm_script = Path(ur_client_lib_prefix) / "lib" / "ur_client_library" / "tool_communication.py"
71+
tool_comm_script = (
72+
Path(ur_client_lib_prefix) / "lib" / "ur_client_library" / "tool_communication.py"
73+
)
6674

6775
# Pass the arguments to the refactored script
6876
cmd = [
6977
str(tool_comm_script),
70-
robot_ip,
71-
"--tcp-port", str(tcp_port),
72-
"--device-name", device_name,
78+
robot_ip,
79+
"--tcp-port",
80+
str(tcp_port),
81+
"--device-name",
82+
device_name,
7383
]
7484

75-
self.get_logger().info("Launching tool communication via ur_client_library tool_communication.py")
85+
self.get_logger().info(
86+
"Launching tool communication via ur_client_library tool_communication.py"
87+
)
7688

7789
subprocess.call(cmd)
7890

91+
7992
def main():
8093
rclpy.init()
8194
node = UrToolCommunication()
8295
rclpy.spin(node)
8396

8497

8598
if __name__ == "__main__":
86-
main()
99+
main()

0 commit comments

Comments
 (0)