OpenSim Moco
0.4.0
|
This is a base class for solving problems that depend on an observed motion using Moco's optimal control methods.
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.
Sometimes it is not possible to achieve the desired motion using muscles alone. There are multiple possible causes for this:
#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... | |
|
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.
|
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.
|
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.