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
be8b5369
Verified
Commit
be8b5369
authored
Apr 28, 2021
by
Justin Carpentier
Browse files
multibody: add option to addFrame append_inertia when adding a Frame
parent
213904b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hpp
View file @
be8b5369
...
...
@@ -528,10 +528,12 @@ namespace pinocchio
/// 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.
/// \param[in] append_inertia Append the inertia contained in the Frame to the inertia supported by the joint.
///
/// \return Returns the index of the frame if it has been successfully added or if it already exists in the kinematic tree.
///
FrameIndex
addFrame
(
const
Frame
&
frame
);
FrameIndex
addFrame
(
const
Frame
&
frame
,
const
bool
append_inertia
=
true
);
///
/// \brief Check the validity of the attributes of Model with respect to the specification of some
...
...
src/multibody/model.hxx
View file @
be8b5369
...
...
@@ -276,7 +276,7 @@ namespace pinocchio
template
<
typename
Scalar
,
int
Options
,
template
<
typename
,
int
>
class
JointCollectionTpl
>
inline
typename
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>::
FrameIndex
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>::
addFrame
(
const
Frame
&
frame
)
addFrame
(
const
Frame
&
frame
,
const
bool
append_inertia
)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
frame
.
parent
<
(
JointIndex
)
njoints
,
"The index of the parent frame is not valid."
);
...
...
@@ -290,7 +290,7 @@ namespace pinocchio
return
getFrameId
(
frame
.
name
,
frame
.
type
);
frames
.
push_back
(
frame
);
//
if(
frame.inertia.mass() > Scalar(0)
)
if
(
append_inertia
)
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