Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors and solutions for "examples" #19

Closed
Beta-y opened this issue Apr 24, 2024 · 13 comments
Closed

Errors and solutions for "examples" #19

Beta-y opened this issue Apr 24, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@Beta-y
Copy link

Beta-y commented Apr 24, 2024

Hi @BJCaasenbrood, thank you for your excellent work!

There are several errors when I tested the provided examples, and I tried to fix them all. Here are the details:

Error 0:
Unrecognized field name "V"

Influenced examples by Error 0:
fem_eigen_comp

Fix Error 0:
Line 18 of examples\fem\fem_eigen_comp.m: fem.solver.sol.x = fem.solver.pod.V(:,ii) * 250;
should be: fem.solver.sol.x = fem.solver.sol.pod.V(:,ii) * 250;

Error 1:
Incorrect size for expression 'Dvec': expected [6x6x:?x:?] but found [5x1].
Error in computeLagrangianGaussFast_mex

Influenced examples by Error 1:
dellasantina_arm
softhand
backbone_test
shapes_octoarm
shapes_reconstruct
shapes_threebellow_robotmanipulator

Fix Error 1:
I found it in computeLagrangianGaussFast.h that the type of "Dvec" is declared as "const emxArray_real_T *", but the "generateMexCLGF.m" uses "coder.typeof(10,[5,1])" for "Dvec", which means it's correct. So I ran "generateMexCLGF.m" again, got the correct mex-file, and fixed this problem finally.

Error 2:
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.

Influenced examples by Error 2:
suzumori_gripper
jacobian_control_shapes
shapes_backbone_IK_test

Fix Error 2:
Line 76 of tubeplot.m: Fx = (1+1/8*sin(2*X).^2)*cos(X)
should be: Fx = (1+1/8*sin(2*X).^2).*cos(X)

Warning 1 (when running dellasatina_arm):
Warning: Name is nonexistent or not a directory: PATH\mpi-packages\sorotokicode+preset+shapes\assets

Fix Warning 1:
Line 49 of katzschmann.m: functionPath = fullfile(currentDir,'assets');
should be: functionPath = fullfile(fileparts(currentDir),'assets');

Hope them can be merged into next version. Thank you again for your great work!

@BJCaasenbrood
Copy link
Owner

BJCaasenbrood commented Apr 24, 2024

He @Beta-y, thanks a lot of the debugging. I'll get on them right away. As for error 1, yesterday I've added the ability to add viscous drag. If you have the latest version of Sorotoki you can call:

sorotoki update

Also make sure to build the code using sorotoki build. I did hear from a user, the build didn't work for him (not sure why). If you have this issue as well, please report back to me. If it doesn't work, you can run SorotokiCode/lib/sorotokimodel/mex/lagrangian/generateMexCLGF.m. Make sure you are in the folder SorotokiCode/lib/sorotokimodel/mex/lagrangian/.

@BJCaasenbrood BJCaasenbrood added the bug Something isn't working label Apr 24, 2024
@BJCaasenbrood
Copy link
Owner

Addressed error 0 in following commit: 0e4fa5c

Running fem_eigen_comp should give the following result:

image

@BJCaasenbrood
Copy link
Owner

BJCaasenbrood commented Apr 24, 2024

Addressed error 2 in following commit: BJCaasenbrood/SorotokiModel@e8a3597

Note: Shapes.show now uses the rtubeplot function instead of tubeplot. This will like change in the future, giving users to option to choose between the two.

Edit: You might have to update MatlabEssentials as well

@BJCaasenbrood
Copy link
Owner

Addressed warning 1 in following commit f39f0c1

@Beta-y
Copy link
Author

Beta-y commented Apr 24, 2024

Thank you for your kind help and sugesstions! I used sorotoki update and found another error in checkSoroPackages(line 19):

Unable to convert '24-Apr-2024 15:59:11' to datetime using the format 'dd-MMM-yyyy HH:mm:ss'.
If the date/time text contains day, month, or time zone names in a language foreign to the
'zh_CN' locale, those might not be recognized. You can specify a different locale using the
'Locale' parameter.

It seems to be a language setting problem. I replaced installDate = datetime(mpiDates{I}, 'InputFormat', 'dd-MMM-yyyy HH:mm:ss') into installDate = datetime(mpiDates{I}, 'InputFormat', 'dd-MMM-yyyy HH:mm:ss','Locale','en_US') and it works successfully.

I'll keep on checking your commit. Thanks a lot~

@BJCaasenbrood
Copy link
Owner

BJCaasenbrood commented Apr 24, 2024

installDate = datetime(mpiDates{I}, 'InputFormat', 'dd-MMM-yyyy HH:mm:ss','Locale','en_US')

@Beta-y Damn you are on 🔥, today. Truly appreciate all your debugging work! I'll include it in the latest patch. Thanks again!

Edit: Issue resolved in commit: 4a19449

@Beta-y
Copy link
Author

Beta-y commented Apr 24, 2024

He @Beta-y, thanks a lot of the debugging. I'll get on them right away. As for error 1, yesterday I've added the ability to add viscous drag. If you have the latest version of Sorotoki you can call:

sorotoki update

Also make sure to build the code using sorotoki build. I did hear from a user, the build didn't work for him (not sure why). If you have this issue as well, please report back to me. If it doesn't work, you can run SorotokiCode/lib/sorotokimodel/mex/lagrangian/generateMexCLGF.m. Make sure you are in the folder SorotokiCode/lib/sorotokimodel/mex/lagrangian/.

sorotoki build does not work for me, as well. I think there is something wrong in @sorotoki\private\buildSorotokiMex.m (Line 191) about buildLagrangian. The coder.typeof of Dvec should be coder.typeof(10,[5,1]) instead of coder.typeof(10,[6,6,inf,inf]).

@BJCaasenbrood BJCaasenbrood reopened this Apr 24, 2024
@BJCaasenbrood
Copy link
Owner

He @Beta-y, thanks a lot of the debugging. I'll get on them right away. As for error 1, yesterday I've added the ability to add viscous drag. If you have the latest version of Sorotoki you can call:

sorotoki update

Also make sure to build the code using sorotoki build. I did hear from a user, the build didn't work for him (not sure why). If you have this issue as well, please report back to me. If it doesn't work, you can run SorotokiCode/lib/sorotokimodel/mex/lagrangian/generateMexCLGF.m. Make sure you are in the folder SorotokiCode/lib/sorotokimodel/mex/lagrangian/.

sorotoki build does not work for me, as well. I think there is something wrong in @sorotoki\private\buildSorotokiMex.m (Line 191) about buildLagrangian. The coder.typeof of Dvec should be coder.typeof(10,[5,1]) instead of coder.typeof(10,[6,6,inf,inf]).

It seems you are still running an older version I think, this change is implemented in a commit yesterday. You can see here: https://github.com/BJCaasenbrood/SorotokiModel/blob/master/mex/lagrangian/generateMexCLGF.m

@Beta-y
Copy link
Author

Beta-y commented Apr 24, 2024

He @Beta-y, thanks a lot of the debugging. I'll get on them right away. As for error 1, yesterday I've added the ability to add viscous drag. If you have the latest version of Sorotoki you can call:

sorotoki update

Also make sure to build the code using sorotoki build. I did hear from a user, the build didn't work for him (not sure why). If you have this issue as well, please report back to me. If it doesn't work, you can run SorotokiCode/lib/sorotokimodel/mex/lagrangian/generateMexCLGF.m. Make sure you are in the folder SorotokiCode/lib/sorotokimodel/mex/lagrangian/.

sorotoki build does not work for me, as well. I think there is something wrong in @sorotoki\private\buildSorotokiMex.m (Line 191) about buildLagrangian. The coder.typeof of Dvec should be coder.typeof(10,[5,1]) instead of coder.typeof(10,[6,6,inf,inf]).

It seems you are still running an older version I think, this change is implemented in a commit yesterday. You can see here: https://github.com/BJCaasenbrood/SorotokiModel/blob/master/mex/lagrangian/generateMexCLGF.m

It is kind of strange that neither update or re-install gives the correct latest commit. I've tried to uninstall sorotokicode, and reinstall using mpi install sorotokicode --all-paths (mpi install sorotokicode -u https://github.com/BJCaasenbrood/SorotokiCode.git --all-paths as well). Calling sorotoki update shows the following:

lastestDate =

datetime

19-Apr-2024 20:04:25

installDate =

datetime

24-Apr-2024 20:50:48

....

Sorotoki libraries found on MPI are up-to-date

It seems the package is not latest. Let me check this tommorrow! lol~ Thanks you a lot for your kind help :P

@Beta-y
Copy link
Author

Beta-y commented Apr 25, 2024

He @Beta-y, thanks a lot of the debugging. I'll get on them right away. As for error 1, yesterday I've added the ability to add viscous drag. If you have the latest version of Sorotoki you can call:

sorotoki update

Also make sure to build the code using sorotoki build. I did hear from a user, the build didn't work for him (not sure why). If you have this issue as well, please report back to me. If it doesn't work, you can run SorotokiCode/lib/sorotokimodel/mex/lagrangian/generateMexCLGF.m. Make sure you are in the folder SorotokiCode/lib/sorotokimodel/mex/lagrangian/.

sorotoki build does not work for me, as well. I think there is something wrong in @sorotoki\private\buildSorotokiMex.m (Line 191) about buildLagrangian. The coder.typeof of Dvec should be coder.typeof(10,[5,1]) instead of coder.typeof(10,[6,6,inf,inf]).

It seems you are still running an older version I think, this change is implemented in a commit yesterday. You can see here: https://github.com/BJCaasenbrood/SorotokiModel/blob/master/mex/lagrangian/generateMexCLGF.m

It is kind of strange that neither update or re-install gives the correct latest commit. I've tried to uninstall sorotokicode, and reinstall using mpi install sorotokicode --all-paths (mpi install sorotokicode -u https://github.com/BJCaasenbrood/SorotokiCode.git --all-paths as well). Calling sorotoki update shows the following:

lastestDate =
datetime
19-Apr-2024 20:04:25
installDate =
datetime
24-Apr-2024 20:50:48
....
Sorotoki libraries found on MPI are up-to-date

It seems the package is not latest. Let me check this tommorrow! lol~ Thanks you a lot for your kind help :P

I noticed that it seems (not sure) that neither sorotoki install or sorotoki update would update sorotokicode, but just repos listed in variable named soroPackages.

BTW, there is exactly something wrong in @sorotoki\private\buildSorotokiMex.m (Line 191) about buildLagrangian, which is included in sorotokicode, and the coder.typeof of Dvec should be coder.typeof(10,[5,1]) instead of coder.typeof(10,[6,6,inf,inf]). Please refer to https://github.com/BJCaasenbrood/SorotokiCode/blob/master/%40sorotoki/private/buildSorotokiMex.m

@BJCaasenbrood
Copy link
Owner

BJCaasenbrood commented Apr 25, 2024

@Beta-y Thanks for being so thorough. This is indeed true. sorotoki install only updates its packages and not itself. I do agree it is a flaw atm, but I am not sure (yet) how to implement this neatly within mpi. The problem stems from set-overwriting code... If you wish, you could post a separate issue on this, so we may solve this in the future.

Edit: I've recreated a new issue on the matter: #20

I've updated sorotokiBuildMex to use the builder scripts from the individual packages. This is included in the following commit: 144c166

Every time I push something new to SorotokiCode there is an automated routine that checks if the code passes testing. The test routine can be found here CircleCI, but for convenience I've pasted the results in the image below:

image

Everything should build correctly now using sorotoki build.

As for the issue with the sinatra_gripper from the paper, the issue is resolved in 9a237c4. It was still using an out-dated implementation of viscous drag now implemented in Shapes.addDrag().

@Beta-y
Copy link
Author

Beta-y commented Apr 25, 2024

@Beta-y Thanks for being so thorough. This is indeed true. sorotoki install only updates its packages and not itself. I do agree it is a flaw atm, but I am not sure (yet) how to implement this neatly within mpi. The problem stems from set-overwriting code... If you wish, you could post a separate issue on this, so we may solve this in the future.

I've updated sorotokiBuildMex to use the builder scripts from the individual packages. This is included in the following commit: 144c166

Every time I push something new to SorotokiCode there is an automated routine that checks if the code passes testing. The test routine can be found here CircleCI, but for convenience I've pasted the results in the image below:

image

Everything should build correctly now using sorotoki build.

As for the issue with the sinatra_gripper from the paper, the issue is resolved in 9a237c4. It was still using an out-dated implementation of viscous drag now implemented in Shapes.addDrag().

Thank you very much for your kind help! Everthing works correctly right now.

I‘ll post a separate issue on the self-updating. Hope more people will use this kit. Thanks again for your great work~

@BJCaasenbrood
Copy link
Owner

Issue of sorotoki update referred to #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants