do this everytime you use this repo
- do git stash
- and then git pull
general info
- all of the code has been used and tested on Ubuntu 22 LTS
- both Python and C++ implementations are available, there's examples of both (both for the libraries used and for their combination)
- all of the code is initially written in C++ - ur_rtde uses pybind to generate Python bindings, and so does pinocchio for the most part. thus almost all the functions used are identical across languages, and so c++ implementations can be looked at to analyse python functionality as well
- 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)
- pinocchio for dynamics intergration, and other robotics-related math on the client side
- gepetto for visualization (has nice integration with pinocchio)
- 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)
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.
- install ubuntu on metal, i.e. do a real install on your machine. if you want to play around with virtual machines, or compile all the libraries on windows or something else, this is OK, but proceed at your own risk and with less support
- install ur_rtde https://gitlab.com/sdurobotics/ur_rtde
- 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).
- install pinocchio: https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/master/doxygen-html/index.html , https://stack-of-tasks.github.io/pinocchio/download.html , https://github.com/stack-of-tasks/pinocchio .
- compile and run click in this repo. note to run gepetto-gui if you want visualization
- run clik.py
- install docker and the simulator. change flags in the code to simulation, 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.
#TODO re-organization of the repo
- RIGHT NOW: get rid of all ur-specific calls outside of the manager. make all other functions depend only on pinocchio. this is the only way you actually get transferability. this includes the tucking of all rtde_control/rtde_receive calls behind RobotManager wrappers (because other robot don't have rtde_control lel). i'm also pretty sure there is not a single instant in which i call robot_manager.getQ() without calling pin.forwardKinematics immediatelly afterward. so think about doing that in robot_manager.getQ().
- long term: write all code in c++, make python bindings with pybind. have common documentation and examples
- short term: the long term goal is too big of a time sink right now both lack of experience and the necessity of prototyping in python first (it's miles faster and time is of the essence). thus c++ and python code will live separately until all python code is rewritten with proper bindings. up until that time the c++ and python stacks will lead separate existances, each in it's own folder which might as well be a different repository. this is the cleanest thing to do as then both folders can be organized into a cmake project and python package without unrelated files to make clutter and cause confusion.
- the pyproject.toml actually brakes local install so i'm just keeping it out for now. sweet jesus what a mess
#TODO: write instruction for extending the library to new robots
- make sure the base frame of the robot aligns with base frame of the pinocchio model you get from the urdf. even better if you make sure the urdf is correct (change it to be correct), because then it will be transferable to simulators etc
- todo the rest (will probably happen while i make this work on panda let's be real)
#TODO for current students
- explain hom transf mat
- make this documentation prettier
TODO for profit
- writing documentation, making text and video tutorials to the point where this can be used as teaching material
- do the documentation with doxygen so that you get webpages from markdown as well
#TODO for fun and profict. general point: get a collection of control algorithms for the arm
- implement and test other inverse kinematics algorithms
- rewrite finalized dmp (and other) code into C++
- learn pybind, create python bindings for that code
- create a DMP from multiple trajectories (actually learn a DMP from multiple examples)