Skip to content

Commit

Permalink
Merge branch 'master' into kinetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Rein Appeldoorn committed Feb 6, 2018
2 parents 07a1b7e + a663a80 commit 0e395b6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ find_package(catkin REQUIRED COMPONENTS
trajectory_msgs
ur_msgs
tf
control_panel_ur
)

## System dependencies are found with CMake's conventions
Expand Down Expand Up @@ -110,7 +111,7 @@ find_package(catkin REQUIRED COMPONENTS
catkin_package(
INCLUDE_DIRS include
# LIBRARIES ur_modern_driver
CATKIN_DEPENDS hardware_interface controller_manager actionlib control_msgs geometry_msgs roscpp sensor_msgs trajectory_msgs ur_msgs
CATKIN_DEPENDS hardware_interface controller_manager actionlib control_msgs geometry_msgs roscpp sensor_msgs trajectory_msgs ur_msgs control_panel_ur
DEPENDS ur_hardware_interface
)

Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<build_depend>ur_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>realtime_tools</build_depend>
<build_depend>control_panel_ur</build_depend>
<run_depend>hardware_interface</run_depend>
<run_depend>controller_manager</run_depend>
<run_depend>ros_controllers</run_depend>
Expand All @@ -66,6 +67,7 @@
<run_depend>ur_description</run_depend>
<run_depend>tf</run_depend>
<run_depend>realtime_tools</run_depend>
<run_depend>control_panel_ur</run_depend>


<!-- The export tag contains other, unspecified, tags -->
Expand Down
16 changes: 16 additions & 0 deletions src/ur_ros_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
#include <controller_manager/controller_manager.h>
#include <realtime_tools/realtime_publisher.h>

/// Ur Dashboard
#include "control_panel_ur/UrDashboard.h"

/// TF
#include <tf/tf.h>
#include <tf/transform_broadcaster.h>
Expand Down Expand Up @@ -853,6 +856,7 @@ int main(int argc, char **argv) {

ros::init(argc, argv, "ur_driver");
ros::NodeHandle nh;

if (ros::param::get("use_sim_time", use_sim_time)) {
print_warning("use_sim_time is set!!");
}
Expand All @@ -876,6 +880,18 @@ int main(int argc, char **argv) {
} else
reverse_port = 50001;

// Wait for the dashboard to be online before starting the driver
{
sr::UrDashboard ur_dashboard;
ur_dashboard.setHostname(host);
while (ros::ok() && !ur_dashboard.initSocketServer())
{
double timeout = 5.0;
ROS_WARN("Could not connect to dashboard, retrying in %.2f seconds", timeout);
ros::Duration(timeout).sleep();
}
}

RosWrapper interface(host, reverse_port);

ros::AsyncSpinner spinner(3);
Expand Down

0 comments on commit 0e395b6

Please sign in to comment.