Code Monkey home page Code Monkey logo

trajectoryscaling's Introduction

TrajectoryScaling

This repository contains Matlab files for testing trajectory scaling algorithms for robot manipulators.

Developer:

  • Marco Faroni

How to use it

The main script is script_scaling.m. Run it in Matlab.

Configuration

Parameters can be change in script_scaling.m. You can configure your simulation by setting the following variables:

method Choose the trajectory scaling method:

  • thor : use a joint-space MPC trajectory scaling algorithm (see [1])
  • cthor : use a Cartesian-space MPC trajectory scaling algorithm (see [2])
  • local : use a non-look ahead joint-space trajectory scaling algorithm (see [3])
  • clocal : use a non-look ahead Cartesian-space trajectory scaling algorithm (see [3])

Important: local and clocal can be used with or without time-law adaptation module (see [3] for details). If you wish to activate the timing-law adaptation module you should set the parameter MODIFY_SREF equal to 1 in the files controllers/local/controllerdata.m and controllers/clocal/controllerdata.m

task_space Choose between cartesian and joint

time_vectors Choose the nominal execution times. All values in the vector are executed. Please notice that the values are not in seconds, the actual time will be printed during the execution as Ttot.

horizon_vectors It is a vector containing the length of the predictive horizon you want to test.

Np It is the number of prediction time instants used by MPC-based method (along the horizon window)

References

If you wish to use this code please cite one of the following publications:

[1] Marco Faroni, Manuel Beschi, Corrado Guarino Lo Bianco, and Antonio Visioli. Predictive jointtrajectory scaling for manipulators with kinodynamic constraints. Control Engineering Practice, 95:104264, 2020. Available at https://www.sciencedirect.com/science/article/pii/S0967066119302151

[2] Marco Faroni, Manuel Beschi, Nicola Pedrocchi, and Antonio Visioli. Predictive inverse kinematics for redundant manipulators with task scaling and kinematic constraints. IEEE Transactions on Robotics, 35(1):278โ€“285, 2019. Available at https://ieeexplore.ieee.org/document/8477138

[3] Marco Faroni, Manuel Beschi, Antonio Visioli, and Nicola Pedrocchi. A real-time trajectory planning method for enhanced path-tracking performance of serial manipulators. Mechanism and Machine Theory, 156:104152, 2021. Available at https://www.sciencedirect.com/science/article/abs/pii/S0094114X20303694

trajectoryscaling's People

Contributors

marco-faroni avatar

Stargazers

james avatar orsl avatar  avatar Matthews avatar

Watchers

 avatar

trajectoryscaling's Issues

Jerk level constraints

Hi @marco-faroni , I tried to set order = 3 in the file controllerdata.m (line 55), but the script seems fail to run. I'm wondering if this framework could support jerk level constraints? Because it would be very helpful for robot like KUKA-iiwa with flexible joints. Hope to have this feature included ^_^

About the cost function

Hey @marco-faroni , I went through the Matlab code and try to compare the implemented algrothom with the following paper: Predictive joint trajectory scaling for manipulators with kinodynamic constraints.

In the file controllers/thor/ctrl_law.m (line 156), I was confused by these intermediate matrixes:

Heq = [ctrl.F(:,:,2)+[ctrl.Kclik*ctrl.F(1:df,:,1);0*ctrl.F(df+1:end,:,1)], -diag(qd_des)*ctrl.PD; zeros(Ns,Np*df), eye(Ns)]

H = Heq'*ctrl.Wsc*Heq + ctrl.lambdaU*ctrl.Hu;

f = -[ -(ctrl.L(:,:,2) + [ ctrl.Kclik*ctrl.L(1:df,:,1);0*ctrl.L(df+1:end,:,1)] )*q0 + [ctrl.Kclik*qdes; zeros(df*(Np-1),1)] ; s_ref.*ones(Ns,1) ]'*ctrl.Wsc*ctrl.Hp*Heq;

And finally the Hessian matrix is computed:
HH = (H+H')/2;

But I could not figure out the underlying theory and the paper did not mention it, I only found out the cost function in the paper like this:

image

From the figure, the weighting matrixes are Q, R and P. But how these 3 matrixes correspond to the matrixes in the code then (how to transform the cost function to the code format)? And what are the matlab variables corresponding to these 4 variables in the equation?

Missing function ws2struct

Hi @marco-faroni , I tried to run the script, but could not find the following functions:

  • ws2struct called in the import_robot.m file
  • mycolnorm in taskdata.m (line 42)
  • mygradient in DJDQ.m (line 11)

Could you help to fix it? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.