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
3c029ada
Commit
3c029ada
authored
Sep 07, 2016
by
Joseph Mirabel
Committed by
Joseph Mirabel
Sep 07, 2016
Browse files
[C++] Fix issues related to frame "universe"
parent
1d53aec9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hpp
View file @
3c029ada
...
...
@@ -124,6 +124,9 @@ namespace se3
,
gravity
(
gravity981
,
Eigen
::
Vector3d
::
Zero
()
)
{
names
[
0
]
=
"universe"
;
// Should be "universe joint (trivial)"
// FIXME Should the universe joint be a FIXED_JOINT even if it is
// in the list of joints ? See comment in definition of
// Model::addJointFrame and Model::addBodyFrame
addFrame
(
Frame
(
"universe"
,
0
,
0
,
SE3
::
Identity
(),
FIXED_JOINT
));
// Inertia of universe has no sense.
inertias
[
0
].
mass
()
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
...
...
src/multibody/model.hxx
View file @
3c029ada
...
...
@@ -103,10 +103,11 @@ namespace se3
int
fidx
)
{
if
(
fidx
<
0
)
{
fidx
=
getFrameId
(
names
[
parents
[
jidx
]],
JOINT
);
// FIXED_JOINT is required because the parent can be the universe and its
// type is FIXED_JOINT
fidx
=
getFrameId
(
names
[
parents
[
jidx
]],
(
FrameType
)(
JOINT
|
FIXED_JOINT
));
}
if
(
fidx
>=
frames
.
size
())
throw
std
::
invalid_argument
(
"Frame not found"
);
assert
(
fidx
<
frames
.
size
()
&&
"Frame index out of bound"
);
// Add a the joint frame attached to itself to the frame vector - redundant information but useful.
return
addFrame
(
Frame
(
names
[
jidx
],
jidx
,
fidx
,
SE3
::
Identity
(),
JOINT
));
}
...
...
@@ -126,7 +127,9 @@ namespace se3
int
previousFrame
)
{
if
(
previousFrame
<
0
)
{
previousFrame
=
getFrameId
(
names
[
parentJoint
],
JOINT
);
// FIXED_JOINT is required because the parent can be the universe and its
// type is FIXED_JOINT
previousFrame
=
getFrameId
(
names
[
parentJoint
],
(
FrameType
)(
JOINT
|
FIXED_JOINT
));
}
assert
(
previousFrame
<
frames
.
size
()
&&
"Frame index out of bound"
);
return
addFrame
(
Frame
(
body_name
,
parentJoint
,
previousFrame
,
body_placement
,
BODY
));
...
...
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