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
2f214472
Verified
Commit
2f214472
authored
Apr 14, 2020
by
Justin Carpentier
Browse files
core/model: fix addFrame method
parent
83203454
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hxx
View file @
2f214472
...
...
@@ -251,21 +251,16 @@ namespace pinocchio
inline
int
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>::
addFrame
(
const
Frame
&
frame
)
{
// Check if the frame.name exists
if
(
existFrame
(
frame
.
name
))
// Check if the frame.name exists
with the same type
if
(
existFrame
(
frame
.
name
,
frame
.
type
))
{
FrameIndex
frame_id
=
getFrameId
(
frame
.
name
);
if
(
frames
[
frame_id
]
==
frame
)
return
(
int
)
frame_id
;
else
return
-
1
;
}
else
// does not exist, so add the Frame to the kinematic tree
{
frames
.
push_back
(
frame
);
nframes
++
;
return
nframes
-
1
;
FrameIndex
frame_id
=
getFrameId
(
frame
.
name
,
frame
.
type
);
return
(
int
)
frame_id
;
}
// else: we must add a new frames to the current stack
frames
.
push_back
(
frame
);
nframes
++
;
return
nframes
-
1
;
}
template
<
typename
Scalar
,
int
Options
,
template
<
typename
,
int
>
class
JointCollectionTpl
>
...
...
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