|
| 1 | +# ur_calibration |
| 2 | + |
| 3 | +Package for extracting the factory calibration from a UR robot and changing it to be used by `ur_description` to gain a correct URDF model. |
| 4 | + |
| 5 | +Each UR robot is calibrated inside the factory giving exact forward and inverse kinematics. To also |
| 6 | +make use of this in ROS, you first have to extract the calibration information from the robot. |
| 7 | + |
| 8 | +Though this step is not necessary, to control the robot using this driver, it is highly recommended |
| 9 | +to do so, as end effector positions might be off in the magnitude of centimeters. |
| 10 | + |
| 11 | +## Nodes |
| 12 | +### calibration_correction |
| 13 | +This node extracts calibration information directly from a robot, calculates the URDF correction and |
| 14 | +saves it into a .yaml file. |
| 15 | + |
| 16 | +In the launch folder of the ur_calibration package is a helper script: |
| 17 | + |
| 18 | +```bash |
| 19 | +$ ros2 launch ur_calibration calibration_correction.launch.py \ |
| 20 | +robot_ip:=<robot_ip> target_filename:="${HOME}/my_robot_calibration.yaml" |
| 21 | +``` |
| 22 | + |
| 23 | +For the parameter `robot_ip` insert the IP address on which the ROS pc can reach the robot. As |
| 24 | +`target_filename` provide an absolute path where the result will be saved to. |
| 25 | + |
| 26 | +## Creating a calibration / launch package for all local robots |
| 27 | +When dealing with multiple robots in one organization it might make sense to store calibration data |
| 28 | +into a package dedicated to that purpose only. To do so, create a new package (if it doesn't already |
| 29 | +exist) |
| 30 | + |
| 31 | +```bash |
| 32 | +# Replace your actual colcon_ws folder |
| 33 | +$ cd <colcon_ws>/src |
| 34 | +$ ros2 pkg create <organization_name>_ur_launch --build-type ament_cmake --dependencies ur_client_library \ |
| 35 | +--description "Package containing calibrations and launch files for our UR robots." |
| 36 | +# Create a skeleton package |
| 37 | +$ mkdir -p <organization_name>_ur_launch/etc |
| 38 | +$ mkdir -p <organization_name>_ur_launch/launch |
| 39 | +$ echo 'install(DIRECTORY etc launch DESTINATION share/${PROJECT_NAME})' >> <organization_name>_ur_launch/CMakeLists.txt |
| 40 | +$ colcon build --packages-select <organization_name>_ur_launch |
| 41 | +``` |
| 42 | + |
| 43 | +We can use the new package to store the calibration data in that package. We recommend naming each |
| 44 | +robot individually, e.g. *ex-ur10-1*. |
| 45 | + |
| 46 | +```bash |
| 47 | +$ ros2 launch ur_calibration calibration_correction.launch.py \ |
| 48 | +robot_ip:=<robot_ip> \ |
| 49 | +target_filename:="$(ros2 pkg prefix <organization_name>_ur_launch)/share/<organization_name>_ur_launch/etc/ex-ur10-1_calibration.yaml" |
| 50 | +``` |
| 51 | + |
| 52 | +To make life easier, we create a launchfile for this particular robot. We base it upon the |
| 53 | +respective launchfile in the driver: |
| 54 | + |
| 55 | +```bash |
| 56 | +# Replace your actual colcon_ws folder |
| 57 | +$ cd <colcon_ws>/src/<organization_name>_ur_launch/launch |
| 58 | +$ cp $(ros2 pkg prefix ur_bringup)/share/ur_bringup/launch/ur_control.launch.py ex-ur10-1.launch.py |
| 59 | +``` |
| 60 | + |
| 61 | +Next, modify the parameter section of the new launchfile to match your actual calibration: |
| 62 | + |
| 63 | +```py |
| 64 | +kinematics_params = PathJoinSubstitution( |
| 65 | + [FindPackageShare("<organization_name>_ur_launch"), "etc", "", "ex-ur10-1_calibration.yaml"] |
| 66 | + ) |
| 67 | + |
| 68 | +``` |
| 69 | + |
| 70 | +Then, anybody cloning this repository can startup the robot simply by launching |
| 71 | + |
| 72 | +```bash |
| 73 | +# Replace your actual colcon_ws folder |
| 74 | +$ cd <colcon_ws> |
| 75 | +$ colcon build --packages-select <organization_name>_ur_launch |
| 76 | +$ ros2 launch <organization_name>_ur_launch ex-ur10-1.launch.py |
| 77 | +robot_ip:=xxx.yyy.zzz.www ur_type:=ur5e use_fake_hardware:=false launch_rviz:=true |
| 78 | +``` |
0 commit comments