AnyBody and Python??

Hi,

I just recently updated to AMS6.0 and I would like to use MoCap-GMFoot for the use of the numerous foot bones. However, when I try to load the main file, I get an error which prevents it from loading.

ERROR(SCR.EXP.FUN.EXT4)

How can I fix this? In my AnyBody.6.0 folder, there is a folder called AnyBody.Python with 2 .dll files in there (AnyBody.Python.2.6 & AnyBody.Python.2.7). Similarly in my AnyBody.5.3 folder, inside the AnyBody.Python folder there is the same 2 .dll files. I do not understand this error because I haven’t received this error when using AMS 5.3.

How do I get rid of this error?

Thank you,
Chris

Hello Chris,

as it is mentioned in the reference manual, this error indicates that something went wrong with one of the python functions used in the model. So I would assume that something with your local python installation is conflicting.

Which version of AMS 6.0 are you using? If you are trying the 64 bit version, you also need to install a 64 bit version of Python. Since AMS 5.3 was only available as 32 bit version, this could very likely be the problem. Our experience so far is that it is no problem to have Python installed in 32 and 64 bit in parallel.

Best regards
Daniel

Daniel,

I am using AMS 6.0 (32-bit version). Since AMS 5.3 is available only as a 32-bit version, I shouldn’t have any problems with the AMS 6.0 (32-bit). So I don’t know what to do. Also, I don’t know anything about Python (if that makes a difference).

Please let me know any suggestions you may have.

Thanks,
Chris

Chris,

you said you haven’t received the error in AMS 5.3. Did you mean you ran the MoCap-GMFoot model in AMS 5.3 or another model?
As far as I remember the MoCap-GMFoot model was not in the AMMR 1.5.1 coming along with AMS 5.3 and loading the model from the AMMR 1.6 requires at least some modifications to the model.

Is ERROR(SCR.EXP.FUN.EXT4) the complete error message you get? If not could you post the complete message, please?

Regards,
Daniel

Daniel,

I did NOT run MoCap-GMFoot with AMS 5.3. I meant to say that I have never received this error with any file I have run.

Loading Settings Script from : 'C:\Users\BME_RU\AppData\Local\AnyBody Technology\AnyBody.6.0.x\Settings.anyst
Settings Loaded
Loading Main : “C:…\MoCap-GMFoot.main.any”
Scanning…
Parsing…
Constructing model tree…
Linking identifiers…
Evaluating constants…
ERROR(SCR.EXP.FUN.EXT4) : C:/U…s/B…U/D…p/A…0/AMMR/A…n/Beta/M…t/S…g/RBFLandmarks.any(78) : ReadMLFile : AnyBody.Python extension module is not installed or does not match installed version of Python.
Model loading skipped

Explanation:
This error arises if neither of AnyBody’s Python interfaces matches any of the installed Python versions. AnyBody’s binaries contain the folder called AnyBody.Python, which contains the Python interfaces, such as AnyBody.Python.2.x.dll for version 2.x of Python. If a matching dll for the installed version of Python does not exist, interfacing cannot happen.

Chris

Chris,

that error message gives some more information. The reason why I asked if you had ran this model on another version is that it uses python functions to read out force plate data which are applied to the foot. As far as I remember it is the only function in the AMMR that is using these python functions. That is probably the reason why you haven’t seen this error before.

But now to the error. It looks as that the AMS cannot find the python installation. Just to make sure: do you have python installed, whether python 2.6 or python 2.7 as 32 bit version? To have the .dll files in the installed directory is not enough, you also need to have a “normal” python installed (http://www.python.org/).

You can also find some information about this topic on the wiki page http://wiki.anyscript.org/index.php/All_about_including_a_Python_Hook.

I hope this helps solving the problem.

Best regards
Daniel

Daniel,

Thank you for your help. I installed Python(x,y) and it worked. Let’s hope it stays working. Now all I have left to do is find the file to edit metatarsal lengths and I’m good to go!

Thanks again,
Chris

Chris,

glad that you solved the problem. If you looked a bit around on the wiki page, you probably found the section of the foot model http://wiki.anyscript.org/index.php/AnyBody_Body_Model#The_Glasgow-Maastricht_Foot_Model_.28FootGM.29.

I hope finding the right file doesn’t take too long for you. Normally you can just double-click a segment in the ModelView which opens the object (or a drawing object for the segment which is typically inside the object itself) and use the object description to go to the construction. More tips about navigating in AMS are also on the AnyBody YouTube channel http://www.youtube.com/watch?v=MQsUUdoKsGg&list=TLZoeocLm7twhItynPwwJnQ_Jdko0EE-nN

Best regards
Daniel

Daniel,

That video was very helpful. Since you last commented, I have tried troubleshooting but I can’t seem to find the problem. I have found the code to edit the length of Metatarsal3 (right side) and the video helped me confirm that I am in the right place. Unfortunately, this file is NOT loaded when the main file is run.

I am in the Leg-TD-FootGM\Leg.root.any file now.

/// Definition of the leg segments
AnyFolder Seg = {
#include “<ANYBODY_PATH_BODY>FootGM/Seg.any”
#include “Seg.any”
#include “<ANYBODY_PATH_BODY>FootGM/PressureContactNodes.any”
#include “<ANYBODY_PATH_BODY>FootGM/LigAndMusNodes.any”

The code to change the length is found in the “<ANYBODY_PATH_BODY>FootGM/Seg.any” The only file out of these 4 that are Loaded is the second one, the “Seg.any”. I have tried commenting out one or the other. I have tried combining different parts of different files and nothing seems to work. I am simply trying to get the “<ANYBODY_PATH_BODY>FootGM/Seg.any” to load so I can edit the MT length.

If you have any ideas, please let me know.

As always, thank you so much for your help.

Chris

Chris,

I had a look at the model and you are right, it is stated that the file is not loaded. I think this is just a bug that should be fixed. Maybe you can try to ignore this. A simple but maybe a bit rude method to check if a file is loaded would be out-commenting a line that looks important and see if an error message shows up while loading the model.

To the Metatarsal length: You might have a problem to changing the length in the MoCap-GMFoot model since this is marker driven. That means that an optimization is used to calculate a scaling to fit the segments to the marker positions. Thus, changing only the metatarsal length in this model is not possible.
If you want to try to change this length you could instead try with the FreePostureGMFoot model. But please be aware that the foot is a quite complex model, so it might be more difficult to only change one number in the model.

Best regards
Daniel

Daniel,

This doesn’t make any sense. When I comment out the files that say they’re “Not Loaded”, I receive an error. If it’s not loading, commenting it out shouldn’t give me any errors.

Should I post this problem in a different area of the forum to get other responses?

Chris

Chris,

if you assume that there is a bug in the display of the file loaded or not, this makes sense. What I want to tell you is that the file is loaded and the “not loaded” text is wrong in this case.

Daniel

Hi there,

in the wiki I found your interessting post of using AnyBody from Pyhton. The file “Knee.any” as example is mentioned there but I can not download it (404:Not found). Can I find it in my AMMR somewhere instead?

Thank you and best wishes,
felix

Felix, could you specify the link you are talking about? :slight_smile: I could not find the problematic place.
Pavel.

Hi Pavel,

it’s here:
http://nbviewer.ipython.org/github/AnyBody-Research-Group/AnyPyTools/blob/master/Tutorial/AnyPyTools_Tutorial.ipynb

Under “Running Macros” the second sentence. I assume that this is an example-file which I need to test the python scripts below.

Thank you for your quick respond,
felix

Felix,

Download here: here

This article was written by the research group from Aalborg University.

Regards,
Pavel

Pavel,

thank you very much again. Glad you got time for answering so quick!

Wish you a nice afternoon,
felix

Hi there

I want to run the MoCapModel from my AnyMacro written in Python. For some studies I want to change values of the TrialSpecificData.any file. Am I right if I assume that just {Float} Values which are marked as i[/i] in the model-tree can be changed with the classoperation “Set Value”? If I’m trying to change values I got

'Set Value' operation on this value-object is not allowed

If so, is there going to be a classoperations for these value objects in the future? I saw the solution in the wiki with implementing define statements and switching them to 1,2,3 … For me it is not convincing because would have to predefine a lot of templates which I’m actually trying to avoid.

Regards,
felix

Felix,

I think they should be set without any problems. But possibly you are trying to set somethng that is not a Design Var.

Find your variable and put DesignVar around: like AnyFloat myVar = DesignVar(0.0);

I hope that helps.

Otherwise try to make a small example with the problem and upload to the debug section.

Regards,
Pavel

Dear Pavel,

thank you! It works perfectly for Floats. Is it possible to turn strings into DesignVar as well? I tried it but he comes up with

NameOfFile : argument will not be ready for evaluation until moment 'DesignVar'

Thank you so much Pavel!

King Regards,
felix