Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
80b2c552
Verified
Commit
80b2c552
authored
Mar 29, 2021
by
Justin Carpentier
Browse files
model: read inertia stored within the frame
parent
16a7f405
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hpp
View file @
80b2c552
...
...
@@ -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.
///
...
...
src/multibody/model.hxx
View file @
80b2c552
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment