Skip to content
GitLab
Menu
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
ae5d9ced
Verified
Commit
ae5d9ced
authored
Oct 27, 2019
by
Justin Carpentier
Browse files
algo/model: throw when possible useful user feedback
parent
6185fab4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/algorithm/model.hxx
View file @
ae5d9ced
...
...
@@ -32,9 +32,10 @@ namespace pinocchio
for
(
FrameIndex
fid
=
1
;
fid
<
modelAB
.
frames
.
size
();
++
fid
)
{
Frame
frame
=
modelAB
.
frames
[
fid
];
if
(
frame
.
parent
==
0
)
{
assert
(
!
model
.
existFrame
(
frame
.
name
,
frame
.
type
)
&&
"The two models have conflicting frame names."
);
if
(
frame
.
parent
==
0
)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
!
model
.
existFrame
(
frame
.
name
,
frame
.
type
),
"The two models have conflicting frame names."
);
frame
.
parent
=
jid
;
if
(
frame
.
previousFrame
!=
0
)
...
...
@@ -106,8 +107,9 @@ namespace pinocchio
// otherwise, get the parent from modelAB.
if
(
modelAB
.
parents
[
jmodel
.
id
()]
>
0
)
parentId
=
model
.
getJointId
(
modelAB
.
names
[
modelAB
.
parents
[
jmodel
.
id
()]]);
assert
(
!
model
.
existJointName
(
modelAB
.
names
[
jmodel
.
id
()])
&&
"The two models have conflicting joint names."
);
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
!
model
.
existJointName
(
modelAB
.
names
[
jmodel
.
id
()]),
"The two models have conflicting joint names."
);
JointIndex
jid
=
model
.
addJoint
(
parentId
,
...
...
@@ -127,8 +129,8 @@ namespace pinocchio
Frame
frame
=
modelAB
.
frames
[
fid
];
if
(
frame
.
parent
==
jmodel
.
id
())
{
assert
(
!
model
.
existFrame
(
frame
.
name
,
frame
.
type
)
&&
"The two models have conflicting frame names."
);
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
!
model
.
existFrame
(
frame
.
name
,
frame
.
type
)
,
"The two models have conflicting frame names."
);
frame
.
parent
=
jid
;
assert
(
frame
.
previousFrame
>
0
||
frame
.
type
==
JOINT
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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