Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
de2b8e5d
Commit
de2b8e5d
authored
9 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Plain Diff
Merge pull request #60 from aelkhour/master
Fix URDF inertia parser
parents
d245f853
6ba54405
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/multibody/parser/urdf.hpp
+10
-4
10 additions, 4 deletions
src/multibody/parser/urdf.hpp
with
10 additions
and
4 deletions
src/multibody/parser/urdf.hpp
+
10
−
4
View file @
de2b8e5d
...
...
@@ -88,6 +88,7 @@ void parseTree( ::urdf::LinkConstPtr link, Model & model,SE3 placementOffset = S
//assert(link->inertial && "The parser cannot accept trivial mass");
// FIXME: Inertia must not be set to identity when link has no inertial tag.
const
Inertia
&
Y
=
(
link
->
inertial
)
?
convertFromUrdf
(
*
link
->
inertial
)
:
Inertia
::
Identity
();
...
...
@@ -204,13 +205,18 @@ void parseTree( ::urdf::LinkConstPtr link, Model & model,SE3 placementOffset = S
}
case
::
urdf
::
Joint
::
FIXED
:
{
// In case of fixed join:
// In case of fixed join
t, if link has inertial tag
:
// -add the inertia of the link to his parent in the model
// -let all the children become children of parent
// Otherwise do nothing.
// In all cases:
// -let all the children become children of parent
// -inform the parser of the offset to apply
// -add fixed body in model to display it in gepetto-viewer
if
(
link
->
inertial
)
{
model
.
mergeFixedBody
(
parent
,
jointPlacement
,
Y
);
//Modify the parent inertia in the model
}
model
.
mergeFixedBody
(
parent
,
jointPlacement
,
Y
);
//Modify the parent inertia in the model
SE3
ptjot_se3
=
convertFromUrdf
(
link
->
parent_joint
->
parent_to_joint_origin_transform
);
//transformation of the current placement offset
...
...
@@ -219,7 +225,7 @@ void parseTree( ::urdf::LinkConstPtr link, Model & model,SE3 placementOffset = S
//add the fixed Body in the model for the viewer
model
.
addFixedBody
(
parent
,
nextPlacementOffset
,
link
->
name
,
visual
);
BOOST_FOREACH
(
::
urdf
::
LinkPtr
child_link
,
link
->
child_links
)
BOOST_FOREACH
(
::
urdf
::
LinkPtr
child_link
,
link
->
child_links
)
{
child_link
->
setParent
(
link
->
getParent
()
);
//skip the fixed generation
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment