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 { ...@@ -500,25 +500,35 @@ namespace hpp {
void Device::computeJointPositions () void Device::computeJointPositions ()
{ {
rootJoint_->recursiveComputePosition (currentConfiguration_, I4); if (rootJoint_) {
rootJoint_->recursiveComputePosition (currentConfiguration_, I4);
}
} }
void Device::computeJointJacobians () void Device::computeJointJacobians ()
{ {
rootJoint_->computeJacobian (); if (rootJoint_) {
for (JointVector_t::const_iterator it = jointVector_.begin (); rootJoint_->computeJacobian ();
it != jointVector_.end (); ++it) { for (JointVector_t::const_iterator it = jointVector_.begin ();
it != jointVector_.end (); ++it) {
}
} }
} }
void Device::computeMass () void Device::computeMass ()
{ {
mass_ = rootJoint_->computeMass (); mass_ = 0;
if (rootJoint_) {
mass_ = rootJoint_->computeMass ();
}
} }
void Device::computePositionCenterOfMass () void Device::computePositionCenterOfMass ()
{ {
rootJoint_->computeMassTimesCenterOfMass (); com_.setZero ();
com_ = (1/mass_) * rootJoint_->massCom_; if (rootJoint_) {
rootJoint_->computeMassTimesCenterOfMass ();
com_ = (1/mass_) * rootJoint_->massCom_;
}
} }
void Device::computeJacobianCenterOfMass () 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