#include <OpenSim/OpenSim.h>
/**
* Creates two cat models for flipping. The first is simply two segments
* connected by a 2-degree-of-freedom (no twist) joint. It exhibits the
* counter-rotation mechanism of flipping. The second adds actuate-able
* legs to the first model, as well as unlocking the twist degree of
* freedom between the model's two halves. This model exhibits the variable-
* inertia mechanism of flipping.
* */
int main(int argc, char *argv[])
{
// First model: exhibiting the counter-rotation mechanism of flipping
// ========================================================================
// Properties
// ------------------------------------------------------------------------
// Basics
// ------------------------------------------------------------------------
// Create the cat model.
OpenSim::Model cat;
// Name the cat after the founder of Stanford University.
// This model will be able to hunch and wag (see the joints below).
cat.setName("Leland_hunch_wag");
// 'Turn off' gravity so it's easier to watch an animation of the flip.
using SimTK::Vec3;
cat.setGravity(Vec3(0, 0, 0));
// Define anterior and posterior halves of the cat
// ------------------------------------------------------------------------
// Define joints between bodies (ground and two halves)
// ------------------------------------------------------------------------
// Add bodies to the model
// ------------------------------------------------------------------------
// Display goemetrygeometry
// ------------------------------------------------------------------------
// Actuation
// ------------------------------------------------------------------------
// Print the model
// ------------------------------------------------------------------------
// Second model: adding legs for the variable-inertia mechanism of flipping
// ========================================================================
// Leg properties
// ------------------------------------------------------------------------
// Define leg bodies
// ------------------------------------------------------------------------
// Define leg joints (i.e., between legs and two halves of cat)
// ------------------------------------------------------------------------
// Add bodies to the model
// ------------------------------------------------------------------------
// ...now that we have connected the bodies via joints.
// Display goemetry
// ------------------------------------------------------------------------
// Actuation
// ------------------------------------------------------------------------
// Enforce joint limits on the legs
// ------------------------------------------------------------------------
// Print the model
// ------------------------------------------------------------------------
return EXIT_SUCCESS;
}; |