This class provides utilities for creating OpenSim models.
More...
This class provides utilities for creating OpenSim models.
◆ createDoublePendulum()
static Model OpenSim::ModelFactory::createDoublePendulum |
( |
| ) |
|
|
inlinestatic |
This is a convenience for createNLinkPendulum(2)
.
◆ createNLinkPendulum()
static Model OpenSim::ModelFactory::createNLinkPendulum |
( |
int |
numLinks | ) |
|
|
static |
Create a pendulum with the provided number of links.
For each link, there is a body /bodyset/b#
(where #
is the link index starting at 0), a PinJoint /jointset/j#
with coordinate /jointset/j#/q#
, a CoordinateActuator /tau#
, a Marker /markerset/marker#
at the origin of the link's body, and a PhysicalOffsetFrame /b#center
at the center of the link.
◆ createPendulum()
static Model OpenSim::ModelFactory::createPendulum |
( |
| ) |
|
|
inlinestatic |
This is a convenience for createNLinkPendulum(1)
.
◆ createPlanarPointMass()
static Model OpenSim::ModelFactory::createPlanarPointMass |
( |
| ) |
|
|
static |
This model contains:
- 2 bodies: a massless body "intermed", and "body" with mass 1.
- 2 slider joints: "tx" and "ty" (coordinates "tx" and "ty").
- 2 coordinate actuators: "force_x" and "force_y". Gravity is default; that is, (0, -g, 0).
◆ createReserveActuators()
static void OpenSim::ModelFactory::createReserveActuators |
( |
Model & |
model, |
|
|
double |
optimalForce, |
|
|
double |
bound = SimTK::NaN , |
|
|
bool |
skipCoordinatesWithExistingActuators = true |
|
) |
| |
|
static |
Add CoordinateActuators for each unconstrained coordinate (e.g., ! Coordinate::isConstrained()
) in the model, using the provided optimal force.
Increasing the optimal force decreases the required control signal to generate a given actuation level. The actuators are added to the model's ForceSet and are named "reserve_<coordinate-path>" with forward slashes converted to underscores. The bound
argument, if supplied, sets the min and max controls to -bound
and bound
, respectively. The fourth (optional) argument specifies whether or not to skip coordinates that already have CoordinateActuators associated with them (default: true).
◆ createSlidingPointMass()
static Model OpenSim::ModelFactory::createSlidingPointMass |
( |
| ) |
|
|
static |
This model contains:
- 1 body: mass 1.0 kg,
/bodyset/body
.
- 1 joint: SliderJoint along x axis,
/jointset/slider
, with coordinate /jointset/slider/position
.
- 1 actuator: CoordinateActuator, controls [-10, 10],
/actuator
. Gravity is default; that is, (0, -g, 0).
◆ removeMuscles()
static void OpenSim::ModelFactory::removeMuscles |
( |
Model & |
model | ) |
|
|
static |
◆ replaceJointWithWeldJoint()
static void OpenSim::ModelFactory::replaceJointWithWeldJoint |
( |
Model & |
model, |
|
|
const std::string & |
jointName |
|
) |
| |
|
static |
Replace a joint in the model with a WeldJoint.
- Note
- This assumes the joint is in the JointSet and that the joint's connectees are PhysicalOffsetFrames.
◆ replaceMusclesWithPathActuators()
static void OpenSim::ModelFactory::replaceMusclesWithPathActuators |
( |
Model & |
model | ) |
|
|
static |
Replace muscles in a model with a PathActuator of the same GeometryPath, optimal force, and min/max control defaults.
- Note
- This only replaces muscles within the model's ForceSet.
The documentation for this class was generated from the following file:
- OpenSim/Actuators/ModelFactory.h