Skip to content

Commit f84e407

Browse files
committed
Start dashboard client from within the hardware interface
1 parent 99987db commit f84e407

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

ur_robot_driver/include/ur_robot_driver/hardware_interface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* \author Lovro Ivanov [email protected]
2323
* \author Andy Zelenak [email protected]
24+
* \author Marvin Große Besselmann [email protected]
2425
* \date 2019-04-11
2526
*
2627
*/
@@ -154,6 +155,7 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
154155
double pausing_ramp_up_increment_;
155156

156157
std::unique_ptr<urcl::UrDriver> ur_driver_;
158+
std::unique_ptr<ur_robot_driver::DashboardClientROS> dashboard_client_;
157159
};
158160
} // namespace ur_robot_driver
159161

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,12 @@ return_type URPositionHardwareInterface::start()
272272
tool_comm_setup->setTxIdleChars(tx_idle_chars);
273273
}
274274

275-
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"), "Initializing driver...");
276275

276+
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"), "Starting Dashboard Client");
277+
rclcpp::Node::SharedPtr dashboard_node = rclcpp::Node::make_shared("ur_dashboard_client");
278+
dashboard_client_.reset(new ur_robot_driver::DashboardClientROS(dashboard_node, robot_ip));
279+
280+
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"), "Initializing driver...");
277281
try
278282
{
279283
ur_driver_ = std::make_unique<urcl::UrDriver>(

ur_ros2_control_demos/launch/ur5_e_system_position_only.launch.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,5 @@ def generate_launch_description():
140140
},
141141
)
142142

143-
dashboard_client_node = Node(
144-
package="ur_robot_driver",
145-
executable="dashboard_client",
146-
name="dashboard_client",
147-
output="screen",
148-
emulate_tty=True,
149-
parameters=[
150-
{"robot_ip": "10.0.1.186"}
151-
]
152-
)
153-
154-
return LaunchDescription([ros2_control_node, dashboard_client_node, rviz_node, robot_state_pub_node, static_tf])
143+
return LaunchDescription([ros2_control_node, rviz_node, robot_state_pub_node, static_tf])
155144

0 commit comments

Comments
 (0)