Loading repository dataβ¦
Loading repository dataβ¦
AssemblingTheFuture / repository
A powerful library for robotics analysis π€
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A powerful library for robotics analysis :mechanical_arm: :robot:
You can use this simple library to analyze and develop kinematics and control algorithms for your robots as shown in our online trainigs:
We hope this library will help you to start your journey in these amazing discipline! :heart:
You can set your robot attributes and analyze its behavior. To achieve this, all the algorithms were developed using Homogeneous Transformation Matrices and Dual Quaternions algebra, however, the logic used to develop them will allow you to adapt it to almost any embedded system!
For serial robots (we will include new ones in the future :wink:), some interesting functionalities are listed below:
Feel free to modify, adjust and extend our work to your necessities :smiley:; this library allows you to get a first approach to robot analysis, synthesis and control, however, we will be adding new interesting features, also, you can request new features or create new ones!
We are working, or will start working soon, on the following tasks for future releases:
This library can be used with Python :snake: 3.10.4 - 64 bits or above. Please install the following dependencies or make sure that they're already in your computer:
pip3 install numpy
pip3 install sympy
pip3 install matplotlib
Please do not forget to set your Python Path :wink:. Also, you can use pip depending on your Python version and/or configuration:
pip install numpy
pip install sympy
pip install matplotlib
If these modules were installed correctly, you will be able to use our library :smiley:
You can get your robot's equations in a symbolic form, however, please consider that this computation is slower than numerical one, also resulting equations won't be simplified most of the times as we do in paper. If you need to simplify the obtained results, you can use trigsimp() function as follows:
"""
Example of symbolic simplification
"""
# Homogeneous Transformation Matrix library
from lib.movements.HTM import *
# SymPy library
from sympy import *
# Symbolical Homogeneous Transformation Matrix (multiplication is done with * because is a symbolic matrix)
H = rz(z = "q1", symbolic = True) * tx(x = "L1", symbolic = True) * rz(z = "q2", symbolic = True) * tx(x = "L2", symbolic = True)
# Simplified Homogeneous Transformation Matrix
Hsimplified = trigsimp(H)
So the outputs will be
>>> H
Matrix([[-sin(q1)*sin(q2) + cos(q1)*cos(q2), -sin(q1)*cos(q2) - sin(q2)*cos(q1), 0, L1*cos(q1) + L2*(-sin(q1)*sin(q2) + cos(q1)*cos(q2))],
[ sin(q1)*cos(q2) + sin(q2)*cos(q1), -sin(q1)*sin(q2) + cos(q1)*cos(q2), 0, L1*sin(q1) + L2*(sin(q1)*cos(q2) + sin(q2)*cos(q1))],
[ 0, 0, 1, 0],
[ 0, 0, 0, 1]])
>>> Hsimplified
Matrix([[cos(q1 + q2), -sin(q1 + q2), 0, L1*cos(q1) + L2*cos(q1 + q2)],
[sin(q1 + q2), cos(q1 + q2), 0, L1*sin(q1) + L2*sin(q1 + q2)],
[ 0, 0, 1, 0],
[ 0, 0, 0, 1]])
Please consider that the bigger the equation, the slower the simplification. Also trigsimp() will find the best possible value, then sometimes your simplification won't be the same as the computer's, but it doesn't mean equations are wrong, but they are equivalent :wink:
This library includes the following files:
zRobotics
βββ img # Images for README.md file and related ones
βββ lib # Python source files
| βββ Robot.py # Robot constructor
| βββ movements
| | βββ DQ.py # Rotations, translations and other functionalities for Dual Quaternios
| | βββ HTM.py # Rotations, translations and other functionalities for Homogeneous Transformation Matrices
| βββ kinematics
| | βββ DQ.py # Forward and Inverse Kinematics functions using Dual Quaternios
| | βββ HTM.py # Forward and Inverse Kinematics functions using Homogeneous Transformation Matrices
| | βββ DifferentialDQ.py # Velocities and accelerations using Dual Quaternions
| | βββ DifferentialHTM.py # Velocities and accelerations using Homogeneous Transformation Matrices
| βββ dynamics
| | βββ DynamicsHTM.py # Dynamic equations using Homogeneous Transformation Matrices
| | βββ DynamicsDQ.py # D