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
10205b21
Verified
Commit
10205b21
authored
May 08, 2020
by
Gabriele Buondonno
Committed by
Justin Carpentier
May 12, 2020
Browse files
[multibody] [addFrame] Change return type to FrameIndex
parent
b1596234
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hpp
View file @
10205b21
...
...
@@ -508,9 +508,8 @@ namespace pinocchio
/// \param[in] frame The frame to add to the kinematic tree.
///
/// \return Returns the index of the frame if it has been successfully added or if it already exists in the kinematic tree.
/// The function returns -1 when the frame.type did not match with the existing frame in the kinematic having the same name.
///
int
addFrame
(
const
Frame
&
frame
);
FrameIndex
addFrame
(
const
Frame
&
frame
);
///
/// \brief Check the validity of the attributes of Model with respect to the specification of some
...
...
src/multibody/model.hxx
View file @
10205b21
...
...
@@ -248,19 +248,19 @@ namespace pinocchio
}
template
<
typename
Scalar
,
int
Options
,
template
<
typename
,
int
>
class
JointCollectionTpl
>
inline
int
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>::
inline
typename
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>::
FrameIndex
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>::
addFrame
(
const
Frame
&
frame
)
{
// Check if the frame.name exists with the same type
if
(
existFrame
(
frame
.
name
,
frame
.
type
))
{
FrameIndex
frame_id
=
getFrameId
(
frame
.
name
,
frame
.
type
);
return
(
int
)
frame_id
;
return
getFrameId
(
frame
.
name
,
frame
.
type
);
}
// else: we must add a new frames to the current stack
frames
.
push_back
(
frame
);
nframes
++
;
return
nframes
-
1
;
return
FrameIndex
(
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