Code Monkey home page Code Monkey logo

Comments (6)

ayonga avatar ayonga commented on May 16, 2024

There could be a few cases this result happens:

  1. your tau is not equals to 0 at the beginning of the domain;
  2. you did not enforce the hybrid invariance constraints, i.e., y(0) = 0 and ydot(0) =0.

from frost-dev.

yuan0623 avatar yuan0623 commented on May 16, 2024

Ayonga, thanks so much for your reply! I thought for an orbit planning problem, every one will assume tau starts from 0. I also though if I do the hybrid trajectory optimization, the hybrid invariance constraint is the default setting.
So my next questions are:

  1. how do I enforce tau starts from 0 and ends at 1
  2. how to enforce the hybrid invariance constraints????
    I didn't see it in other examples. :(

from frost-dev.

yuan0623 avatar yuan0623 commented on May 16, 2024

I think the hybrid invariance constraint is enforced in
r_stance.UserNlpConstraint = str2func('right_stance_constraints');
r_impact.UserNlpConstraint = str2func('right_impact_constraints');
In the right_stance_constraints, the author have domain.VirtualConstraints.time.imposeNLPConstraint(nlp, [bounds.time.kp, bounds.time.kd], [1,1], load_path); . but the results is still not correct.
I think it can be the tau is not start from 0, how do I check the range of the tau in the optimization result? Have no clue :(

from frost-dev.

yuan0623 avatar yuan0623 commented on May 16, 2024

@ayonga
I have just tried the default version for rabbit optimization. I did not modified anything. The phase variable is time based.
In the results, params{1,1}.ptime=[0.4956,0]., and the tspan is from 0 to 0.4956. Based on the definition of tau=(t-p(2))/(p(1)-p(2)), it should start from 0 to 1;
Then based on what you said, the problem should be the enforcement of hybrid invariance constraints, but in the code right_stance_constraints.m, it does set the constraint. Then everything thing should be good. However, the result still doesn't make sense.
The first column of x is
-0.1678 0.7400 0.1690 2.4270 0.6454 2.9454 0.5880
the coefficients of Bezier curve are :
2.4271 0.6455 2.9453 0.5880 2.5426 0.5941
2.9781 0.7263 2.6988 0.4451 2.8123 1.0771
2.7080 0.5621 2.5740 1.1960 2.8510 0.4166
2.3711 1.0778 2.9458 0.5877 2.4274 0.6458.
As you can see, the first coefficient of first Bezier curve is really close to x(4), whick make sense, however, the rest looks bad to me. Is there any bug on that existing rabbit example? I really can not figure it out myself.
Thanks you!

from frost-dev.

ayonga avatar ayonga commented on May 16, 2024

You did not correctly reformat the Bezier coefficient, you should use reshape(params{1}.atime,4,6), which will give you
2.4269 2.5425 2.6987 2.7077 2.8508 2.9457
0.6454 0.5941 0.4452 0.5623 0.4165 0.5875
2.9453 2.9781 2.8124 2.5739 2.3709 2.4272
0.5879 0.7262 1.0771 1.1959 1.0778 0.6458
where the first column of x would be:
-0.1678
0.7400
0.1692
2.4269
0.6454
2.9453
0.5879
.

from frost-dev.

yuan0623 avatar yuan0623 commented on May 16, 2024

Thank you so much! That is simply awesome! I think we can close this case for now.. Orz

from frost-dev.

Related Issues (20)

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.