OpenSim Moco
0.4.0
|
This class prescribes the value, speed, and acceleration of all coordinates in the model using SimTK::Motion.
SimTK::Motions remove degrees of freedom from the system rather than add constraints. This is an alternative to prescribing kinematics using Coordinate's prescribed_function, which uses a kinematic constraint. When prescribing motion, the system must compute constraint forces to apply to enforce the prescribed motion; such forces are available via SimbodyMatterSubsystem::findMotionForces().
#include <Moco/Moco/Components/PositionMotion.h>
Public Member Functions | |
OpenSim_DECLARE_PROPERTY (default_enabled, bool, "Whether or not this motion is enabled by default (default value: " "true).") | |
OpenSim_DECLARE_PROPERTY (functions, FunctionSet, "Functions specifying the values of each coordinate.") | |
PositionMotion (std::string name) | |
void | setPositionForCoordinate (const Coordinate &coord, const Function &position) |
Set a function to calculate the position for a given coordinate. More... | |
void | setDefaultEnabled (bool enabled) |
This determines if, after Model::initSystem(), these prescribed motions are enabled or disabled. More... | |
bool | getDefaultEnabled () const |
void | setEnabled (SimTK::State &state, bool enabled) const |
Use this after Model::initSystem() to set if the prescribed motions are enforced. More... | |
bool | getEnabled (const SimTK::State &state) const |
TimeSeriesTable | exportToTable (const std::vector< double > &time) const |
Static Public Member Functions | |
static std::unique_ptr< PositionMotion > | createFromTable (const Model &model, const TimeSeriesTable &coords, bool allowExtraColumns=false) |
Create a PositionMotion that prescribes kinematics for all coordinates in a model, given a data table containing coordinate values for all coordinates using GCVSpline. More... | |
static std::unique_ptr< PositionMotion > | createFromStatesTrajectory (const Model &model, const StatesTrajectory &statesTraj) |
Create a PositionMotion that prescribes kinematics for all coordinates in a model, given a StatesTrajectory. More... | |
|
static |
Create a PositionMotion that prescribes kinematics for all coordinates in a model, given a StatesTrajectory.
|
static |
Create a PositionMotion that prescribes kinematics for all coordinates in a model, given a data table containing coordinate values for all coordinates using GCVSpline.
If the table contains any columns that are not the names of coordinate value state variables, an exception is thrown (unless allowExtraColumns is true).
|
inline |
This determines if, after Model::initSystem(), these prescribed motions are enabled or disabled.
void OpenSim::PositionMotion::setEnabled | ( | SimTK::State & | state, |
bool | enabled | ||
) | const |
Use this after Model::initSystem() to set if the prescribed motions are enforced.
void OpenSim::PositionMotion::setPositionForCoordinate | ( | const Coordinate & | coord, |
const Function & | position | ||
) |
Set a function to calculate the position for a given coordinate.
The speed and acceleration of the coordinate are obtained as derivatives of the provided function.