Hi all,
I’m trying to to execute Anybody as a Batch in Matlab. Starting the Batch works fine with DOS_command but MATLAB gets no information back as soon as Anybody is finished. Therefor it does not execute the next step in calculations.
I found out that 2 different informations would help me:
Anybody sending a message to MATLAB that it is finished or
Shutting down Anybody (automatically) after the calculations are finished. For some reason MATLAB than gets the information that Anybody is shut down and executes next steps in the code. Is there a command which shuts down anybody after being finished?
I you are using a macro file with the console application then you may need to also specify ‘-ni’ keyword:
anybodycon.exe -m “macorfile.anymcr” -ni
I think this is the best option. I will ensure that anybodycon does not enter the interactive mode after it has run the macro commands. Thus it will always exit when the calculations are done.
Another way is to to add the ‘exit’ macro command after your other macros commands. However, if there is any error in the script it may still go to the interactive mode.
Btw. If you are interesting in batch processing anybody models there there is a tutorial here: Batch processing
It shows some cool features and it doesn’t rely on matlab.
I may have misunderstood what you are doing. Now, I suspect you are actually calling the GUI application (anybody.exe) from matlab. Am I right?
What you should do is call the anybody console application “anybodycon.exe”.
You should put your macro commands in a file (e.g. “macro.txt”)
“”""""""""""""""""""""""""
load “MyModel.main.any”
operation Main.Study.Kinematics
run
“”"""""""""""""""""""""""
Then you can call the “anybodycon.exe” with the following DOS command.
anybodycon.exe -m “macro.txt” -ni
The “-m” command specifies the path the file with the macro commands. The “-ni” command indicates that the console application should be started in non-interactive mode. Thus, the program will automatically quit after executing the commands.
In Matlab you can capture the console output to inspect for any errors etc.
Hi,
I solved the problems above. Thanks for your help.
Now I got the problem that after saving data in the inverse dynamics matlab stays “busy” and says closing last loaded model…
and after a while a window pops up which says that anybodycon.exe is not replying anymore. Data are saved though. When I close the window Matlab is not “busy” anymore. But obviously I don’t want to close this window every time i run invers dynamics…
I may have a similar problem with some of my batch processing scripts. Some crash when the model exits. When I click OK in the crash dialog box that appears I still get all the output from the console.
I run my batch processing scripts from python. I think it must be a bug in the anybody modelling system, and I am talking to one the developers about a fix.
I will keep you update when I figure something out.
Hi Morton,
thanks for your quick response.
First I thought it is a problem with saving big data but I commented the “saving” out but the problem still appears.
I also get all data when I close the information box.
I don’t have the problem with kinematics or foot position, only when I run inverse dynamics model . In AnyBody 6.0
Matlab usually say ans=0 after closing a model, but after the inverse dynamics and closing the infomation box matlab writes something like ans=-1*10^9.
I assume that’s not the right information for closing down.
I would be very happy if you could ask someone and keep me up to data.
Hi guys!
Sorry for the delay… and I hope it could help you if you’re still blocked with that specific problem: I wrote functions to launch lots of studies in batch. Please, contact me on my e-mail if you’re interested, I’ll share it with pleasure !!