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
ddd27947
Verified
Commit
ddd27947
authored
Mar 29, 2021
by
Justin Carpentier
Browse files
model: check in addFrame whether the mass distribution is valid
parent
9f5db041
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hxx
View file @
ddd27947
...
...
@@ -281,13 +281,16 @@ namespace pinocchio
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
frame
.
parent
<
(
JointIndex
)
njoints
,
"The index of the parent frame is not valid."
);
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
frame
.
inertia
.
isValid
(),
"The input inertia 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
);
if
(
frame
.
inertia
.
mass
()
>
Scalar
(
0
))
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