OpenSim Moco  0.4.0
Classes | Public Member Functions | Protected Member Functions | List of all members
OpenSim::MocoTool Class Reference

Description

This is a base class for solving problems that depend on an observed motion using Moco's optimal control methods.

Mesh interval

A smaller mesh interval increases the convergence time, but is necessary for fast motions or problems with stiff differential equations (e.g., stiff tendons). For gait, consider using a mesh interval between 0.01 and 0.05 seconds. Try solving your problem with decreasing mesh intervals and choose a mesh interval at which the solution stops changing noticeably.

Reserve actuators

Sometimes it is not possible to achieve the desired motion using muscles alone. There are multiple possible causes for this:

Inheritance diagram for OpenSim::MocoTool:
OpenSim::MocoInverse OpenSim::MocoTrack

#include <Moco/Moco/MocoTool.h>

Classes

struct  TimeInfo
 

Public Member Functions

 OpenSim_DECLARE_OPTIONAL_PROPERTY (initial_time, double, "The start of the time interval. " "All data must start at or before this time. " "(default: earliest time available in all provided data)")
 
 OpenSim_DECLARE_OPTIONAL_PROPERTY (final_time, double, "The end of the time interval. " "All data must end at or after this time. " "(default: latest time available in all provided data)")
 
 OpenSim_DECLARE_PROPERTY (mesh_interval, double, "The time duration of each mesh interval " "(default: 0.020 seconds).")
 
 OpenSim_DECLARE_PROPERTY (clip_time_range, bool, "Set the time range to be 1e-3 shorter on both ends to leave space " "for finite difference estimates (default: false).")
 
 OpenSim_DECLARE_PROPERTY (model, ModelProcessor, "The musculoskeletal model to use.")
 
void setModel (ModelProcessor model)
 

Protected Member Functions

void updateTimeInfo (const std::string &dataLabel, const double &dataInitial, const double &dataFinal, TimeInfo &info) const
 This function updates a TimeInfo so the initial and final times are within the data times provided. More...
 
std::string getFilePath (const std::string &file) const
 Get the canonicalized absolute pathname with respect to the setup file directory from a given pathname which can be relative or absolute. More...
 
std::string getDocumentDirectory () const
 Get the (canonicalized) absolute directory containing the file from which this tool was loaded. More...
 

Member Function Documentation

◆ getDocumentDirectory()

std::string OpenSim::MocoTool::getDocumentDirectory ( ) const
protected

Get the (canonicalized) absolute directory containing the file from which this tool was loaded.

If the tool was not loaded from a file, this returns an empty string.

◆ getFilePath()

std::string OpenSim::MocoTool::getFilePath ( const std::string &  file) const
protected

Get the canonicalized absolute pathname with respect to the setup file directory from a given pathname which can be relative or absolute.

Here, canonicalized means that the pathname is analyzed and possibly modified to conform to the current platform.

◆ updateTimeInfo()

void OpenSim::MocoTool::updateTimeInfo ( const std::string &  dataLabel,
const double &  dataInitial,
const double &  dataFinal,
TimeInfo info 
) const
protected

This function updates a TimeInfo so the initial and final times are within the data times provided.

If the user provided a value for the initial_time or final_time properties, then this ensures the user-provided times are within the data times, and the info is updated to use the user-provided times. Finally, the TimeInfo.numMeshPoints field is updated based on the mesh_interval property.


The documentation for this class was generated from the following file: