Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Using the OpenSim API

TODO: Add instructions to find the code for each of the examples

 

The Developer's Guide has examples using the API, including:

Performing a Simulation - Write OpenSim comes with a variety of C++ API examples, located in <OpenSimResourcesDir>/Code/CPP (where, by default, <OpenSimResourcesDir> is C:\Users\<username>\Documents\OpenSim\4.x on Windows and ~/Documents/OpenSim/4.x on Mac). In the list below, we provide the subdirectory in the Code/CPP folder where you can find each example.

  1. Performing a Simulation (ExampleMain) Write a main C++ program (a "tug of war") to create a model and run a forward simulation.
    1. Note
      iconfalse

      This example requires updating. For now, refer to the complete code in the ExampleMain/OutputReference folder 

  2. Creating Your Own

...

  1. Analysis (Plugins/AnalysisPluginExample) Write your own Analysis to output the center of mass and orientation of each body in a

...

  1. model 
  2. Creating a

...

  1. Controller (ControllerExample) Extend the tug of war example with a custom controller
  2. Creating an

...

  1. Optimization (OptimizationExample_Arm26) Write an optimization to find muscle controls to maximize the forward velocity of the hand
  2. Creating a Customized

...

  1. Actuator (CustomActuatorExample) Implement a spring with controllable stiffness
  2. Creating a Customized Muscle

...

  1. Model (MuscleExample) Implement a muscle model with fatigue

Building the API Examples

A summary of the steps to build the API examples is below. There are more details in the Developer's Guide.  We will use the tug-of-war Example (Located in your OpenSimInstallationDirectory\sdk\APIExamples\ExampleMain folder) as an example.

On Windows

...

 

...

If you are building a plugin there will be an INSTALL project in the Solution Explorer on the left panel. you can build it in order to install your dll file to the plugins directory in OpenSim.To get started with any of these examples, refer to How to Build a C++ Example.

 

Panel
borderColorgrey
bgColorwhite
borderWidth5

Next: SimTK Basics

Previous: How to Build a C++ Example

Home: Scripting and Development | Developer's Guide

...