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();
unsigned int numSensors(int sensorType) const
The header file of the LinkTraverse class.
std::vector< SensorArray > allSensors
std::map< std::string, Light * > NameToLightMap
TSensor * sensor(int id) const
unsigned int numJoints() const
const std::vector< Link * > & joints() const
unsigned int numLinks() const
void setName(const std::string &name)
void setVirtualJointForces()
TSensor * sensor(const std::string &name) const
NameToLinkMap nameToLinkMap
png_infop png_charpp name
Link * link(int index) const
std::map< std::string, Sensor * > NameToSensorMap
static BodyInterface * bodyInterface
boost::shared_ptr< Body > BodyPtr
unsigned int numSensorTypes() const
Vector3 defaultRootPosition
std::vector< Sensor * > SensorArray
const std::string & modelName()
std::vector< Link * > LinkArray
NameToLightMap nameToLightMap
Sensor * sensor(int sensorType, int sensorId) const
BodyCustomizerInterface * customizerInterface
void * BodyCustomizerHandle
const std::string & name()
const LinkTraverse & links() const
NameToSensorMap nameToSensorMap
std::vector< ExtraJoint > extraJoints
Light * light(const std::string &name)
void setModelName(const std::string &name)
std::map< std::string, Link * > NameToLinkMap
Matrix33 defaultRootAttitude
boost::shared_ptr< JointPath > JointPathPtr
HRPMODEL_API std::ostream & operator<<(std::ostream &out, hrp::Body &body)
BodyHandleEntity bodyHandleEntity
Link * joint(int id) const
BodyCustomizerHandle customizerHandle
LinkTraverse linkTraverse_
const LinkTraverse & linkTraverse() const
LinkArray jointIdToLinkArray