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
9c83b17f
Verified
Commit
9c83b17f
authored
May 08, 2020
by
Gabriele Buondonno
Committed by
Justin Carpentier
May 12, 2020
Browse files
[urdf] Remove conversion issues between int and FrameIndex
parent
11f17f36
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parsers/urdf/model.hxx
View file @
9c83b17f
...
...
@@ -179,20 +179,8 @@ namespace pinocchio
default:
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
false
,
"The joint type is not correct."
);
};
int
res
(
model
.
addJointFrame
(
idx
,
(
int
)
parentFrameId
));
if
(
res
==
-
1
)
{
std
::
ostringstream
oss
;
oss
<<
joint_name
<<
" already inserted as a frame. Current frames "
"are ["
;
for
(
typename
PINOCCHIO_ALIGNED_STD_VECTOR
(
Frame
)
::
const_iterator
it
=
model
.
frames
.
begin
();
it
!=
model
.
frames
.
end
();
++
it
)
{
oss
<<
'"'
<<
it
->
name
<<
"
\"
,"
;
}
oss
<<
']'
;
throw
std
::
invalid_argument
(
oss
.
str
());
}
FrameIndex
jointFrameId
=
(
FrameIndex
)
res
;
// C-style cast to remove polluting compilation warning. This is Bad practice. See issue #323 (rework indexes)
FrameIndex
jointFrameId
=
model
.
addJointFrame
(
idx
,
(
int
)
parentFrameId
);
appendBodyToJoint
(
jointFrameId
,
Y
,
SE3
::
Identity
(),
body_name
);
}
...
...
@@ -347,20 +335,8 @@ namespace pinocchio
SE3
::
Identity
(),
"root_joint"
//TODO ,max_effort,max_velocity,min_config,max_config
);
int
res
(
model
.
addJointFrame
(
idx
,
0
));
if
(
res
==
-
1
)
{
std
::
ostringstream
oss
;
oss
<<
"root_joint already inserted as a frame but of different type. Current frames "
"are ["
;
for
(
typename
PINOCCHIO_ALIGNED_STD_VECTOR
(
Frame
)
::
const_iterator
it
=
model
.
frames
.
begin
();
it
!=
model
.
frames
.
end
();
++
it
)
{
oss
<<
'"'
<<
it
->
name
<<
"
\"
,"
;
}
oss
<<
']'
;
throw
std
::
invalid_argument
(
oss
.
str
());
}
FrameIndex
jointFrameId
=
(
FrameIndex
)
res
;
// C-style cast to remove polluting compilation warning. This is Bad practice. See issue #323 (rework indexes)
FrameIndex
jointFrameId
=
model
.
addJointFrame
(
idx
,
0
);
appendBodyToJoint
(
jointFrameId
,
Y
,
SE3
::
Identity
(),
body_name
);
}
};
...
...
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