Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building the UR driver package #67

Closed
clemense opened this issue Mar 9, 2021 · 14 comments
Closed

Building the UR driver package #67

clemense opened this issue Mar 9, 2021 · 14 comments

Comments

@clemense
Copy link

clemense commented Mar 9, 2021

Hello,
I'm trying to create packages for the UR driver: https://github.com/UniversalRobots/Universal_Robots_ROS_Driver
What's the best way to go about it?
I only found a screenshot in a medium post that shows how to build custom ROS packages: https://miro.medium.com/max/1400/1*D-2IRRYeUzMprK5M12ayqg.png
Unfortunately, I can't reproduce these steps for the UR package without errors.
Are there more detailed instructions (apart from the contributing.md file)? Or should I rather not go down this road at this point in time?

Thanks!

@Tobias-Fischer
Copy link
Collaborator

Hi @clemense,
Great to hear you're interested in creating packages for UR driver. At the moment the documentation definitely needs improvement, but in theory you can build the packages already :). You can find an example here: https://github.com/RoboStack/ros-noetic/tree/master/additional_recipes/ros-noetic-tf2-web-republisher

It would be good to know which error you were running into. I was able to successfully run the command in the screenshot. The result is:

package:
  name: ros
  version: 2021.03.10

source:
  - path: controller_stopper
    folder: ros-noetic-controller-stopper/src/work
  - path: ur_robot_driver
    folder: ros-noetic-ur-robot-driver/src/work
  - path: ur_calibration
    folder: ros-noetic-ur-calibration/src/work
  - path: ur_dashboard_msgs
    folder: ros-noetic-ur-dashboard-msgs/src/work
  - path: ur_controllers
    folder: ros-noetic-ur-controllers/src/work

build:
  number: 0

about:
  home: https://www.ros.org/
  license: BSD-3-Clause
  summary: |
    Robot Operating System

extra:
  recipe-maintainers:
    - ros-forge

outputs:
  - package:
      name: ros-noetic-controller-stopper
      version: 0.0.1
    about:
      home: https://www.ros.org/
      license:
        - Apache-2.0
      summary: A small helper node that stops and restarts ROS controllers based on a boolean status topic.
      maintainers: []
    extra:
      recipe-maintainers:
        - robostack
    build:
      number: 0
      script:
        sel(win): bld_catkin.bat
        sel(unix): build_catkin.sh
    requirements:
      build:
        - "{{ compiler('cxx') }}"
        - "{{ compiler('c') }}"
        - ninja
        - sel(unix): make
        - cmake
      host:
        - ros-noetic-catkin
        - ros-noetic-controller-manager-msgs
        - ros-noetic-roscpp
        - ros-noetic-std-msgs
        - ros-noetic-controller-manager-msgs
        - ros-noetic-roscpp
        - ros-noetic-std-msgs
      run:
        - ros-noetic-controller-manager-msgs
        - ros-noetic-roscpp
        - ros-noetic-std-msgs
        - ros-noetic-controller-manager-msgs
        - ros-noetic-roscpp
        - ros-noetic-std-msgs
  - package:
      name: ros-noetic-ur-robot-driver
      version: 0.0.3
    about:
      home: http://wiki.ros.org/ur_robot_driver
      license:
        - Apache-2.0
        - BSD-2-Clause
        - Zlib
      summary: The new driver for Universal Robots UR3, UR5 and UR10 robots with CB3 controllers and the e-series.
      maintainers:
        - Thomas Timm Andersen
        - Simon Rasmussen
        - Felix Exner
        - Lea Steffen
        - Tristan Schnell
    extra:
      recipe-maintainers:
        - robostack
    build:
      number: 0
      script:
        sel(win): bld_catkin.bat
        sel(unix): build_catkin.sh
    requirements:
      build:
        - "{{ compiler('cxx') }}"
        - "{{ compiler('c') }}"
        - ninja
        - sel(unix): make
        - cmake
      host:
        - ros-noetic-catkin
        - boost
        - ros-noetic-industrial-robot-status-interface
        - ros-noetic-actionlib
        - ros-noetic-control-msgs
        - ros-noetic-controller-manager
        - ros-noetic-geometry-msgs
        - ros-noetic-hardware-interface
        - ros-noetic-pluginlib
        - ros-noetic-roscpp
        - ros-noetic-sensor-msgs
        - ros-noetic-tf
        - ros-noetic-tf2-msgs
        - ros-noetic-tf2-geometry-msgs
        - ros-noetic-trajectory-msgs
        - ros-noetic-ur-controllers
        - ros-noetic-ur-dashboard-msgs
        - ros-noetic-ur-client-library
        - ros-noetic-std-srvs
        - ros-noetic-actionlib
        - ros-noetic-control-msgs
        - ros-noetic-controller-manager
        - ros-noetic-geometry-msgs
        - ros-noetic-hardware-interface
        - ros-noetic-pluginlib
        - ros-noetic-roscpp
        - ros-noetic-sensor-msgs
        - ros-noetic-tf
        - ros-noetic-tf2-msgs
        - ros-noetic-tf2-geometry-msgs
        - ros-noetic-trajectory-msgs
        - ros-noetic-ur-controllers
        - ros-noetic-ur-dashboard-msgs
        - ros-noetic-ur-client-library
        - ros-noetic-std-srvs
        - ros-noetic-rostest
      run:
        - ros-noetic-actionlib
        - ros-noetic-control-msgs
        - ros-noetic-controller-manager
        - ros-noetic-geometry-msgs
        - ros-noetic-hardware-interface
        - ros-noetic-pluginlib
        - ros-noetic-roscpp
        - ros-noetic-sensor-msgs
        - ros-noetic-tf
        - ros-noetic-tf2-msgs
        - ros-noetic-tf2-geometry-msgs
        - ros-noetic-trajectory-msgs
        - ros-noetic-ur-controllers
        - ros-noetic-ur-dashboard-msgs
        - ros-noetic-ur-client-library
        - ros-noetic-std-srvs
        - ros-noetic-controller-stopper
        - ros-noetic-force-torque-sensor-controller
        - ros-noetic-industrial-robot-status-controller
        - ros-noetic-joint-state-controller
        - ros-noetic-joint-trajectory-controller
        - ros-noetic-robot-state-publisher
        - ros-noetic-velocity-controllers
        - ros-noetic-actionlib
        - ros-noetic-control-msgs
        - ros-noetic-controller-manager
        - ros-noetic-geometry-msgs
        - ros-noetic-hardware-interface
        - ros-noetic-pluginlib
        - ros-noetic-roscpp
        - ros-noetic-sensor-msgs
        - ros-noetic-tf
        - ros-noetic-tf2-msgs
        - ros-noetic-tf2-geometry-msgs
        - ros-noetic-trajectory-msgs
        - ros-noetic-ur-controllers
        - ros-noetic-ur-dashboard-msgs
        - ros-noetic-ur-client-library
        - ros-noetic-std-srvs
  - package:
      name: ros-noetic-ur-calibration
      version: 0.0.2
    about:
      home: https://www.ros.org/
      license:
        - Apache-2.0
      summary: Package for extracting the factory calibration from a UR robot and change it such that it can be used by ur_description to gain a correct URDF
      maintainers: []
    extra:
      recipe-maintainers:
        - robostack
    build:
      number: 0
      script:
        sel(win): bld_catkin.bat
        sel(unix): build_catkin.sh
    requirements:
      build:
        - "{{ compiler('cxx') }}"
        - "{{ compiler('c') }}"
        - ninja
        - sel(unix): make
        - cmake
      host:
        - ros-noetic-catkin
        - eigen
        - ros-noetic-roscpp
        - ros-noetic-ur-client-library
        - yaml-cpp
        - eigen
        - ros-noetic-roscpp
        - ros-noetic-ur-client-library
        - yaml-cpp
        - ros-noetic-rosunit
      run:
        - eigen
        - ros-noetic-roscpp
        - ros-noetic-ur-client-library
        - yaml-cpp
        - eigen
        - ros-noetic-roscpp
        - ros-noetic-ur-client-library
        - yaml-cpp
  - package:
      name: ros-noetic-ur-dashboard-msgs
      version: 0.0.0
    about:
      home: https://www.ros.org/
      license:
        - Apache-2.0
      summary: Messages around the UR Dashboard server.
      maintainers: []
    extra:
      recipe-maintainers:
        - robostack
    build:
      number: 0
      script:
        sel(win): bld_catkin.bat
        sel(unix): build_catkin.sh
    requirements:
      build:
        - "{{ compiler('cxx') }}"
        - "{{ compiler('c') }}"
        - ninja
        - sel(unix): make
        - cmake
      host:
        - ros-noetic-catkin
        - ros-noetic-message-generation
        - ros-noetic-actionlib-msgs
        - ros-noetic-std-msgs
        - ros-noetic-message-runtime
        - ros-noetic-actionlib-msgs
        - ros-noetic-std-msgs
      run:
        - ros-noetic-message-runtime
        - ros-noetic-actionlib-msgs
        - ros-noetic-std-msgs
        - ros-noetic-message-runtime
        - ros-noetic-actionlib-msgs
        - ros-noetic-std-msgs
  - package:
      name: ros-noetic-ur-controllers
      version: 0.0.2
    about:
      home: https://www.ros.org/
      license:
        - Apache-2.0
      summary: Provides controllers that use the speed scaling interface of Universal Robots.
      maintainers: []
    extra:
      recipe-maintainers:
        - robostack
    build:
      number: 0
      script:
        sel(win): bld_catkin.bat
        sel(unix): build_catkin.sh
    requirements:
      build:
        - "{{ compiler('cxx') }}"
        - "{{ compiler('c') }}"
        - ninja
        - sel(unix): make
        - cmake
      host:
        - ros-noetic-catkin
        - ros-noetic-controller-interface
        - ros-noetic-hardware-interface
        - ros-noetic-joint-trajectory-controller
        - ros-noetic-pluginlib
        - ros-noetic-realtime-tools
        - ros-noetic-std-msgs
        - ros-noetic-controller-interface
        - ros-noetic-hardware-interface
        - ros-noetic-joint-trajectory-controller
        - ros-noetic-pluginlib
        - ros-noetic-realtime-tools
        - ros-noetic-std-msgs
      run:
        - ros-noetic-controller-interface
        - ros-noetic-hardware-interface
        - ros-noetic-joint-trajectory-controller
        - ros-noetic-pluginlib
        - ros-noetic-realtime-tools
        - ros-noetic-std-msgs
        - ros-noetic-controller-interface
        - ros-noetic-hardware-interface
        - ros-noetic-joint-trajectory-controller
        - ros-noetic-pluginlib
        - ros-noetic-realtime-tools
        - ros-noetic-std-msgs

This is good enough to build the packages locally, but it would be great if we build them here in the repository so everyone can use them. As far as I know, it so far is a manual process to split this recipe into the individual outputs, and update the source to change from local sources to the GitHub source. Would you be happy to do this, based on the https://github.com/RoboStack/ros-noetic/tree/master/additional_recipes/ros-noetic-tf2-web-republisher example?

@Tobias-Fischer
Copy link
Collaborator

@wolfv: We should think about a process to make this more automated - in this way people could directly package their stuff here rather than having to package it in the main ROS repos via bloom :)

@Tobias-Fischer
Copy link
Collaborator

I just pushed some packages for Jackal using this method: 2cad45e

@Tobias-Fischer
Copy link
Collaborator

Hi @clemense - did you give this a go? Would be great if you let us know how things went.

@clemense
Copy link
Author

Hi,
Sorry, we went the more conventional route. But I would like to revisit this in the future, once things are more streamlined.

@AndrewJSchoen
Copy link

I am attempting to run this workflow to generate the Universal_Robots_ROS_Driver on macOS, however, I am encountering issues. What I first attempted to do was build the package with boa, as described above:

cd Universal_Robots_ROS_Driver 
vinca -p "**/package.xml" -d ../ros-noetic
boa build .

However, I get an error when trying to build ros-noetic-ur-calibration:

...
Finalizing build for ros-noetic-ur-calibration
Finalizing host for ros-noetic-ur-calibration
Mamba failed to solve:
 - ros-noetic-catkin
 - eigen
 - ros-noetic-roscpp
 - ros-noetic-ur-client-library
 - yaml-cpp
 - eigen
 - ros-noetic-roscpp
 - ros-noetic-ur-client-library
 - yaml-cpp
 - ros-noetic-rosunit
 - libcxx >=11.1.0

with channels:
 - robostack
 - conda-forge
 - defaults

The reported errors are:
   Encountered problems while solving:
     - nothing provides requested ros-noetic-ur-client-library
     - nothing provides requested ros-noetic-ur-client-library

This led me to looking into the ros-noetic-ur-client-library, since it seemed to be the missing piece. However, it fails to compile on macOS due to a number of issues:

  • Usage of #include <endian.h> instead of a portable/cross-platform approach (fixed in my fork, below)

  • Undeclared Identifier TCP_QUICKACK from /src/comm/tcp_socket.cpp (This is not available on macOS)

  • Finally, an error I am not too sure about how to fix:

    Undefined symbols for architecture x86_64:
      "console_bridge::log(char const*, int, console_bridge::LogLevel, char const*, ...)", referenced from:
       urcl::comm::TCPSocket::setup(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, int) in tcp_socket.cpp.o
       urcl::comm::TCPSocket::getIP() const in tcp_socket.cpp.o
       urcl::comm::TCPSocket::write(unsigned char const*, unsigned long, unsigned long&) in tcp_socket.cpp.o
       urcl::comm::TCPServer::init() in tcp_server.cpp.o
       urcl::comm::TCPServer::bind() in tcp_server.cpp.o
       urcl::comm::TCPServer::startListen() in tcp_server.cpp.o
       urcl::comm::TCPServer::~TCPServer() in tcp_server.cpp.o
       ...
    ld: symbol(s) not found for architecture x86_64
    clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.
    

Like I mentioned, I have fixed a couple of issues in building the library in this fork (boost branch)
These changes include:

  • A generalized lookup instead of endian.h that should be more cross-platform.
  • I removed the usage of TCP_QUICKACK (this one I don't know much about and this might be a terrible idea)

If there is any interest, some of this might be helpful in getting it to work on other platforms than linux (right now the only supported one).

@wolfv wolfv reopened this May 13, 2021
@Tobias-Fischer
Copy link
Collaborator

Tobias-Fischer commented May 13, 2021

Hi @AndrewJSchoen - check out AndrewJSchoen/Universal_Robots_Client_Library#1 which should resolve your issues.

@Tobias-Fischer
Copy link
Collaborator

Please consider opening a pull request upstream with your changes :)

@Tobias-Fischer
Copy link
Collaborator

And also please open a pull request adding ur-client-library and the other packages into RoboStack (additional_recipes)

@Tobias-Fischer
Copy link
Collaborator

So I just had another look at this. @traversaro is right, they have not bloomed/released a proper version of the UR packages, neither for ROS Melodic nor Noetic. They have further not even release tags in their repositories, and rely on weird forks of forks. Therefore, I do not think that it makes sense to push on releasing RoboStack packages before those issues are resolved upstream.

@AndrewJSchoen - I have triggered a build of the ur_client_library for linux+osx: 6aee2cd
You should still be able to build the packages locally in a recipe as per #67 (comment)

@AndrewJSchoen
Copy link

@Tobias-Fischer Sounds good. I actually just got to revisit this today, and can confirm that things build correctly with those changes. Sorry for the delay in checking on that. Given the points you mention, I can submit that as a pull request with the main repo, but it doesn't seem like that should change things over here. Let me know if there is anything else that I should do, though.

Thanks again for all the help!

@Tobias-Fischer
Copy link
Collaborator

Great to hear that this worked for you @AndrewJSchoen. Is it okay to close this issue? It is very hard for us to package the UR driver seeing that it is not released properly.

@AndrewJSchoen
Copy link

@Tobias-Fischer I think we can close until anything changes upstream. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants