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
e7fa0775
Commit
e7fa0775
authored
8 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[C++] Inertia of the world is initialized with NaN.
parent
85c91b01
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/multibody/model.hpp
+5
-1
5 additions, 1 deletion
src/multibody/model.hpp
src/parsers/urdf/model.cpp
+7
-3
7 additions, 3 deletions
src/parsers/urdf/model.cpp
with
12 additions
and
4 deletions
src/multibody/model.hpp
+
5
−
1
View file @
e7fa0775
...
@@ -115,7 +115,7 @@ namespace se3
...
@@ -115,7 +115,7 @@ namespace se3
,
njoint
(
1
)
,
njoint
(
1
)
,
nbody
(
1
)
,
nbody
(
1
)
,
nFrames
(
0
)
,
nFrames
(
0
)
,
inertias
(
1
,
Inertia
::
Zero
()
)
,
inertias
(
1
)
,
jointPlacements
(
1
,
SE3
::
Identity
())
,
jointPlacements
(
1
,
SE3
::
Identity
())
,
joints
(
1
)
,
joints
(
1
)
,
parents
(
1
,
0
)
,
parents
(
1
,
0
)
...
@@ -125,6 +125,10 @@ namespace se3
...
@@ -125,6 +125,10 @@ namespace se3
{
{
names
[
0
]
=
"universe"
;
// Should be "universe joint (trivial)"
names
[
0
]
=
"universe"
;
// Should be "universe joint (trivial)"
addFrame
(
Frame
(
"universe"
,
0
,
0
,
SE3
::
Identity
(),
FIXED_JOINT
));
addFrame
(
Frame
(
"universe"
,
0
,
0
,
SE3
::
Identity
(),
FIXED_JOINT
));
// Inertia of universe has no sense.
inertias
[
0
].
mass
()
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
inertias
[
0
].
lever
().
fill
(
std
::
numeric_limits
<
double
>::
quiet_NaN
());
inertias
[
0
].
inertia
().
fill
(
std
::
numeric_limits
<
double
>::
quiet_NaN
());
}
}
~
Model
()
{}
// std::cout << "Destroy model" << std::endl; }
~
Model
()
{}
// std::cout << "Destroy model" << std::endl; }
...
...
This diff is collapsed.
Click to expand it.
src/parsers/urdf/model.cpp
+
7
−
3
View file @
e7fa0775
...
@@ -64,14 +64,18 @@ namespace se3
...
@@ -64,14 +64,18 @@ namespace se3
{
{
const
Frame
&
frame
=
model
.
frames
[
fid
];
const
Frame
&
frame
=
model
.
frames
[
fid
];
const
SE3
&
p
=
frame
.
placement
*
placement
;
const
SE3
&
p
=
frame
.
placement
*
placement
;
if
(
Y
!=
NULL
&&
Y
->
mass
>
Eigen
::
NumTraits
<
double
>::
epsilon
())
{
if
(
frame
.
parent
>
0
&&
Y
!=
NULL
&&
Y
->
mass
>
Eigen
::
NumTraits
<
double
>::
epsilon
())
{
model
.
appendBodyToJoint
(
frame
.
parent
,
convertFromUrdf
(
*
Y
),
p
);
model
.
appendBodyToJoint
(
frame
.
parent
,
convertFromUrdf
(
*
Y
),
p
);
}
}
model
.
addBodyFrame
(
body_name
,
frame
.
parent
,
p
,
fid
);
model
.
addBodyFrame
(
body_name
,
frame
.
parent
,
p
,
fid
);
// Reference to model.frames[fid] can has changed because the vector
// Reference to model.frames[fid] can has changed because the vector
// may have been reallocated.
// may have been reallocated.
assert
(
!
model
.
inertias
[
model
.
frames
[
fid
].
parent
].
lever
().
hasNaN
()
if
(
model
.
frames
[
fid
].
parent
>
0
)
{
&&
!
model
.
inertias
[
model
.
frames
[
fid
].
parent
].
inertia
().
data
().
hasNaN
());
assert
(
!
model
.
inertias
[
model
.
frames
[
fid
].
parent
].
lever
().
hasNaN
()
&&
!
model
.
inertias
[
model
.
frames
[
fid
].
parent
].
inertia
().
data
().
hasNaN
());
}
}
}
///
///
...
...
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