Verified Commit 80b2c552 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

model: read inertia stored within the frame

parent 16a7f405
......@@ -525,6 +525,7 @@ namespace pinocchio
///
/// \brief Adds a frame to the kinematic tree.
/// The inertia stored within the frame will be happened to the inertia supported by the joint (frame.parent).
///
/// \param[in] frame The frame to add to the kinematic tree.
///
......
......@@ -278,13 +278,16 @@ namespace pinocchio
ModelTpl<Scalar,Options,JointCollectionTpl>::
addFrame(const Frame & frame)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT(frame.parent >= 0 && frame.parent < njoints,
"The index of the parent frame is not valid.");
// Check if the frame.name exists with the same type
if(existFrame(frame.name,frame.type))
{
return getFrameId(frame.name,frame.type);
}
// else: we must add a new frames to the current stack
frames.push_back(frame);
inertias[frame.parent] += frame.placement.act(frame.inertia);
nframes++;
return FrameIndex(nframes - 1);
}
......
Markdown is supported
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