Skip to content

Commit ca2b11c

Browse files
author
Felix Exner
authored
Merge branch 'master' into staging
2 parents 1117ddb + e9366f6 commit ca2b11c

File tree

12 files changed

+225
-18
lines changed

12 files changed

+225
-18
lines changed

README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ it is not a catkin package and therefore requires a different treatment when bei
116116
workspace. See The alternative build method below if you'd like to build the library from source.
117117

118118
If you don't want to build the library from source, it is available as a binary package through the
119-
ROS distribution of ROS kinetic, melodic and noetic. It will be installed automatically if you
119+
ROS distribution of ROS melodic and noetic. It will be installed automatically if you
120120
follow the steps below. If you'd like to also build the library from source, please follow the steps
121121
explained in the [next section](#alternative-all-source-build).
122122

@@ -163,18 +163,6 @@ $ catkin_make_isolated
163163
$ source devel_isolated/setup.bash
164164
```
165165

166-
### Note for noetic users
167-
If you are using ROS noetic, make sure to also clone [`ur_msgs`](https://github.com/ros-industrial/ur_msgs) to your workspace as it is currently not released for ROS noetic (see https://github.com/ros-industrial/ur_msgs/issues/13).
168-
```
169-
$ git clone https://github.com/ros-industrial/ur_msgs.git src/ur_msgs
170-
```
171-
172-
Otherwise you will get build errors such as
173-
```
174-
error: ‘ur_msgs::SetPayload::Request {aka struct ur_msgs::SetPayloadRequest_<std::allocator<void> >}’ has no member named ‘center_of_gravity’
175-
```
176-
177-
178166
## Setting up a UR robot for ur_robot_driver
179167
### Prepare the robot
180168
For using the *ur_robot_driver* with a real robot you need to install the
@@ -257,6 +245,12 @@ Use this with any client interface such as [MoveIt!](https://moveit.ros.org/) or
257245
rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller
258246
```
259247

248+
You may need to install rqt_joint_trajectory_controller by running:
249+
```
250+
sudo apt install ros-<ROS-DISTRO>-rqt-joint-trajectory-controller
251+
```
252+
where ROS-DISTRO will be replaced with your version of ROS.
253+
260254
For a more elaborate tutorial on how to get started, please see the
261255
[usage example](ur_robot_driver/doc/usage_example.md).
262256

ur_calibration/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ add_compile_options(-std=c++11)
66

77
find_package(catkin REQUIRED COMPONENTS
88
roscpp
9+
ur_robot_driver
910
)
1011
find_package(Eigen3 REQUIRED)
1112
find_package(yaml-cpp REQUIRED)
@@ -17,6 +18,7 @@ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
1718
catkin_package(
1819
CATKIN_DEPENDS
1920
roscpp
21+
ur_robot_driver
2022
DEPENDS
2123
YAML_CPP
2224
ur_client_library

ur_calibration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ respective launchfile in the driver:
5353
```bash
5454
# Replace your actual catkin_ws folder
5555
$ cd <catkin_ws>/src/example_organization_ur_launch/launch
56-
$ roscp ur_client_library ur10_bringup.launch ex-ur10-1.launch
56+
$ roscp ur_robot_driver ur10_bringup.launch ex-ur10-1.launch
5757
```
5858

5959
Next, modify the parameter section of the new launchfile to match your actual calibration:

ur_calibration/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<depend>roscpp</depend>
5454
<depend>ur_client_library</depend>
5555
<depend>yaml-cpp</depend>
56+
<depend>ur_robot_driver</depend>
5657

5758

5859
<test_depend>rosunit</test_depend>

ur_calibration/src/calibration_correction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include <ur_client_library/primary/package_header.h>
3636
#include <ur_client_library/primary/primary_parser.h>
3737

38+
#include <ur_robot_driver/urcl_log_handler.h>
39+
3840
#include <sensor_msgs/JointState.h>
3941
#include <tf/transform_listener.h>
4042
#include <ros/package.h>
@@ -163,6 +165,8 @@ int main(int argc, char* argv[])
163165
ros::init(argc, argv, "ur_calibration");
164166
ros::NodeHandle nh("~");
165167

168+
ur_driver::registerUrclLogHandler();
169+
166170
try
167171
{
168172
CalibrationCorrection my_calibration_correction(nh);

ur_robot_driver/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ catkin_package(
4040
include
4141
LIBRARIES
4242
ur_robot_driver_plugin
43+
urcl_log_handler
4344
CATKIN_DEPENDS
4445
actionlib
4546
controller_manager
@@ -96,19 +97,24 @@ add_library(ur_robot_driver_plugin
9697
target_link_libraries(ur_robot_driver_plugin ur_client_library::urcl ${catkin_LIBRARIES})
9798
add_dependencies(ur_robot_driver_plugin ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
9899

100+
add_library(urcl_log_handler
101+
src/urcl_log_handler.cpp
102+
)
103+
target_link_libraries(urcl_log_handler ${catkin_LIBRARIES} ur_client_library::urcl)
104+
99105
add_executable(ur_robot_driver_node
100106
src/dashboard_client_ros.cpp
101107
src/hardware_interface.cpp
102108
src/hardware_interface_node.cpp
103109
)
104-
target_link_libraries(ur_robot_driver_node ${catkin_LIBRARIES} ur_client_library::urcl)
110+
target_link_libraries(ur_robot_driver_node ${catkin_LIBRARIES} ur_client_library::urcl urcl_log_handler)
105111
add_dependencies(ur_robot_driver_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
106112

107113
add_executable(dashboard_client
108114
src/dashboard_client_ros.cpp
109115
src/dashboard_client_node.cpp
110116
)
111-
target_link_libraries(dashboard_client ${catkin_LIBRARIES} ur_client_library::urcl)
117+
target_link_libraries(dashboard_client ${catkin_LIBRARIES} ur_client_library::urcl urcl_log_handler)
112118
add_dependencies(dashboard_client ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
113119

114120
add_executable(robot_state_helper
@@ -125,7 +131,7 @@ if(CATKIN_ENABLE_TESTING)
125131
endif()
126132

127133

128-
install(TARGETS ur_robot_driver_plugin ur_robot_driver_node robot_state_helper dashboard_client
134+
install(TARGETS ur_robot_driver_plugin urcl_log_handler ur_robot_driver_node robot_state_helper dashboard_client
129135
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
130136
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
131137
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// -- BEGIN LICENSE BLOCK ----------------------------------------------
2+
// Copyright 2021 Universal Robots A/S
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
// All source code contained in and/or linked to in this message (the “Source Code”) is subject to the copyright of
17+
// Universal Robots A/S and/or its licensors. THE SOURCE CODE IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EXPRESS
18+
// OR IMPLIED, INCLUDING – BUT NOT LIMITED TO – WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
19+
// NONINFRINGEMENT. USE OF THE SOURCE CODE IS AT YOUR OWN RISK AND UNIVERSAL ROBOTS A/S AND ITS LICENSORS SHALL, TO THE
20+
// MAXIMUM EXTENT PERMITTED BY LAW, NOT BE LIABLE FOR ANY ERRORS OR MALICIOUS CODE IN THE SOURCE CODE, ANY THIRD-PARTY
21+
// CLAIMS, OR ANY OTHER CLAIMS AND DAMAGES, INCLUDING INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES,
22+
// OR ANY LOSS OF PROFITS, EXPECTED SAVINGS, OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA,
23+
// USE, GOODWILL, OR OTHER INTANGIBLE LOSSES, RESULTING FROM YOUR USE OF THE SOURCE CODE. You may make copies of the
24+
// Source Code for use in connection with a Universal Robots or UR+ product, provided that you include (i) an
25+
// appropriate copyright notice (“© [the year in which you received the Source Code or the Source Code was first
26+
// published, e.g. “2021”] Universal Robots A/S and/or its licensors”) along with the capitalized section of this notice
27+
// in all copies of the Source Code. By using the Source Code, you agree to the above terms. For more information,
28+
// please contact [email protected].
29+
// -- END LICENSE BLOCK ------------------------------------------------
30+
31+
#ifndef UR_DRIVER_URCL_LOG_HANDLER_H_INCLUDED
32+
#define UR_DRIVER_URCL_LOG_HANDLER_H_INCLUDED
33+
34+
#include <ur_client_library/log.h>
35+
36+
namespace ur_driver
37+
{
38+
/*!
39+
* \brief Loghandler for handling messages logged with the C++ client library. This loghandler will log the messages
40+
* from the client library with ROS logging.
41+
* Use registerLogHandler to register this class. This class shouldn't be instantiated directly.
42+
*/
43+
class UrclLogHandler : public urcl::LogHandler
44+
{
45+
public:
46+
/*!
47+
* \brief Default constructor
48+
*/
49+
UrclLogHandler();
50+
51+
/*!
52+
* \brief Function to log a message
53+
*
54+
* \param file The log message comes from this file
55+
* \param line The log message comes from this line
56+
* \param loglevel Indicates the severity of the log message
57+
* \param log Log message
58+
*/
59+
void log(const char* file, int line, urcl::LogLevel loglevel, const char* message) override;
60+
61+
private:
62+
std::string log_name_;
63+
64+
void logMessage(const char* file, int line, ros::console::Level level, const char* message);
65+
};
66+
67+
/*!
68+
* \brief Register the UrclLoghHandler, this will start logging messages from the client library with RPS2 logging.
69+
* This function has to be called inside your node, to enable the log handler.
70+
*/
71+
void registerUrclLogHandler();
72+
73+
/*!
74+
* \brief Unregister the UrclLoghHandler, stop logging messages from the client library with ROS2 logging.
75+
*/
76+
void unregisterUrclLogHandler();
77+
78+
} // namespace ur_driver
79+
80+
#endif // UR_DRIVER_URCL_LOG_HANDLER_H_INCLUDED

ur_robot_driver/launch/ur_control.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<arg name="trajectory_port" default="50003" doc="Port that will be opened by the driver to allow trajectory forwarding."/>
1616
<arg name="kinematics_config" doc="Kinematics config file used for calibration correction. This will be used to verify the robot's calibration is matching the robot_description. Pass the same config file that is passed to the robot_description."/>
1717
<arg name="tf_prefix" default="" doc="tf_prefix used for the robot."/>
18-
<arg name="controllers" default="joint_state_controller vel_based_pos_joint_traj_controller force_torque_sensor_controller robot_status_controller"/>
18+
<arg name="controllers" default="joint_state_controller scaled_pos_joint_traj_controller force_torque_sensor_controller robot_status_controller"/>
1919
<arg name="stopped_controllers" default="joint_group_vel_controller forward_joint_traj_controller forward_cartesian_traj_controller"/>
2020
<arg name="urscript_file" default="$(find ur_client_library)/resources/external_control.urscript" doc="Path to URScript that will be sent to the robot and that forms the main control program."/>
2121
<arg name="rtde_output_recipe_file" default="$(find ur_robot_driver)/resources/rtde_output_recipe.txt" doc="Recipe file used for the RTDE-outputs. Only change this if you know what you're doing."/>

ur_robot_driver/scripts/tool_communication

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
#!/usr/bin/env python
22
"""Small helper script to start the tool communication interface"""
33

4+
# -- BEGIN LICENSE BLOCK ----------------------------------------------
5+
# Copyright 2019 FZI Forschungszentrum Informatik
6+
# Created on behalf of Universal Robots A/S
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# 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,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
# -- END LICENSE BLOCK ------------------------------------------------
20+
421
import subprocess
522
import rospy
623

ur_robot_driver/src/dashboard_client_node.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@
2929
#include <ros/ros.h>
3030
#include <ur_robot_driver/dashboard_client_ros.h>
3131

32+
#include <ur_robot_driver/urcl_log_handler.h>
33+
3234
int main(int argc, char** argv)
3335
{
3436
// Set up ROS.
3537
ros::init(argc, argv, "dashboard_client");
3638
ros::NodeHandle priv_nh("~");
3739

40+
ur_driver::registerUrclLogHandler();
41+
3842
// The IP address under which the robot is reachable.
3943
std::string robot_ip = priv_nh.param<std::string>("robot_ip", "192.168.56.101");
4044

0 commit comments

Comments
 (0)