22
33Alpha version of the ROS2 Universal Robots driver. Should be transferred to the Universal Robots org when ready.
44
5+ ## Requirements
6+
7+ Follow the [ instructions] ( https://github.com/UniversalRobots/Universal_Robots_ROS_Driver#setting-up-a-ur-robot-for-ur_robot_driver ) in the paragraph
8+ [ ` Prepare the robot ` ] ( https://github.com/UniversalRobots/Universal_Robots_ROS_Driver#prepare-the-robot )
9+
510## Build Instructions
611
7- To build this package in a ROS Foxy workspace, clone this repo
8- into the ` src/ ` directory, then:
12+ To build this package follow the [ instructions] ( https://index.ros.org/doc/ros2/Tutorials/Workspace/Creating-A-Workspace/ ) for installation of ROS2.
13+
14+ After installation create a ROS Foxy workspace:
15+ ```
16+ cd $HOME
17+ mkdir -p ws_driver/src
18+ cd ws_driver
19+ source /opt/ros/$ROS_DISTRO/setup.bash
20+
21+ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
22+
23+ ```
24+
25+ Clone this repo into the ` src/ ` directory, then:
926
1027```
1128# Clone source-based dependencies into src/ directory
@@ -18,3 +35,44 @@ rosdep install -y --rosdistro $ROS_DISTRO --ignore-src --from-paths src
1835source /opt/ros/$ROS_DISTRO/setup.bash
1936colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
2037```
38+ Source the workspace:
39+
40+ ```
41+ cd ~/ws_driver
42+ source install/setup.bash
43+ ```
44+
45+ Start the driver:
46+
47+ ```
48+ ros2 launch ur_ros2_control_demos ur5_3_system_position_only.launch.py
49+ ```
50+
51+ Start the ` joint_state_controller ` :
52+
53+ ```
54+ ros2 control load_start_controller joint_state_controller
55+ ```
56+
57+ Start the ` forward_command_controller ` :
58+
59+ ```
60+ ros2 control load_start_controller forward_command_controller_position
61+ ```
62+
63+ ## TODO Run a test node (TBD)
64+ Run a test node which will publish joint commands on /forward_command_controller_position/commands (std_msgs::msg::Float64MultiArray)
65+ after checking the current joint states (to create minimal increment for safety)
66+
67+ USE WITH CAUTION!!!
68+ Other option is to publish commands directly. In this case make sure the published command will not take your
69+ robot in collision with environment/people.
70+ ```
71+ ros2 topic pub /forward_command_controller_position/commands std_msgs/msg/Float64MultiArray "data:
72+ - 0.0
73+ - 0.0
74+ - 0.0
75+ - 0.0
76+ - 0.0
77+ - 0.01"
78+ ```
0 commit comments