Skip to content
Snippets Groups Projects

do this everytime you use this repo


  • do git stash
  • and then git pull

general info


  • code is developed on Arch Linux, also tested on Ubuntu 22, should work on any Linux
  • code is written in Python, will be re-written in C++ with Python bindings in the future
  • all of the library code is written in C++ with Python bindings
    • ur_rtde
    • pinocchio
    • crocoddyl in the future
  • matrix operations are done with Eigen in C++, and NumPy in Python

libraries used and their purpose


  • ur_rtde for the client-side real-time interface for ur robots (we have a UR5e), will expand for other robots in the future
  • pinocchio for robot dynamics calculations
  • meshcat for visualization (has nice integration with pinocchio)
  • crocoddyl for optimal control
  • Dockerized ur simulator as a simulator (it's a bad simulator, but it uses the same robot-communication API as the real robot, making coding and testing easier)
  • Docker is used for shipping

contents of this repository


  • basic documentation can be found in the docs directory: official UR documentation on the robot's capabilities and its interface, short instructions on installing Ubuntu, ur_rtde, pinocchio, gepetto and the simulator
  • basic closed-loop inverse kinematics control is implemented in both C++ and python. the C++ version uses exponential coordinates and the Lie group formalism, while the Python version uses homogenious transformations and basic matrix operations
  • robot description files: urdf containing both the arm and the gripper, and other urdf-related files
  • more algorithms will be added over time
  • documentation will be expanded according to demand
  • some basic tests will be here as well, while full projects built on this repo will be in separate repos

installation and operating instructions


For all of the listed items, consult their specific documentation in the docs folder, and do your own googling. Note that for most items you can install through the ubuntu package manager apt, or through the python package manager pip. Likewise, you can compile the libraries and install from local files. Both options are OK, just make sure to select a stable release for local compilation (just in case). All compilation is standard the standard cmake-make combo: mkdir build && cd build && cmake .. && make , followed by sudo make install to install. Most likely you can just copy-paste the commands given in the library docs to install. If not, and you can't fix it yourself in a reasonable amount of time, send an email. It's highly recommended that you download the source code of these libraries so that you have access to it, and their examples. Looking around and running these examples is the best way to a) verify installation and b) get to know the libraries. Of course also follow this up with reading on their documentation.

Here is a checklist of what to do together with the key remarks.

simulation


  • use the --pinocchio-only argument to integrate the dynamics. if you want to add external disturbances, put them into the kinematics/dynamics equations
  • alternatively build the docker image of the simulator (Dockerfile is in the ur_simulator directory). use the --simulation argument. go to the local website to see the teacher pendant emulation and put 127.0.0.1 as the ip, and see whether the code works. the simulator accepts the same commands as the robot. the only TODO is to add the gripper to the simulator somehow, but you can also just skip using it when simulating.

connecting to the real robot


  • create a fixed ip connection to verify that you can connect to the robot. create a new Ethernet connection, and under IPv4 setting put 192.168.1.101 as the host (your) address, 255.255.255.0 under netmask and 192.168.1.1 as gateway (just in case). the robot's ip is fixed to 192.168.1.102. connect to the network once you've created it. put the robot's IP into the examples given in ur_rtde and verify the connection (select an example with the robot moving and see that it moves).
  • run clik.py to verify it works

some TODOs


  • instead of using a debug argument and ifs for prints, use built-in python logging
  • implement and test other inverse kinematics algorithms
  • use pyproject.toml for python packaging. it actually brakes the current local install so it is avoided for now.
  • write all code in c++, make python bindings with pybind. have common documentation and examples
  • do the documentation with doxygen so that you get webpages from markdown as well
  • create a DMP from multiple trajectories (actually learn a DMP from multiple examples)