GithubHelp home page GithubHelp logo

ayonga / frost-dev Goto Github PK

View Code? Open in Web Editor NEW
148.0 22.0 63.0 84.5 MB

Fast Robot Optimization and Simulation Toolkit (FROST)

Home Page: http://ayonga.github.io/frost-dev/

License: Other

Mathematica 5.09% MATLAB 90.71% M 0.24% C 2.98% C++ 0.75% PLSQL 0.15% Objective-C 0.08%
dynamic optimization hybrid virtual-constraints robotics bipedal

frost-dev's People

Contributors

ayonga avatar emungai avatar jpreher avatar omarharib avatar rosshartley avatar vkotaru avatar wendragon avatar wguffey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frost-dev's Issues

Matlab Symbolic Toolbox for Mac

Hi do you have any experience using mex to compile the Matlab Symbolic Toolbox? Or do you have an already-mex'd file you can send? I'm having a lot of trouble compiling, since it seems like Mathematica, MathLink, and mex have all changed a lot since the readme was put together.

Error when event functions are input-dependednt

I think there's a minor bug in the checkGuard function. In particular, line 20 should be:

...
% if any of the event function is input-dependent, then call
    % calcDynamics method.
    if any([eventfuncs.InputDependent])
        calcDynamics(obj, t, x, controller, params, []);
...

with the added empty array [] in the last argument of calcDynamics.

question about marlo

hello! when I try to run the marlo program, a mistake appears in this statement: [gait, sol, info] = opt.solve(nlp);
it hints: Incorrect use of the feval Function or variable 'JS_ power_ RightStance_ Integral 'is not recognized.
looking foraward to your help,thanks

Identity map between domains

I was trying to add an identity map between domains using the DiscreteDynamics class. On using nlp.configure(bounds), I get the following error in IdentityMapConstraint

No appropriate method, property, or field 'Plant' for class 'DiscreteDynamics'.

Error in DiscreteDynamics/IdentityMapConstraint (line 23)
    if strcmp(obj.Plant.Type,'SecondOrder')

Error in DiscreteDynamics>@(varargin)obj.IdentityMapConstraint(varargin{:}) (line 67)
            obj.UserNlpConstraint = @obj.IdentityMapConstraint;

Error in HybridTrajectoryOptimization/addJumpConstraint (line 111)
    plant.UserNlpConstraint(edge, src, tar, bounds, varargin{:});

Error in HybridTrajectoryOptimization/configure (line 75)
            addJumpConstraint(obj, edge, src, tar, edge_bounds, varargin{:});

So I'm guessing Line 23 of IdentityMapConstraint should be

if strcmp(obj.Type,'SecondOrder')

and NOT

if strcmp(obj.Plant.Type,'SecondOrder')

Question about setting bounds

I was trying to modify the rabbit example's virtual constraint,and I found something confusing me in setbounds.m

bounds.RightStance.params.ptime.lb = [bounds.RightStance.time.tf.lb, bounds.RightStance.time.t0.lb];
bounds.RightStance.params.ptime.ub = [bounds.RightStance.time.tf.ub, bounds.RightStance.time.t0.ub];
bounds.RightStance.params.ptime.x0 = [bounds.RightStance.time.t0.x0, bounds.RightStance.time.tf.x0];

I supposed the positions of "tf" and "t0" were swapped by mistake, but the optimization worked out. Then I tried to change the positions like following which I thought were right, Maximum Number of Iterations Exceeded. The result didn't seem like reasonable.

bounds.RightStance.params.ptime.lb = [bounds.RightStance.time.t0.lb, bounds.RightStance.time.tf.lb];
bounds.RightStance.params.ptime.ub = [bounds.RightStance.time.t0.ub, bounds.RightStance.time.tf.ub];

Error in getEulerAngles.m and getRelativeEulerAngles.m

Euler angles computed does not account for the signs in the rotation matrices.

Consider the following orientation angles and the corresponding rotation matrices:

% euler angles in static frame. ordering : XYZ

%%%%%%% Orientation 1 %%%%%%%%%%%%%%%
ox = -1.570796325285271;
oy = -1.361661927295521;
oz = 1.225593490802320;

% Rotation matrix computed
R =

0.0703    0.3310   -0.9410
0.1954    0.9205    0.3384
0.9782   -0.2076    0.0000

%%%%%%% Orientation 2 %%%%%%%%%%%%%%%
ox = -1.570796325285271;
oy = 1.779930725955889;
oz = 1.225593490802320;

% Rotation matrix computed
R =

-0.0703 -0.3310 -0.9410
-0.1954 -0.9205 0.3384
-0.9782 0.2076 -0.0000

The values of the matrices are same except for signs for some. getRelativeEulerAngles spits out orientation 2 angles for the rotation depicted by rotation matrix 1.

Running example

Hi,
Thanks for your effort on maintaining Frost!

I would like to run the RABBIT example but I couldn't find a guidance for it.
I naively cloned the repository and ran main_opt.m in Mac OSX.
On command window, I got an error as below,
screen shot 2018-05-03 at 8 43 53 am

And I realized, mex files are not for Mac OSX. Should I run it in Windows?
It would be appreciated, if there is a guideline to run the examples.
For example, the computer environment to be used, how to install dependencies and so on.
I think the functions and process is well described in the pptx file :) though.

Atlas compilation

What parameters of Atlas can be changed without compilation? Is the compilation of the constraints and the objective required when the friction coefficients are changed or the Coriolis set added?

Contact force reference frame

When adding contact through the addContact() method, what frame is the contact wrench represented in? Is it in the the inertial frame or the body frame of the contact.

From my understanding, from line 59 of add contact, the linear forces are in represented in the inertial frame where as the moments are represented in the body frame as in line 60. Please let me know if this is correct!

Thank you!

How to set a (state-based) virtual constraint ?

Hi,
I do not understand how the VirtualConstraint method works, and cannot find documentation on the use of different parameters. How can I set a state-based virtual constraint for Rabbit ? I tried setting PhaseType to StateBased but I get an error during mexfile generation.
This is to try to reproduce the behaviour obtained in this paper (virtual constraint on page 14) : https://hal.archives-ouvertes.fr/hal-00794856/document
Thank you in advance !

question about computeTwist

hi aynga
i am reading the code of FROST now, there is a question about the function computeTwist of RobotJoint.
in this function,you set the twist of RobotJoint as:
obj.Twist = transpose(adj*transpose(xi));

   and the comment about the function is :
 %computes the twist from the base frame

   i think the twist should be twist from parent frame ,not from base frame.
  am i misunderstand  something?

Trying to implement an absolute pitch constraint using computeEulerAngles()

Hi,

I'm struggling to implement a constraint that enforces the absolute pitch and roll (that is, pitch and roll w.r.t. the inertial world frame) of the feet of my robot to be zero.

To me, the most natural way seems to be to define the contact coordinate frames on each foot, then use computeEulerAngles() on these frames to find the orientation of the foot relative to the world frame, and then put that angle into a SymFunction that is constrained to be zero.

When I do this, and compile, I get some kind of compilation/mex error, that the function "Dot" (which I'm assuming is originally from Mathematica) is not within scope:

Error using mex
/home/james/slider-hzd/slider2dof/gen/export/swingFootPitch_RightStance.cc: In function ‘void output1(double*, const
double*)’:
/home/james/slider-hzd/slider2dof/gen/export/swingFootPitch_RightStance.cc:114:119: error: ‘Dot’ was not declared in this
scope
   p_output1[0]=ArcTan(t448,Dot(t441*t443 - 1.*t405*t446,t448/Sqrt(Power(t417*t429*t431 + t428*t436,2) + Power(t448,2))));
                                                                                                                       ^


Error in build_mex (line 68)
        mex(...

Error in SymExpression/export (line 105)
        build_mex(export_path,filename);

Error in SymFunction/export (line 71)
    f = obj.export@SymExpression(export_opts);

Error in TrajectoryOptimization/compileConstraint>@(x)export(x.SymFun,export_path,opts)

Error in TrajectoryOptimization/compileConstraint (line 58)
        arrayfun(@(x)export(x.SymFun, export_path, opts), deps_array, 'UniformOutput', false);

Error in HybridTrajectoryOptimization/compileConstraint (line 33)
        compileConstraint(obj.Phase(k), constr, export_path, exclude, varargin{:});

Error in main (line 65)
nlp.compileConstraint([],[],EXPORT_PATH); 

For reference, here's my MATLAB function for creating a SymFunction of absolute foot pitch (absolute roll is nearly identical):

function [ swingFootPitchFun ] = swingFootPitch(nlp)

% Choose frames
switch nlp.Plant.Name
    case 'RightStance'
        swingFoot = nlp.Plant.ContactPoints.LeftFootBottom;
    case 'LeftStance'
        swingFoot = nlp.Plant.ContactPoints.RightFootBottom;
    otherwise
        error('Cannot create swingFootPitch constraint. Unknown domain.');
end

eulerAngles = swingFoot.computeEulerAngle();
swingFootPitchFun = SymFunction(['swingFootPitch_',nlp.Plant.Name], eulerAngles(2), {nlp.Plant.States.x});

end

As you can see the robot has a ContactPoints field where the contact frames are defined.

I've tried to dig into both the FROST file template.cc and my own Mathematica copy of mdefs.h in order to add functionality to the "Dot" function, but that opens a whole can of worms I don't know how to deal with.

Can anyone help me to either troubleshoot this Euler Angles approach, or if you have implemented a similar constraint, suggest an alternative method?

Cheers,

-- James

Error "Struct contents reference from a non-struct array object"

Hi,
I have the following error when trying to run RABBIT's main_opt:
in r_stance = RightStance(rabbit); line 13 of main_opt.m
in domain = addContact(domain,right_sole,fric_coef); line 25 of RightStance.m

The problem is that no geometry parameter is passed to addContact, so when the test line 34 of addContact.m is ran, it returns false (because isempty(geometry)==1). Because of that geometry stays empty and the program fails line 45 at ref = geometry.RefFrame;

I do not understand all of it, but maybe the right test for line 34 would be if ((~isfield(geometry, 'RefFrame')) && isempty(geometry)) ?

Thank you !

Error running frost_addpath() with MathLink library

Hi,

I'm having some issues trying to rung the FROST package. I have followed the instruction on the Frost website but get the following error when trying to run forst_addpath().

>> frost_addpath
Invalid MEX-file '/usr0/home/rshu/matlab_ws/frost-dev/third/mathlink/math.mexa64': libML64i3.so: cannot open shared object file: No such file or directory

Error in initialize_mathlink (line 8)
    math('$Version')

Error in frost_addpath (line 28)
    initialize_mathlink();

My system is Ubuntu 16.04, Matlab R2019a, Mathematica 12. I would really appreciate any help trying to debug this error.

Thank you

How to change time discretization ?

Hi ! I am currently running a RABBIT optimization with a modified URDF file (simplified 2D Romeo). The optimisation is working great 👍
But I have a question, is it possible to change the time discretization of the optimization (right now one step is 42 frames, I would like to have 100 or more) ?
Thank you in advance !

Error while running truck example

Error while running the truck example.

Dot::dotsh: Tensors {{0, 0, 1, 0, 20, 0, 0, 0}} and 
    {{0. + vf, 0., <<5>>, 0. + 0.000446535 
                              6
        (-46500 p - 1.03273 10  phi - 445.5 r vf) - 
                        391112.              535800 vy
       0.0000345367 (r (------- - 5760 vf) - ---------) - 
                          vf                    vf
                                6
                     -4.05529 10  r   391112. vy
       0.0000149745 (-------------- + ----------)}} have incompatible shapes.
                           vf             vf
Error using eval_math (line 41)
The evaluation of Mathematica expression failed.

Error in SymExpression (line 91)
                    eval_math([obj.s '=' obj.f ';']);

Error in  *  (line 321)
            X = SymExpression(sstr);

Error in VirtualConstraint/configure (line 105)
                ya_der = jacobian(ya_fun{i-1},X)*dX;

Error in VirtualConstraint (line 345)
                obj.configure();


Error in truck/addRD2Output (line 74)
            y = VirtualConstraint(obj,ya,'y',...

Error in truck (line 61)
            obj.addRD2Output();

Can you direct me towards a fix.

Thanks

Atlas example error

I meet the following errors when running the atlas example

Undefined function or variable 'Link_pelvis_to_back_bkz_bar'.

Error in frost.Animator.Cylinder (line 58)
            xyz = obj.func(x0);

Error in frost.Animator.Display (line 77)
                obj.items(name) = frost.Animator.Cylinder(obj.axs, model, frame, offset, name, varargin{:});

Error in plot.LoadRobotDisplay (line 28)
    robot_disp = frost.Animator.Display(f, robot, opts);frame  = robot.Joints(6);


Error in plot.LoadSimAnimator (line 14)
    exo_disp = plot.LoadRobotDisplay(robot, varargin{:});

Error in main_sim (line 73)
anim = plot.LoadSimAnimator(robot, logger, 'SkipExporting',true);

additionaly, is there any docs about the example ?

Mathlink dependency with deprecated MLDisownDoubleArray etc.

Hello all. I'm trying to get frost-dev to work and am stuck on the dependencies. First of it seems that my Mathematica version came with libML64i4.* files instead of i3. files. I copied and renamed them which, when running testscript.m now seems to get past that issue.

Afterwards however I obtain the following error when running test-script:

>> testscript
Invalid MEX-file '/home/none/robotics/frost-dev/third/mathlink/math.mexa64': /home/none/robotics/frost-dev/third/mathlink/math.mexa64: undefined symbol: MLDisownDoubleArray

Error in testscript (line 1)
math('quit')

Which led me to think that some issue between i3. and i4. persists. If I look into mathlink.h (line 3634) indeed I see the notion that

/*
As of MLINTERFACE 3 the following functions have been deprecated.  Use the suggested functions in their
place:

MLDisownUnicodeString - MLReleaseUCS2String
MLDisownByteString    - MLReleaseByteString
MLDisownString        - MLReleaseString
*/

Subsequently I tried to compile the Mathlink code myself via the compileMatlink.m script that is included with the dependency (although it is mentioned that this would not be necessary) which results in the not completely unexpected error

Error using mex
/tmp/mex_93021259501672_31240/math.o: In function `WaitForReturnPacket':
math.c:(.text+0x124): undefined reference to `MLDisownString'
/tmp/mex_93021259501672_31240/math.o: In function `mexFunction':
math.c:(.text+0x9e4): undefined reference to `MLDisownString'
math.c:(.text+0xa98): undefined reference to `MLDisownDoubleArray'
collect2: error: ld returned 1 exit status


Error in compileMathlink (line 10)
mex(['-I', Mathematica_path, 'Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/'], ...

So all seems related but I am not sure how to proceed with this. Anyone have any idea? Thanks in advance!

The evaluation of Mathematica expression failed.

Dear ayonga:
I have a robot urdf file, and I want to calculate the dynamics of it. First I tried to follow the cassie example and write my own calculation script file, but when I write Holomomic Constraints I have some trouble.
In fact, my robot has closed-chain structures in it. So, I want to add some constraints to it. Here is my calculation script file:

        function obj = Cheetah(urdf)
            config = struct();
            config_file = GetFullPath(urdf);
            [config.name, config.links, config.joints, config.transmissions] = ros_load_urdf(config_file);
            obj = obj@RobotLinks(config, [], [], 'removeFixedJoints', true);
            obj.ConfigFile = config_file;
            
            %% Define contact frames
%             R = [0,-sin(deg2rad(50)),-cos(deg2rad(50));
%             0,cos(deg2rad(50)),-sin(deg2rad(50));
%             1,0,0];
                 
            % Bottom of L4
            FL_foot_frame = obj.Joints(getJointIndices(obj, 'FL1_4'));
            obj.ContactPoints.FL_foot_contact = CoordinateFrame(...
                'Name','FL_foot_contact',...
                'Reference',FL_foot_frame,...
                'Offset',[0.0177, 0.0522, 0],...
                'R',R...
                );
......
......
......
           %% Define other frames(IMU)
            Body_frame = obj.Joints(getJointIndices(obj, 'bar_B'));
                        
            IMU_frame = config.joints(strcmp({config.joints.Child}, 'IMU'));
            if ~isempty(IMU_frame)
                obj.OtherPoints.IMU = CoordinateFrame(...
                    'Name','IMU',...
                    'Reference',Body_frame,...
                    'Offset',IMU_frame.Offset,...
                    'R',IMU_frame.R...
                    );
            end
            %% Define Holomomic Constraints of loop chains
            % Spine loops(This is a triangular structure)
            FSb_l_var=(0.28561227+obj.States.x('FSb_l'));
            RSb_l_var=(0.28561227+obj.States.x('RSb_l'));
            B_S = [acos((0.20849221^2+0.16530351^2-FSb_l_var.*FSb_l_var)/(2*0.20849221*0.16530351));
                acos((0.20849221^2+0.16530351^2-RSb_l_var.*RSb_l_var)/(2*0.20849221*0.16530351))]-...
                [1.72783556;1.72783556]-[obj.States.x('B_FS');obj.States.x('B_RS')];
            B_Sb = [acos((0.20849221^2+FSb_l_var.*FSb_l_var-0.16530351^2)/(2*0.20849221*FSb_l_var));
                acos((0.20849221^2+RSb_l_var.*RSb_l_var-0.16530351^2)/(2*0.20849221*RSb_l_var))]-...
                [0.60851175;0.60851175]-[obj.States.x('B_FSb');obj.States.x('B_RSb')];
            B_S_constr = HolonomicConstraint(obj, B_S, 'B_S', ...
                'ConstrLabel', {{'B_S_F', 'B_S_R'}}, ...
                'Jacobian', jacobian(B_S, obj.States.x));
            B_Sb_constr = HolonomicConstraint(obj, B_Sb, 'B_Sb', ...
                'ConstrLabel', {{'B_Sb_F', 'B_Sb_R'}}, ...
                'Jacobian', jacobian(B_Sb, obj.States.x));
            obj = addHolonomicConstraint(obj, B_S_constr);
            obj = addHolonomicConstraint(obj, B_Sb_constr);
            
            % leg loops
        end

And here is the error message:

ans =

    '12.1.0 for Microsoft Windows (64-bit) (March 14, 2020)'

73              B_S = [acos((0.20849221^2+0.16530351^2-FSb_l_var.*FSb_l_var)/(2*0.20849221*0.16530351));
Thread::tdlen: Objects of unequal length in 
                                                               2
    {{-1.72784 + ArcCos[14.5077 (0.070794 - (0.285612 + x$32$1) )]}, 
                                                                2
      {-1.72784 + ArcCos[14.5077 (0.070794 - (0.285612 + x$33$1) )]}} + 
     {{-x$4$1}, {-x$30$1}, {-x$17$1}, {-x$31$1}} cannot be combined.
error using eval_math (line 46)
The evaluation of Mathematica expression failed.

error in SymExpression (line 91)
                    eval_math([obj.s '=' obj.f ';']);

error in  -  (line 266)
            X = SymExpression(sstr);

error in Cheetah (line 73)
            B_S = [acos((0.20849221^2+0.16530351^2-FSb_l_var.*FSb_l_var)/(2*0.20849221*0.16530351));

error in cheetah_gen (line 24)
cheetah = Cheetah('urdf/cheetah_frost.urdf');

What should I do to solve this?
Looking forward to your reply. And any plan to change the background to matlab symbolic calculation?

GmapName_ in addInput.m for nonaffine case

Hi,

When trying addInput with nonaffine input vector, I came across an error. No reference to _sfun_gf.Name_.

I believe that was because sfun_gf was assigned an empty vector for nonaffine case, in line 96 of addInput.m

        if opts.Affine % The input is affine to the system
            ...........
        else
            assert(nc==1,...
                'The input vector must be a column vector.');
            sfun_gf = [];
            
            if isa(s_gf, 'SymFunction') % given as a SymFunction directly
                assert(length(s_gf.Vars)==2 && s_gf.Vars{1} == obj.States.x && s_gf.Vars{2}==var,...
                    'The SymFunction (gf) must be a function of states (x) and input (%d).',name);
                sfun_gv = s_gf;
            else % given as a SymExpression, then create a new SymFunction
                sfun_gv = SymFunction([name '_vec_', obj.Name], s_gf, {obj.States.x,var});
            end
        end
        
        
        % add a field with the name for Inputs, Gmap, Gvec, and inputs_
        obj.Inputs.(category).(name) = var;
        obj.Gmap.(category).(name) = sfun_gf;
        obj.Gvec.(category).(name) = sfun_gv;
        obj.GmapName_.(category).(name) = sfun_gf.Name;

Regards
Prasanth

Exit Status: Restoration Failed (What does this mean?)

Hi Ayonga,

I get this exit status (Restoration Failed) for some of my optimization trials. Can you help me understand what that means? I pasted my optimization report below for reference.

Thanks!

Optimization Report:

Number of Iterations....: 84

                               (scaled)                 (unscaled)

Objective...............: 5.1802723933401123e-08 5.1802723933401123e-08
Dual infeasibility......: 2.9379169971882279e-03 2.9379169971882279e-03
Constraint violation....: 1.7425297660075284e-01 1.7425297660075284e-01
Complementarity.........: 6.4652254579601839e-08 6.4652254579601839e-08
Overall NLP error.......: 1.7425297660075284e-01 1.7425297660075284e-01

Number of objective function evaluations = 154
Number of objective gradient evaluations = 49
Number of equality constraint evaluations = 154
Number of inequality constraint evaluations = 154
Number of equality constraint Jacobian evaluations = 87
Number of inequality constraint Jacobian evaluations = 87
Number of Lagrangian Hessian evaluations = 0
Total CPU secs in IPOPT (w/o function evaluations) = 0.724
Total CPU secs in NLP function evaluations = 9.340

**Restoration phase converged to a feasible point that is
unacceptable to the filter for the original problem.
Restoration phase in the restoration phase failed.

EXIT: Restoration Failed!**

configure dynamics error: The evaluation of Mathematical expression failed

Hello all,
I'm trying to configure the dynamics of the robot model. Which always gives me the error:

SparseArray::list: 
   List expected at position 1 in 
    SparseArray[BlockDiagonalMatrix[{{{10.33, 0., 0.}, {0., 10.33, 0.}, 
        {0., 0., 10.33}}, {{0.0942, 0.000169, 0.015}, 
        {0.000169, 0.084, 0.000516}, {0.015, 0.000516, 0.113}}}]].

expr =

    'symvar$22199=InertiaMatrixByLink[Sequence@@{symvar$22197, symvar$22198}];'

Error using assert
The evaluation of Mathematica expression failed.

Error in eval_math (line 48)
    assert((~strcmp(ret, '$Failed'))&&(~strcmp(ret, '$Aborted')),...

Error in SymExpression (line 91)
                    eval_math([obj.s '=' obj.f ';']);

Error in eval_math_fun (line 53)
    ret = SymExpression(fstr,varargin{:});

Error in RobotLinks/configureDynamics (line 47)
        De{i} = eval_math_fun('InertiaMatrixByLink',[links(i),{obj.numState}]);

Error in model_gen (line 36)
cassie.configureDynamics('DelayCoriolisSet',false);

This happens with the example robots as well as Cassie Model (https://github.com/UMich-BipedLab/Cassie_Model)

I currently use Matlab 2022a and Mathematica 13.1.
Is version 13 of Mathematica not working, or am I missing something?

Thanks in advance!
Cheers

What is the use of the "actuators" information ?

Hi,
I am trying to adapt your code to run it with our URDF description, but we do not have the part about "actuators".
I'm looking at the RABBIT example as it is the only one that runs for me yet. In the code, I can find this part translated into dofs.Actuator.something (in configure.m), but it doesn't seem to be used afterwards.
In the "rabbit" object at the end of execution, the joints each have an "Actuator" field, but it is left empty. And I don't see where else this information could appear...
So, my question is : is this part of the URDF necessary to run FROST ?

Potential bugs in the code(?)

Hi @ayonga ,

Great work with FROST :)

I came across a couple errors, just wasn't sure if I made a mistake in the code?

  • ./ matlab/system/<@>HolonomicConstraint/imposeNLPConstraint.m

    Line 27

                   nlp = addNodeConstraint(nlp, obj.ddh_, {'x','dx','ddx'}, 'all',...
                 0, 0, 'Nonlinear');
          elseif strcmp(obj.Type, 'FirstOrder') % the first order system
             % enforce \dot{h}(x,dx) = J(x)dx = 0 at the first node
             nlp = addNodeConstraint(nlp, obj.dh_, {'x'}, 'first',...
                 0, 0, 'Nonlinear');

could it be obj.Type or obj.Model.Type

  • ./ matlab/system/<@>HolonomicConstraint/configure.m

    Line 41

             F = sum(horzcat(model.Fvec{:}),2);
             dX = M\F;
            dh = Jh * dX;
             obj.dh_ = SymFunction(['dh_' name '_' model.Name], dh, {x});

faced a dimension mismatch error for dh = Jh * dX.

Thanks
Prasanth

Error: No appropriate method, property, or field 'Vars' for class 'SymExpression'

Just updated to the latest commit and I get the following error even on running the RABBIT example:

No appropriate method, property, or field 'Vars' for class 'SymExpression'.

Error in SymExpression/subsref (line 676)
                    B = builtin('subsref', L, Idx);

Error in DynamicalSystem/addInput (line 90)
            assert((length(s_gf.Vars)==1 && s_gf.Vars{1} == obj.States.x) || isempty(s_gf.Vars),...

Error in RobotLinks/configure (line 179)
            obj.addInput('Control','u',u,gf);

Error in RobotLinks (line 97)
                configure(obj, config, base, load_path, varargin{:});

Error in RABBIT (line 33)
            obj = obj@RobotLinks(urdf,base);

Error in main_opt (line 17)
rabbit = RABBIT('urdf/five_link_walker.urdf');

Question on running frost_addpath()

Hello, I just installed frost following the webpage instruction and try to run test
frost_addpath(); in matlab.
However, I am getting the following error

>> frost_addpath();
MathLink connection was lost.

ans =

    '$Failed'

MathLink connection was lost.
MathLink connection was lost.
MathLink connection was lost.
MathLink connection was lost.
Error using eval_math (line 46)
The evaluation of Mathematica expression failed.

Error in initialize_mathlink (line 24)
    eval_math('Needs["RobotManipulator`"];');

Error in frost_addpath (line 28)
    initialize_mathlink();

Is this because I am on the status waiting license activation for wolfram mathematica?

How to run animation for Atlas ?

Hi,
Thank you for developping FROST ! I am trying to install your code and to understand how it must be used, but I have some trouble...
After running main_sim.m or main_opt.m in the Atlas example, I obtain a lot of nice variables in the workspace, but no animations, and I couldn't find timeseries or trajectories that could be interesting to plot. It would be nice to have some kind of visualization to understand what your program is doing...
The (commented in the code) lines

export_file = fullfile(cur,'tmp','atlas_multi_contact_walking.avi');
anim = animator(atlas);
anim.animate(calcs,export_file)

do not work, and I found no documentation on the use of animator. Is there maybe some documentation pages I am missing ? Could you please explain me how you exploit the optimisation results ?

Thanks a lot !

Mathematica plugins or just kernel ?

Hi,
I have a question about the installation of Mathematica needed for FROST (to know what licenses the lab needs to buy). Do I need to install any Wolfram plugins or is the kernel enough ?
Thanks !

question about the 2D robot

Hi ayonga
I wanna use frost to do optimation and simulation for a 2D robot.According to what i learn from code,frost use Homogeneous translation matrix to descript a 3D coordinate.Is it possible to do optimation and simuation for a 2D robot?

Some questions for URDF visualization

Hi,
I had some problems to visualize (in Rviz) the URDF files of RABBIT and Atlas included in the example section. It was mostly due to not having a link named base_link (renaming the torso did the trick).
Also, the URDF for Atlas mentions some mesh files, but I did not find them in the project. Do you need them or perhaps the URDF could be simplified ?

barrier.mat is missing for the truck example.

Hi @ayonga,

barrier.mat file is missing from the truck example.

Error using load
Unable to read file 'barrier.mat'. No such file or directory.

Error in truck_opt_constr (line 24)
    load('barrier.mat','P_bar');

Error in TrajectoryOptimization/configure (line 58)
    plant.UserNlpConstraint(obj, bounds, varargin{:});

Error in TrajectoryOptimization (line 164)
                    obj = configure(obj, bounds);

Error in main (line 28)
nlp = TrajectoryOptimization('truckopt',sys,10,bounds,opts);

Kindly look into it.

Thanks

Getting more done in GitHub with ZenHub

Hola! @ayonga has created a ZenHub account for the ayonga organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @ayonga.

ZenHub Board

question about the optimization result of rabbit example in FROST

Hi, I have one problem about the optimization results about rabbit example in FROST. In RightStance.m, I change tau = (t-p(2))/(p(1)-p(2)); into tau = (x('BasePosX')-p(2))/(p(1)-p(2)); and I also change the TimeBased phase-type into StateBased phase type.
The optimization runs just fine.
When I look into the result, I found something weird.
I assume the optimized Bezier curve coefficient is stored in params.atime of [tspan, states, inputs, params] = exportSolution(nlp, sol); Based on what I've learned, the first coefficient of Bezier curve should equal to the initial corresponding state of the optimized orbit. the coefficient of Bezier curve should equal to the last corresponding state of the optimized orbit. But it's not the case in the optimization result.
Here is the coefficient of the 4 5th-order Bezier curves (24 numbers in the param.atime, not sure what does atime mean)

  • 2.71618571692464 0.515515095636679 2.71705785916497 1.02499554796246 2.86538716761488 0.468324521468795

  • 2.48324948627866 1.15124079095115 2.98496637234353 0.499653975816616 2.24823964188322 0.897687575012935

  • 3.03613034792144 0.646974647833675 2.42657908023512 0.0167244308523125 3.10412530275568 0.801064202668094

  • 3.27017750951884 -0.147216276707749 2.74238646146068 3.79910980485377 1.35969708221527 -0.260488859460432

And there is the first column of states.x

  • 0.160669780340591 0.741546376010217 0.146173027697750 2.45916544725954 0.645968711581861 2.95613077740528 0.597108636820039

As you can see, the first coefficient of each Bezier curve is not equal to x4-x7.

My question is:

  1. what does the results of optimization mean?

  2. where can I find the value of p in tau = (t-p(2))/(p(1)-p(2));, I suppose p is also being optimized?

  3. has there any one used FROST to optimize planar multi-domain walking?

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.