Verified Commit ddd27947 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

model: check in addFrame whether the mass distribution is valid

parent 9f5db041
......@@ -281,13 +281,16 @@ namespace pinocchio
PINOCCHIO_CHECK_INPUT_ARGUMENT(frame.parent < (JointIndex)njoints,
"The index of the parent frame is not valid.");
"The input inertia is not valid.")
// Check if the exists with the same type
return getFrameId(,frame.type);
// else: we must add a new frames to the current stack
inertias[frame.parent] += frame.placement.act(frame.inertia);
if(frame.inertia.mass() > Scalar(0))
inertias[frame.parent] += frame.placement.act(frame.inertia);
return FrameIndex(nframes - 1);
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