📌 This repository is useful for quick simulation of robot motions using MATLAB, as it requires little to no setup. For more complex functionalities, one should probably use Peter Corke's RVC toolbox instead.
See demo_*.m
files for some usage examples.
A simple and straightforward implementation of the DH-parameters in MATLAB.
There are two different conventions on the implementation of the DH-parameters. This one uses the standard DH-parameters which can as well be found in this book chapter.
The results have been validated with Peter Corke's RVC toolbox.
- Forward kinematics.
- Homogenous transformation of each link of the robot.
- Numerical Jacobian.
- Simple visualization, it can also be animated.
- Inverse kinematics with the pseudo-inverse method and damped least square method.
- Code generation ready.
The repo main elements are:
img
folder. Contains the images included in this README.my-matlab-robotics-toolbox
folder. Contains the core functions implementing the simple robotics toolbox.
Note
In the my-matlab-robotics-toolbox
scripts, the following convention applies:
- cgr prefix means the code is code-generation ready.
- ncgr means the code is NOT code-generation ready.
demo_*.m
scripts. Thedemo_*.m
files provide a sample usage of the toolbox. The name of the file should be self-explicative of the robot that it implements. These files should be considered themain
file for out-of-the-box use.
Note
You can consider adding your own demo_*.m
file to the repo.
kine#.prj
files. MATLAB Coder projects examples. Ignore them for basic usage of the package.
Install the my-matlab-robotics-toolbox
package with
git clone https://github.com/Luca-Pozzi/my-matlab-robotics-toolbox.git
Alternatively, you can download the repo as a .zip
file and extract it locally.
- Create a global variable
N_DOFS
and define the number of degrees-of-freedom of the robot in it. The reason why a global variable is used is because I keep having problems in using the dynamic memory allocation for MATLAB coder. Therefore, I use a global variable to define the dimension of the necessary static arrays.
Note
The above problem affects you only if you are interested in compiling the MATLAB code.
- Create the robot structure with
cgr_create
. - Actuate and update the joint with
cgr_self_update
functions. - If necessary, plot the robot with
ncgr_plot
by first callingncgr_graphic
once at the beginning of the program. - To create the compiled MEX or DLL files, two examples of MATLAB Coder project files are provided (
kine#.prj
files). This is where the global variable is used.
TODO.
Issues with the present package are tracked in the repo Issues page. If you encounter a new problem, open a new Issue or contact a maintainer.
- Auralius Manurung, [email protected]
- Marta Gandolla, [email protected]
- Luca Pozzi, [email protected]
- Luca Pozzi, [email protected]