Commit ec1d99d5 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Test that root joint exists when necessary.

parent 7b3ba683
......@@ -500,25 +500,35 @@ namespace hpp {
void Device::computeJointPositions ()
{
rootJoint_->recursiveComputePosition (currentConfiguration_, I4);
if (rootJoint_) {
rootJoint_->recursiveComputePosition (currentConfiguration_, I4);
}
}
void Device::computeJointJacobians ()
{
rootJoint_->computeJacobian ();
for (JointVector_t::const_iterator it = jointVector_.begin ();
it != jointVector_.end (); ++it) {
if (rootJoint_) {
rootJoint_->computeJacobian ();
for (JointVector_t::const_iterator it = jointVector_.begin ();
it != jointVector_.end (); ++it) {
}
}
}
void Device::computeMass ()
{
mass_ = rootJoint_->computeMass ();
mass_ = 0;
if (rootJoint_) {
mass_ = rootJoint_->computeMass ();
}
}
void Device::computePositionCenterOfMass ()
{
rootJoint_->computeMassTimesCenterOfMass ();
com_ = (1/mass_) * rootJoint_->massCom_;
com_.setZero ();
if (rootJoint_) {
rootJoint_->computeMassTimesCenterOfMass ();
com_ = (1/mass_) * rootJoint_->massCom_;
}
}
void Device::computeJacobianCenterOfMass ()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment