Choreonoid
1.8
|
#include <Body.h>
Classes | |
class | ContainerWrapper |
Public Member Functions | |
Body () | |
Body (const std::string &name) | |
Body (const Body &org)=delete | |
virtual | ~Body () |
void | copyFrom (const Body *org, CloneMap *cloneMap=nullptr) |
Body * | clone () const |
Body * | clone (CloneMap &cloneMap) const |
virtual Link * | createLink (const Link *org=nullptr) const |
const std::string & | name () const |
void | setName (const std::string &name) |
const std::string & | modelName () const |
void | setModelName (const std::string &name) |
void | setRootLink (Link *link) |
void | expandLinkOffsetRotations () |
void | updateLinkTree () |
void | initializePosition () |
virtual void | initializeState () |
Body * | parentBody () const |
Link * | parentBodyLink () const |
void | setParent (Link *parentBodyLink) |
void | resetParent () |
void | syncPositionWithParentBody (bool doForwardKinematics=true) |
int | numLinks () const |
Link * | link (int index) const |
Link * | link (const std::string &name) const |
const LinkTraverse & | linkTraverse () const |
const std::vector< Link * > & | links () const |
Link * | rootLink () const |
Link * | findUniqueEndLink () const |
Link * | lastSerialLink () const |
int | numJoints () const |
int | numVirtualJoints () const |
int | numAllJoints () const |
Link * | joint (int id) const |
Link * | joint (const std::string &name) const |
ContainerWrapper< std::vector< LinkPtr > > | joints () |
const std::vector< LinkPtr > & | allJoints () const |
int | numDevices () const |
Device * | device (int index) const |
const DeviceList & | devices () const |
template<class DeviceType > | |
DeviceList< DeviceType > | devices () const |
template<class DeviceType > | |
DeviceType * | findDevice (const std::string &name) const |
template<class DeviceType > | |
DeviceType * | findDevice () const |
Device * | findDevice (const std::string &name) const |
void | addDevice (Device *device, Link *link) |
void | addDevice (Device *device) |
void | removeDevice (Device *device) |
void | clearDevices () |
void | sortDevicesByLinkOrder () |
void | initializeDeviceStates () |
bool | isStaticModel () const |
bool | isFixedRootModel () const |
void | resetDefaultPosition (const Isometry3 &T) |
const Isometry3 & | defaultPosition () const |
double | mass () const |
const Vector3 & | calcCenterOfMass () |
const Vector3 & | centerOfMass () const |
void | calcTotalMomentum (Vector3 &out_P, Vector3 &out_L) |
void | calcForwardKinematics (bool calcVelocity=false, bool calcAcceleration=false) |
void | clearExternalForces () |
int | numExtraJoints () const |
ExtraJoint & | extraJoint (int index) |
const ExtraJoint & | extraJoint (int index) const |
void | addExtraJoint (const ExtraJoint &extraJoint) |
void | clearExtraJoints () |
const Mapping * | info () const |
Mapping * | info () |
template<typename T > | |
T | info (const std::string &key) const |
template<typename T > | |
T | info (const std::string &key, const T &defaultValue) const |
template<typename T > | |
void | setInfo (const std::string &key, const T &value) |
void | resetInfo (Mapping *info) |
void | cloneShapes (CloneMap &cloneMap) |
template<class T > | |
T * | findCache (const std::string &name) |
template<class T > | |
const T * | findCache (const std::string &name) const |
template<class T > | |
T * | getOrCreateCache (const std::string &name) |
void | setCache (const std::string &name, Referenced *cache) |
bool | getCaches (PolymorphicReferencedArrayBase<> &out_caches, std::vector< std::string > &out_names) const |
void | removeCache (const std::string &name) |
void | setCurrentTimeFunction (std::function< double()> func) |
double | currentTime () const |
bool | addHandler (BodyHandler *handler, bool isTopPriority=false) |
template<class BodyHandlerType > | |
BodyHandlerType * | findHandler () |
int | numHandlers () const |
BodyHandler * | handler (int index) |
BodyCustomizerHandle | customizerHandle () const |
BodyCustomizerInterface * | customizerInterface () const |
bool | installCustomizer () |
bool | installCustomizer (BodyCustomizerInterface *customizerInterface) |
bool | hasVirtualJointForces () const |
void | setVirtualJointForces (double timeStep=0.0) |
void | resetLinkName (Link *link, const std::string &name) |
void | resetJointSpecificName (Link *link) |
void | resetJointSpecificName (Link *link, const std::string &name) |
template<> | |
double | info (const std::string &key) const |
template<> | |
double | info (const std::string &key, const double &defaultValue) const |
template<> | |
bool | info (const std::string &key, const bool &defaultValue) const |
template<> | |
void | setInfo (const std::string &key, const double &value) |
template<> | |
void | setInfo (const std::string &key, const bool &value) |
Public Member Functions inherited from cnoid::Referenced | |
virtual | ~Referenced () |
Static Public Member Functions | |
static void | addCustomizerDirectory (const std::string &path) |
static BodyInterface * | bodyInterface () |
Protected Member Functions | |
Body (Link *rootLink) | |
virtual Referenced * | doClone (CloneMap *cloneMap) const override |
Protected Member Functions inherited from cnoid::Referenced | |
Referenced () | |
Referenced (const Referenced &) | |
int | refCount () const |
Body::Body | ( | ) |
Body::Body | ( | const std::string & | name | ) |
|
delete |
|
virtual |
|
protected |
|
static |
void Body::addDevice | ( | Device * | device | ) |
|
inline |
bool Body::addHandler | ( | BodyHandler * | handler, |
bool | isTopPriority = false |
||
) |
|
inline |
|
static |
const Vector3 & Body::calcCenterOfMass | ( | ) |
|
inline |
assuming Link::v,w is already computed by calcForwardKinematics(true); assuming Link::wc is already computed by calcCenterOfMass();
const Vector3 & Body::centerOfMass | ( | ) | const |
void Body::clearDevices | ( | ) |
void Body::clearExternalForces | ( | ) |
|
inline |
|
inline |
void Body::cloneShapes | ( | CloneMap & | cloneMap | ) |
Reimplemented in cnoid::DyBody.
|
inline |
BodyCustomizerHandle Body::customizerHandle | ( | ) | const |
BodyCustomizerInterface * Body::customizerInterface | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
overrideprotectedvirtual |
Implements cnoid::ClonableReferenced.
Reimplemented in cnoid::DyBody.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Link * Body::findUniqueEndLink | ( | ) | const |
bool Body::getCaches | ( | PolymorphicReferencedArrayBase<> & | out_caches, |
std::vector< std::string > & | out_names | ||
) | const |
|
inline |
BodyHandler * Body::handler | ( | int | index | ) |
bool Body::hasVirtualJointForces | ( | ) | const |
Mapping* cnoid::Body::info | ( | ) |
Mapping * Body::info | ( | ) | const |
T cnoid::Body::info | ( | const std::string & | key | ) | const |
CNOID_EXPORT double cnoid::Body::info | ( | const std::string & | key | ) | const |
CNOID_EXPORT bool cnoid::Body::info | ( | const std::string & | key, |
const bool & | defaultValue | ||
) | const |
CNOID_EXPORT double cnoid::Body::info | ( | const std::string & | key, |
const double & | defaultValue | ||
) | const |
T cnoid::Body::info | ( | const std::string & | key, |
const T & | defaultValue | ||
) | const |
void Body::initializeDeviceStates | ( | ) |
void Body::initializePosition | ( | ) |
|
virtual |
bool Body::installCustomizer | ( | ) |
The function installs the pre-loaded customizer corresponding to the model name.
bool Body::installCustomizer | ( | BodyCustomizerInterface * | customizerInterface | ) |
|
inline |
|
inline |
This function returns true when the whole body is a static, fixed object like a floor.
Link * Body::joint | ( | const std::string & | name | ) | const |
This function returns a link object whose joint name matches a given name. A nullptr is returned when the corresponding link is not found.
|
inline |
This function returns the link object that has a given joint ID. If there is no corresponding link, the function returns a dummy link object whose ID is minus one. If the body has virtual joints, this function returns them by giving the ids over the last one.
|
inline |
Link * Body::lastSerialLink | ( | ) | const |
Link * Body::link | ( | const std::string & | name | ) | const |
This function returns the link object whose name matches a given name. A nullptr is returned when the corresponding link is not found.
|
inline |
This function returns the link object of a given index in the whole link sequence. The order of the sequence corresponds to a link-tree traverse from the root link. The size of the sequence can be obtained by numLinks().
|
inline |
|
inline |
LinkTraverse object that traverses all the links from the root link
double Body::mass | ( | ) | const |
const std::string & Body::modelName | ( | ) | const |
const std::string & Body::name | ( | ) | const |
|
inline |
The number of all the joints including both the actual and virtual joints.
|
inline |
|
inline |
int Body::numHandlers | ( | ) | const |
|
inline |
The number of the links that are actual joints. The joints given joint ids are recognized as such joints. Note that the acutal value is the maximum joint ID plus one. Thus there may be a case where the value does not correspond to the actual number of the joints with ids. In other words, the value represents the size of the link sequence obtained by joint() function.
|
inline |
The number of all the links the body has. The value corresponds to the size of the sequence obtained by link() function.
|
inline |
The number of the joints without joint ids. For example, a joint for simulating a spring is usually handled as such a joint. You can get the joints by giving the index after the last joint id to the joint() function.
|
inline |
|
inline |
void Body::removeCache | ( | const std::string & | name | ) |
void Body::removeDevice | ( | Device * | device | ) |
void Body::resetDefaultPosition | ( | const Isometry3 & | T | ) |
void Body::resetInfo | ( | Mapping * | info | ) |
void Body::resetJointSpecificName | ( | Link * | link | ) |
void Body::resetJointSpecificName | ( | Link * | link, |
const std::string & | name | ||
) |
void Body::resetLinkName | ( | Link * | link, |
const std::string & | name | ||
) |
void Body::resetParent | ( | ) |
|
inline |
The root link of the body
|
inline |
void Body::setCurrentTimeFunction | ( | std::function< double()> | func | ) |
CNOID_EXPORT void cnoid::Body::setInfo | ( | const std::string & | key, |
const bool & | value | ||
) |
CNOID_EXPORT void cnoid::Body::setInfo | ( | const std::string & | key, |
const double & | value | ||
) |
void cnoid::Body::setInfo | ( | const std::string & | key, |
const T & | value | ||
) |
void Body::setModelName | ( | const std::string & | name | ) |
void Body::setName | ( | const std::string & | name | ) |
void Body::setParent | ( | Link * | parentBodyLink | ) |
void Body::setRootLink | ( | Link * | link | ) |
void Body::setVirtualJointForces | ( | double | timeStep = 0.0 | ) |
void Body::sortDevicesByLinkOrder | ( | ) |
void Body::syncPositionWithParentBody | ( | bool | doForwardKinematics = true | ) |
void Body::updateLinkTree | ( | ) |
This function must be called when the structure of the link tree is changed.