#include <TensegrityModel.h>
|
static const double | rodRadius = 0.5 |
|
static const double | rodDensity = 1.0 |
|
static const double | rodFriction = 1.0 |
|
static const double | rodRollFriction = 0.0 |
|
static const double | rodRestitution = 0.2 |
|
static const double | boxWidth = 1.0 |
|
static const double | boxHeight = 1.0 |
|
static const double | boxDensity = 1.0 |
|
static const double | boxFriction = 1.0 |
|
static const double | boxRollFriction = 0.0 |
|
static const double | boxRestitution = 0.2 |
|
static const double | sphereRadius = 0.5 |
|
static const double | sphereDensity = 1.0 |
|
static const double | sphereFriction = 1.0 |
|
static const double | sphereRollFriction = 0.0 |
|
static const double | sphereRestitution = 0.2 |
|
static const double | stringStiffness = 1000.0 |
|
static const double | stringDamping = 10.0 |
|
static const double | stringPretension = 0.0 |
|
static const double | stringRadius = 1.0 |
|
static const double | stringMotorFriction = 0.0 |
|
static const double | stringMotorInertia = 1.0 |
|
static const double | stringBackDrivable = 0 |
|
static const double | stringHistory = 0 |
|
static const double | stringMaxTension = 1000.0 |
|
static const double | stringTargetVelocity = 100.0 |
|
static const double | stringMinActualLength = 0.1 |
|
static const double | stringMinRestLength = 0.1 |
|
static const double | stringRotation = 0 |
|
static const bool | stringMoveCablePointAToEdge = true |
|
static const bool | stringMoveCablePointBToEdge = true |
|
A class that constructs a model based on a tensegrity structure encoded in YAML.
Definition at line 55 of file TensegrityModel.h.
TensegrityModel::TensegrityModel |
( |
const std::string & |
structurePath | ) |
|
The simplest constructor. This constructor sets debugging_on = false.
- Parameters
-
[in] | structurePath | the path of the YAML-encoded structure |
Constructor that only takes the path to the YAML file.
Definition at line 48 of file TensegrityModel.cpp.
TensegrityModel::TensegrityModel |
( |
const std::string & |
structurePath, |
|
|
bool |
debugging |
|
) |
| |
Constructor that takes 'debugging' as a parameter.
- Parameters
-
[in] | structurePath | the path of the YAML-encoded structure |
[in] | debugging | the flag that controls debugging output on/off. |
Constructor that includes the debugging flag.
Definition at line 55 of file TensegrityModel.cpp.
TensegrityModel::~TensegrityModel |
( |
| ) |
|
|
virtual |
Destructor. Deletes controllers, if any were added during setup. Teardown handles everything else.
Definition at line 63 of file TensegrityModel.cpp.
void tgModel::addChild |
( |
tgModel * |
pChild | ) |
|
|
inherited |
Add a sub-model to this model. The model takes ownership of the child sub-model and is responsible for deallocating it.
- Parameters
-
[in,out] | pChild | a pointer to a sub-model |
- Exceptions
-
std::invalid_argument | is pChild is NULL, this object, or already a descendant |
- Todo:
- Make sure that every child appears no more than once in the tree.
Definition at line 122 of file tgModel.cpp.
Attach an observer to the subject of the observer.
- Parameters
-
[in,out] | pObserver | a pointer to an observer for the subject; do nothing if the pointer is NULL |
template<typename T >
std::vector<T*> tgModel::find |
( |
const tgTagSearch & |
tagSearch | ) |
|
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
- Parameters
-
[in] | tagSearch,a | tagSearch that contains the desired tags |
- Returns
- a std::vector of pointers to members that match the tag search and typename T
Definition at line 128 of file tgModel.h.
template<typename T >
std::vector<T*> tgModel::find |
( |
const std::string & |
tagSearch | ) |
|
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
- Parameters
-
[in] | tagSearch,a | std::string& that contains the desired tags |
- Returns
- a std::vector of pointers to members that match the tag search and typename T
Definition at line 141 of file tgModel.h.
Returns a vector of all muscles for the controllers to work with.
- Returns
- A vector of all of the muscles
Definition at line 921 of file TensegrityModel.cpp.
std::vector< tgModel * > tgModel::getDescendants |
( |
| ) |
const |
|
inherited |
Return a std::vector of const pointers to all sub-models.
- Todo:
- examine whether this should be public, and perhaps create a read only version
- Returns
- a std::vector of const pointers all sub-models.
- Todo:
- Unnecessary copying can be avoided by pasing the result collection in the recursive step.
Definition at line 170 of file tgModel.cpp.
std::vector< tgSenseable * > tgModel::getSenseableDescendants |
( |
| ) |
const |
|
virtualinherited |
From tgSenseable: need to return all the children of this class. Since tgModels are tgSenseables, just return getDescendants().
- Returns
- a vector of tgModels, with pointers changed into pointers for tgSenseables.
For tgSenseable: just return the results of getDescendants here. This should be OK, since a vector of tgModel* is also a vector of tgSenseable*.
Reimplemented from tgSenseable.
Definition at line 191 of file tgModel.cpp.
Call tgObserver<T>::onStep() on all observers in the order in which they were attached.
- Parameters
-
[in] | dt | the number of seconds since the previous call; do nothing if not positive |
Call tgModelVisitor::render() on self and all descendants.
- Parameters
-
Reimplemented in tgCompressionSpringActuator, tgUnidirComprSprActuator, ConnectorTestModel, BuildTestModel, tgKinematicActuator, tgSphere, tgBox, tgRod, ContactCableDemo, tgBasicActuator, hillyMuscleNP, simpleMuscleNP, tgBoxMoreAnchors, tgBaseRigid, and tgGhostModel.
Definition at line 107 of file tgModel.cpp.
Receives a tgModelVisitor and dispatches itself into the visitor's 'render' function. This model will go to the default tgModel function, which does nothing.
- Parameters
-
Definition at line 917 of file TensegrityModel.cpp.
void TensegrityModel::setup |
( |
tgWorld & |
world | ) |
|
|
virtual |
Create the model. Places the rods and strings into the world that is passed into the simulation. This is triggered automatically when the model is added to the simulation, when tgModel::setup(world) is called (if this model is a child), and when reset is called. Also notifies controllers of setup.
- Parameters
-
[in] | world | the world we're building into |
The setup function is what's called from outside this class. It is responsible for creating all the parts of this tgModel and calling the tgStructureInfo to build the structure into the world.
Reimplemented from tgModel.
Definition at line 85 of file TensegrityModel.cpp.
void TensegrityModel::step |
( |
double |
timeStep | ) |
|
|
virtual |
Step the model, its children. Notifies controllers of step.
- Parameters
-
[in] | timeStep | the timestep, must be positive. |
Reimplemented from tgModel.
Definition at line 907 of file TensegrityModel.cpp.
void TensegrityModel::teardown |
( |
| ) |
|
|
virtual |
Undoes setup. Deletes child models. Called automatically on reset and end of simulation. Notifies controllers of teardown
Reimplemented from tgModel.
Definition at line 925 of file TensegrityModel.cpp.
std::string tgModel::toString |
( |
std::string |
prefix = "" | ) |
const |
|
virtualinherited |
Returns the tag names of this model and its children
- Parameters
-
[in] | prefix | a string to append to |
- Returns
- the original string with this model and its children's tags appended
Definition at line 152 of file tgModel.cpp.
bool TensegrityModel::debugging_on = false |
Boolean flag that enables or disables debugging. All places this flag works in TensegrityModel.cpp can be found by searching through that file for the string "DEBUGGING".
Definition at line 199 of file TensegrityModel.h.
const double TensegrityModel::rodRadius = 0.5 |
|
static |
List of all the default config parameters for all the types of objects that wil be supported.
Definition at line 69 of file TensegrityModel.h.
The documentation for this class was generated from the following files: