Learning how to use command line from terminal

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Micheal Seller
Posts: 4
Joined: Tue Mar 26, 2019 6:22 am

Learning how to use command line from terminal

Post by Micheal Seller » Wed Mar 27, 2019 3:25 am

Hello, I am learning openSim 4 and I would like to be able to lunch a simulation (IK or forward or ...) of a simple tutorial example but do not understand what I should do.
For example if I want to use the simplest example (it seems to me it could be bouncing_block but any other is fine) and run a tool what should I write in the terminal?

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Learning how to use command line from terminal

Post by Dimitar Stanev » Thu Mar 28, 2019 2:27 am

The best place to start is the user guide:

https://simtk-confluence.stanford.edu:8 ... %27s+Guide

You can find many examples, use cases, etc. Please let us know what exactly you want to do with OpenSim in case that the user guide is not helpful enough.

User avatar
Micheal Seller
Posts: 4
Joined: Tue Mar 26, 2019 6:22 am

Re: Learning how to use command line from terminal

Post by Micheal Seller » Thu Mar 28, 2019 4:14 am

I tried the only example I found in the guide, but why should it work (I do not have such a file, path info,...)?

This is the error I get:

SimTK Exception thrown at xml.cpp:108:
Error detected by Simbody method Xml::readFromFile(): Failed to load the Xml file 'arm26_Setup_InverseKinetics.xml' with error 'Failed to open file (line=0, col=0)'.
(Required condition 'loadOK' was not met.)

User avatar
Micheal Seller
Posts: 4
Joined: Tue Mar 26, 2019 6:22 am

Re: Learning how to use command line from terminal

Post by Micheal Seller » Mon Apr 01, 2019 4:45 am

My question comes from my hope to run directly simtk (without GUI), any advice?

User avatar
Micheal Seller
Posts: 4
Joined: Tue Mar 26, 2019 6:22 am

Re: Learning how to use command line from terminal

Post by Micheal Seller » Thu Apr 04, 2019 1:45 am

Hi, maybe I made a small improvement as with correct path opensim tries to run an example XML inverse dinamics file, but it searches a .osim file that it does not find it (neither do I) on examples models

C:\Users\Laura>opensim-cmd run-tool Documenti\OpenSim\4.0\Models\Gait2354_Simbod
y\subject01_Setup_InverseDynamics.xml
Preparing to run InverseDynamicsTool.
InverseDynamicsTool Failed: Object: Cannot open file subject01_simbody.osim. It
may not exist or you do not have permission to read it.
Thrown at object.cpp:105 in Object().
InverseDynamicsTool Failed, please see messages window for details...

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Learning how to use command line from terminal

Post by Ayman Habib » Thu Apr 04, 2019 12:01 pm

Hello,

As you can tell from the message the model you're trying to run on is not found because file name is assumed relative to working directory unless otherwise specified.

Typically if you want to use a model from another folder you would specify full pathname for the model osim file. Assuming default OpenSim 4.0 layout the model file you want would be located at
C:\Users\${USER}\Documents\OpenSim\4.0\Models\Gait2354_Simbody\OutputReference

Hope this helps,
-Ayman

User avatar
micheal Sacharin
Posts: 8
Joined: Mon Apr 08, 2019 3:45 am

Re: Learning how to use command line from terminal

Post by micheal Sacharin » Mon Apr 08, 2019 7:21 am

Thanks very much for the patience and I am sure that soon we will find the solution to my confusion.

I think that I am doing some other kind of error when trying to launch a inverse dynamic simulation from terminal:

opensim-cmd run-tool Documents\OpenSim\4.0\Models\Gait2354_Simbody\subject01_Setup_InverseDynamics.xml

This file path is found and opensim looks for the .osim file subject01_simbody.osim that subject01_Setup_InverseDynamics.xml needs (which I also copied in the same directory and left in the original folder) but probably I should have written a different command line in the terminal or written before a command to open the .osim file.

POST REPLY