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

[Announcement] Script to port Simulink models from WBT v4 to WBT v5 #167

Closed
diegoferigo opened this issue Jan 21, 2019 · 9 comments
Closed

Comments

@diegoferigo
Copy link
Member

diegoferigo commented Jan 21, 2019

The upcoming v5 release of WBT (at the time of writing in the devel branch) will break the compatibility of the controllers based on the previous releases.

I developed a bash script to automatically update the controllers. It should work OOTB in both GNU/Linux and macOS, and on Windows using the shell provided by Git BASH.

It should be properly tested by @gabrielenava, please let me know if you face any issue.

Usage

wget https://gist.githubusercontent.com/diegoferigo/e2a693b9329c26e7f90d17cf1c3f014e/raw/974acd3c748884161fd70b39020fbf2b5aacae6b/WBT4_to_WBT5.sh
chmod +x WBT4_to_WBT5.sh
#
# Read the help executing:
# ./WBT4_to_WBT5.sh -h
#
# Example:
# ./WBT4_to_WBT5.sh -i model_WBT4.mdl -o model_WBT5.mdl

cc @traversaro

@diegoferigo diegoferigo self-assigned this Jan 21, 2019
@diegoferigo diegoferigo changed the title [Announcement] Script to port controllers from WBT v4 to WBT v5 [Announcement] Script to port Simulink models from WBT v4 to WBT v5 Feb 2, 2019
@lrapetti
Copy link
Member

lrapetti commented Mar 12, 2019

While trying to port a model to WBT using this bash script I am getting the following error:

$ ./WBT4_to_WBT5.sh -i torqueBalancingPHRIStandup.mdl -o torqueBalancingPHRIStandup_WBT5.mdl
\e[1;32m==>\e[0m Processing torqueBalancingPHRIStandup.mdl model
  \e[1;34m->\e[0m Creating copy of the input mdl
  \e[1;34m->\e[0m Processing wholeBodyStates blocks
sed: 1: "torqueBalancingPHRIStan ...": undefined label 'orqueBalancingPHRIStandup_WBT5.mdl'

The model I am trying to port is the one in https://github.com/Yeshasvitvs/whole-body-controllers/tree/andy_standup.

(I am working on MacOS)

@diegoferigo
Copy link
Member Author

Are you using the bash shell?

@diegoferigo
Copy link
Member Author

I suspect the error is related to https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux. Can you please check?

@lrapetti
Copy link
Member

I suspect the error is related to https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux. Can you please check?

I have tried to install and use GNU-sed (installed via homebrew) in place of MacOS sed and it ended successfully:

$ ./WBT4_to_WBT5.sh -i torqueBalancingPHRIStandup.mdl -o torqueBalancingPHRIStandup_WBT5.mdl
\e[1;32m==>\e[0m Processing torqueBalancingPHRIStandup.mdl model
  \e[1;34m->\e[0m Creating copy of the input mdl
  \e[1;34m->\e[0m Processing wholeBodyStates blocks
  \e[1;34m->\e[0m Processing wholeBodyModel blocks
  \e[1;34m->\e[0m Processing wholeBodyActuators blocks
\e[1;32m==>\e[0m The model compatible with WBT v5 has been created in torqueBalancingPHRIStandup_WBT5.mdl
\e[1;32m==>\e[0m Success

However, I still see those Unresolved Link blocks (while I can add new blocks without getting this error):
Screen Shot 2019-03-12 at 18 02 09

@diegoferigo
Copy link
Member Author

diegoferigo commented Mar 12, 2019

I know the problem. Unfortunately when you download the raw version of a file hosted in Gist, the url is unique and points to a specific revision. In fact, it was pointing to the first version of the script, I updated it some while ago but wget was still downloading the outdated version.

Please follow again the instructions of the first post, it should work now.

@lrapetti
Copy link
Member

I know the problem. Unfortunately when you download the raw version of a file hosted in Gist, the url is unique and points to a specific revision. In fact, it was pointing to the first version of the script, I updated it some while ago but wget was still downloading the outdated version.

Please follow again the instructions of the first post, it should work now.

@diegoferigo
thanks! It seems that using the update conversion script it is working fine, and the new .mdl is loaded correctly.

@gabrielenava
Copy link
Collaborator

I've ported the controllers inside whole-body-controllers in the new WBT V5.0 and I tested the momentum-based-yoga controller on iCubGenova04. The demo was performing as before. I also tested all the controllers in simulation and I've found no issues related to the update.

@yeshasvitirupachuri
Copy link
Member

@diegoferigo correction in the example usage listed in #167 (comment). The input model argument specified -i is missing.

./WBT4_to_WBT5.sh -i model_WBT4.mdl -o model_WBT5.mdl

@diegoferigo
Copy link
Member Author

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants