13 #ifndef HRPMODEL_BODY_H_INCLUDED 14 #define HRPMODEL_BODY_H_INCLUDED 19 #include <boost/shared_ptr.hpp> 56 const std::string&
name() {
72 void setRootLink(
Link* link);
77 void updateLinkTree();
88 return jointIdToLinkArray.size();
98 return jointIdToLinkArray[id];
104 inline const std::vector<Link*>&
joints()
const {
105 return jointIdToLinkArray;
113 return linkTraverse_.numLinks();
122 return linkTraverse_.link(index);
126 return linkTraverse_;
133 return linkTraverse_;
139 Link* link(
const std::string&
name)
const;
148 Light *createLight(
Link *link,
int lightType,
const std::string& name);
150 return nameToLightMap[
name];
154 Sensor* createSensor(
Link* link,
int sensorType,
int id,
const std::string& name);
156 void addSensor(
Sensor* sensor,
int sensorType,
int id );
159 return allSensors[sensorType][sensorId];
163 return allSensors[sensorType].size();
167 return allSensors.size();
170 void clearSensorValues();
172 template <
class TSensor>
inline TSensor*
sensor(
int id)
const {
176 template <
class TSensor>
inline TSensor*
sensor(
const std::string& name)
const {
178 NameToSensorMap::const_iterator p = nameToSensorMap.find(name);
179 if(p != nameToSensorMap.end()){
180 sensor =
dynamic_cast<TSensor*
>(p->second);
189 return isStaticModel_;
192 double calcTotalMass();
206 void calcMassMatrix(
dmatrix& out_M);
208 void setColumnOfMassMatrix(
dmatrix& M,
int column);
214 void calcTotalMomentumFromJacobian(
Vector3& out_P,
Vector3& out_L);
220 void initializeConfiguration();
222 void calcForwardKinematics(
bool calcVelocity =
false,
bool calcAcceleration =
false);
224 void clearExternalForces();
229 if(customizerInterface){
230 setVirtualJointForcesSub();
239 void updateLinkColdetModelPositions();
241 void putInformation(std::ostream &out);
243 bool installCustomizer();
271 void calcAngularMomentumJacobian(
Link *base,
dmatrix &H);
309 Link* createEmptyJoint(
int jointId);
310 void setVirtualJointForcesSub();
The header file of the LinkTraverse class.
std::vector< SensorArray > allSensors
std::map< std::string, Light * > NameToLightMap
TSensor * sensor(const std::string &name) const
void setName(const std::string &name)
void setVirtualJointForces()
NameToLinkMap nameToLinkMap
png_infop png_charpp name
std::map< std::string, Sensor * > NameToSensorMap
const LinkTraverse & links() const
unsigned int numSensors(int sensorType) const
static BodyInterface * bodyInterface
TSensor * sensor(int id) const
boost::shared_ptr< Body > BodyPtr
Vector3 defaultRootPosition
std::vector< Sensor * > SensorArray
const std::string & modelName()
std::vector< Link * > LinkArray
const LinkTraverse & linkTraverse() const
NameToLightMap nameToLightMap
BodyCustomizerInterface * customizerInterface
void * BodyCustomizerHandle
const std::string & name()
NameToSensorMap nameToSensorMap
std::vector< ExtraJoint > extraJoints
unsigned int numSensorTypes() const
Link * joint(int id) const
Light * light(const std::string &name)
Link * link(int index) const
void setModelName(const std::string &name)
unsigned int numJoints() const
std::map< std::string, Link * > NameToLinkMap
Matrix33 defaultRootAttitude
const std::vector< Link * > & joints() const
boost::shared_ptr< JointPath > JointPathPtr
HRPMODEL_API std::ostream & operator<<(std::ostream &out, hrp::Body &body)
BodyHandleEntity bodyHandleEntity
unsigned int numLinks() const
Sensor * sensor(int sensorType, int sensorId) const
BodyCustomizerHandle customizerHandle
LinkTraverse linkTraverse_
LinkArray jointIdToLinkArray