Skip to content

Commit e01783e

Browse files
authored
Merge pull request #21 from NASA-JSC-Robotics/add-ur-gui
Add ur gui
2 parents 585db32 + ed9fe7f commit e01783e

File tree

5 files changed

+192
-6
lines changed

5 files changed

+192
-6
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ ros2 launch clr_deploy clr_sim.launch.py model_env:=true
2525
For hardware we run the UR pendantless, which is a two part launch process:
2626

2727
```bash
28-
# To launch the hardware robot, first deploy the UR tools to activate the dashboard client
29-
# in its own long-lived shell.
30-
ros2 launch chonkur_deploy ur_tools.launch.py
28+
# To launch the hardware robot, first deploy chonkur communications to activate the dashboard client
29+
# in its own long-lived shell on the controls machine.
30+
ros2 launch chonkur_deploy chonkur_comm.launch.py
3131

32-
# Start the hardware interfaces for the rail, lift, and ChonkUR.
32+
# On the console machine, launch the UR GUI, which handles most operations that normally occur on the UR pendant
33+
ros2 launch chonkur_deploy chonkur_gui.launch.py
34+
35+
# Back on the controls machine, after reading the UR arm
36+
# Start the hardware interfaces for the rail, lift, and ChonkUR
3337
ros2 launch clr_deploy clr_hw.launch.py
3438
```
3539

@@ -52,6 +56,7 @@ ros2 launch clr_mujoco_config clr_mujoco.launch.py
5256
# In another shell launch the moveit interface with sim parameters set
5357
ros2 launch clr_moveit_config clr_moveit.launch.py include_mockups_in_description:=true use_sim_time:=true
5458
```
59+
5560
## Citation
5661

5762
This project falls under the purview of the iMETRO project.

chonkur/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ For hardware we run the UR pendantless, which is a two part launch process:
2727

2828
```bash
2929
# To launch the hardware robot, first deploy the UR tools to activate the dashboard client
30-
# in its own long-lived shell.
31-
ros2 launch chonkur_deploy ur_tools.launch.py
30+
# in its own long-lived shell on the controls machine.
31+
ros2 launch chonkur_deploy chonkur_comm.launch.py
3232

3333
# Then start the hardware interface.
3434
ros2 launch chonkur_deploy chonkur_hw.launch.py
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
drt_ur_gui:
2+
ros__parameters:
3+
program: "ext_ctrl.urp"
4+
window.name: "DRT UR Remote Commander: Single Arm Testing Configuration"
5+
window.stylesheet: |
6+
QMainWindow {
7+
background-color: darkgrey;
8+
color: #000000;
9+
}
10+
QPlainTextEdit {
11+
background-color: lightgrey;
12+
color: #000000;
13+
font-size: 8px;
14+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Copyright (c) 2025, United States Government, as represented by the
4+
# Administrator of the National Aeronautics and Space Administration.
5+
#
6+
# All rights reserved.
7+
#
8+
# This software is licensed under the Apache License, Version 2.0
9+
# (the "License"); you may not use this file except in compliance with the
10+
# License. You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17+
# License for the specific language governing permissions and limitations
18+
# under the License.
19+
20+
from launch import LaunchDescription
21+
from launch.actions import DeclareLaunchArgument
22+
from launch.substitutions import LaunchConfiguration
23+
from launch_ros.actions import Node
24+
25+
26+
def generate_launch_description():
27+
28+
# Declare arguments
29+
declared_arguments = []
30+
declared_arguments.append(
31+
DeclareLaunchArgument(
32+
"namespace",
33+
default_value="",
34+
description="Namespace for the robot.",
35+
)
36+
)
37+
declared_arguments.append(
38+
DeclareLaunchArgument(
39+
"headless_mode",
40+
default_value="true",
41+
description="Enable headless mode for robot control",
42+
)
43+
)
44+
declared_arguments.append(
45+
DeclareLaunchArgument(
46+
"robot_ip",
47+
default_value="192.168.1.102",
48+
description="IP address by which the robot can be reached.",
49+
)
50+
)
51+
declared_arguments.append(
52+
DeclareLaunchArgument(
53+
"hande_dev_name",
54+
default_value="/tmp/ttyUR",
55+
description="File descriptor that will be generated for the tool communication device. "
56+
"The user has be be allowed to write to this location. ",
57+
)
58+
)
59+
declared_arguments.append(
60+
DeclareLaunchArgument(
61+
"tool_tcp_port",
62+
default_value="54321",
63+
description="Remote port that will be used for bridging the tool's serial device.",
64+
)
65+
)
66+
67+
# Initialize Arguments
68+
namespace = LaunchConfiguration("namespace")
69+
headless_mode = LaunchConfiguration("headless_mode")
70+
robot_ip = LaunchConfiguration("robot_ip")
71+
hande_dev_name = LaunchConfiguration("hande_dev_name")
72+
tool_tcp_port = LaunchConfiguration("tool_tcp_port")
73+
74+
robot_state_helper_node = Node(
75+
package="ur_robot_driver",
76+
executable="robot_state_helper",
77+
name="ur_robot_state_helper",
78+
output="both",
79+
parameters=[
80+
{"headless_mode": headless_mode},
81+
{"robot_ip": robot_ip},
82+
],
83+
)
84+
85+
ur_dashboard_client = Node(
86+
package="ur_robot_driver",
87+
executable="dashboard_client",
88+
name="dashboard_client",
89+
output="both",
90+
parameters=[{"robot_ip": robot_ip}],
91+
)
92+
93+
hande_comm_node = Node(
94+
name="ur_tool_communication_hande",
95+
package="ur_robot_driver",
96+
executable="tool_communication.py",
97+
namespace=namespace,
98+
output="both",
99+
parameters=[
100+
{
101+
"robot_ip": robot_ip,
102+
"tcp_port": tool_tcp_port,
103+
"device_name": hande_dev_name,
104+
}
105+
],
106+
)
107+
108+
nodes = [robot_state_helper_node, ur_dashboard_client, hande_comm_node]
109+
110+
return LaunchDescription(declared_arguments + nodes)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Copyright (c) 2025, United States Government, as represented by the
4+
# Administrator of the National Aeronautics and Space Administration.
5+
#
6+
# All rights reserved.
7+
#
8+
# This software is licensed under the Apache License, Version 2.0
9+
# (the "License"); you may not use this file except in compliance with the
10+
# License. You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17+
# License for the specific language governing permissions and limitations
18+
# under the License.
19+
20+
import os
21+
22+
from launch import LaunchDescription
23+
from launch.actions import DeclareLaunchArgument
24+
from launch.substitutions import LaunchConfiguration
25+
from chonkur_deploy.launch_helpers import include_launch_file
26+
from ament_index_python.packages import get_package_share_directory
27+
28+
29+
def generate_launch_description():
30+
31+
# Declare arguments
32+
declared_arguments = []
33+
declared_arguments.append(
34+
DeclareLaunchArgument(
35+
"namespace",
36+
default_value="",
37+
description="Namespace for the robot.",
38+
)
39+
)
40+
41+
# Initialize Arguments
42+
namespace = LaunchConfiguration("namespace")
43+
44+
gui_config_path = os.path.join(get_package_share_directory("chonkur_deploy"), "config", "drt_ur_gui_config.yaml")
45+
46+
ur_gui = include_launch_file(
47+
package_name="drt_ur_gui",
48+
launch_file="one_arm.launch.py",
49+
launch_arguments={
50+
"ns": namespace,
51+
"config_file_path": gui_config_path,
52+
}.items(),
53+
)
54+
55+
nodes = [ur_gui]
56+
57+
return LaunchDescription(declared_arguments + nodes)

0 commit comments

Comments
 (0)