|
MocoExtendProblem: Interface Between OpenSim and MATLAB for Rapidly Developing Direct Collocation Goals in Moco 1.1.0
add custom Moco goals to existing matlab scripts
|
Goal that minimizes the deviation of the center of pressure (COP) from a target. More...
#include <MocoCOPGoal.h>

Public Member Functions | |
| void | setExponent (int ex) |
| Set the exponent for the deviation term. | |
| bool | getExponent () const |
| Get the current exponent value. | |
| void | setDivideByDisplacement (bool tf) |
| Set whether to divide by displacement. | |
| bool | getDivideByDisplacement () const |
| Get whether the goal is divided by displacement. | |
Constructors | |
| MocoCOPGoal () | |
| Default constructor. | |
| MocoCOPGoal (std::string name) | |
| Constructor with name. | |
| MocoCOPGoal (std::string name, double weight) | |
| Constructor with name and weight. | |
Protected Member Functions | |
Required implementations of virtual methods | |
| Mode | getDefaultModeImpl () const override |
| Get the default mode for this goal. | |
| bool | getSupportsEndpointConstraintImpl () const override |
| Whether this goal supports endpoint constraint mode. | |
| void | initializeOnModelImpl (const Model &) const override |
| Initialize the goal with the model. | |
| void | calcIntegrandImpl (const IntegrandInput &input, double &integrand) const override |
| Calculate the integrand value for the cost function. | |
| void | calcGoalImpl (const GoalInput &input, SimTK::Vector &cost) const override |
| Calculate the goal value. | |
| SimTK::Matrix | FlattenSpatialVec (const SimTK::SpatialVec &S) const |
| Convert a spatial vector to a matrix representation. | |
Private Member Functions | |
| OpenSim_DECLARE_CONCRETE_OBJECT (MocoCOPGoal, MocoGoal) | |
| void | constructProperties () |
| Initialize the goal's properties. | |
Properties | |
| OpenSim_DECLARE_PROPERTY (divide_by_displacement, bool, "Divide by the model's displacement over the phase (default: " "false)") | |
| OpenSim_DECLARE_PROPERTY (exponent, int, "The exponent applied to the output value in the integrand. " "The output can take on negative values in the integrand when the " "exponent is set to 1 (the default value). When the exponent is " "set to a value greater than 1, the absolute value function is " "applied to the output (before the exponent is applied), meaning " "that odd numbered exponents (greater than 1) do not take on " "negative values.") | |
Private Attributes | |
| std::vector< std::string > | m_force_names |
| std::function< double(const double &)> | m_power_function |
Goal that minimizes the deviation of the center of pressure (COP) from a target.
This goal minimizes the deviation of the model's center of pressure from a desired target location, integrated over the phase. The center of pressure is calculated using the contact forces between the model and the ground.
This goal can be useful for:
The goal can optionally be divided by the total displacement of the model during the phase to make the cost invariant to the distance traveled.
|
inline |
Default constructor.
|
inline |
Constructor with name.
| name | The name of the goal |
|
inline |
Constructor with name and weight.
| name | The name of the goal |
| weight | Weight for this goal term in the optimization |
|
overrideprotected |
Calculate the goal value.
| input | Input data containing the integral |
| cost | Vector to store the calculated cost |
|
overrideprotected |
Calculate the integrand value for the cost function.
| input | Input data for the current state |
| integrand | Reference to store the calculated integrand value |

|
private |
Initialize the goal's properties.
|
protected |
Convert a spatial vector to a matrix representation.
| S | Spatial vector to flatten |

|
inlineoverrideprotected |
Get the default mode for this goal.
|
inline |
Get whether the goal is divided by displacement.
|
inline |
Get the current exponent value.
|
inlineoverrideprotected |
Whether this goal supports endpoint constraint mode.
|
overrideprotected |
Initialize the goal with the model.
|
private |
|
private |
|
private |
|
inline |
Set whether to divide by displacement.
| tf | True to divide by displacement, false otherwise |
|
inline |
Set the exponent for the deviation term.
| ex | The exponent value |
|
mutableprivate |
|
mutableprivate |