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
3b033501
Commit
3b033501
authored
9 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[C++] Fix to new API
parent
da720dcd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/algorithm/operational-frames.hpp
+2
-2
2 additions, 2 deletions
src/algorithm/operational-frames.hpp
src/multibody/model.hxx
+1
-1
1 addition, 1 deletion
src/multibody/model.hxx
unittest/operational-frames.cpp
+7
-7
7 additions, 7 deletions
unittest/operational-frames.cpp
with
10 additions
and
10 deletions
src/algorithm/operational-frames.hpp
+
2
−
2
View file @
3b033501
...
...
@@ -89,7 +89,7 @@ inline void framesForwardKinematic(const Model & model,
for
(
Model
::
Index
i
=
0
;
i
<
(
Model
::
Index
)
model
.
nOperationalFrames
;
++
i
)
{
const
Model
::
Index
&
parent
=
model
.
operational_frames
[
i
].
parent_id
;
data
.
oMof
[
i
]
=
(
data
.
oMi
[
parent
]
*
model
.
operational_frames
[
i
].
frame
_p
lacement
);
data
.
oMof
[
i
]
=
(
data
.
oMi
[
parent
]
*
model
.
operational_frames
[
i
].
frame
P
lacement
);
}
}
...
...
@@ -119,7 +119,7 @@ inline void getFrameJacobian(const Model & model, const Data& data,
int
colRef
=
nv
(
model
.
joints
[
parent
])
+
idx_v
(
model
.
joints
[
parent
])
-
1
;
SE3
::
Vector3
lever
(
data
.
oMi
[
parent
].
rotation
()
*
(
model
.
operational_frames
[
frame_id
].
frame
_p
lacement
.
translation
()));
SE3
::
Vector3
lever
(
data
.
oMi
[
parent
].
rotation
()
*
(
model
.
operational_frames
[
frame_id
].
frame
P
lacement
.
translation
()));
if
(
!
localFrame
)
getJacobian
<
localFrame
>
(
model
,
data
,
parent
,
J
);
for
(
int
j
=
colRef
;
j
>=
0
;
j
=
data
.
parents_fromRow
[(
Model
::
Index
)
j
])
...
...
This diff is collapsed.
Click to expand it.
src/multibody/model.hxx
+
1
−
1
View file @
3b033501
...
...
@@ -216,7 +216,7 @@ namespace se3
inline
const
SE3
&
Model
::
getFramePlacement
(
const
Index
index
)
const
{
return
operational_frames
[
index
].
frame
_p
lacement
;
return
operational_frames
[
index
].
frame
P
lacement
;
}
inline
bool
Model
::
addFrame
(
const
Frame
&
frame
)
...
...
This diff is collapsed.
Click to expand it.
unittest/operational-frames.cpp
+
7
−
7
View file @
3b033501
...
...
@@ -41,15 +41,15 @@ BOOST_AUTO_TEST_CASE ( test_kinematics )
se3
::
buildModels
::
humanoidSimple
(
model
);
Model
::
Index
parent_idx
=
model
.
existJointName
(
"rarm2_joint"
)
?
model
.
getJointId
(
"rarm2_joint"
)
:
(
Model
::
Index
)(
model
.
nbody
-
1
);
const
std
::
string
&
frame_name
=
std
::
string
(
model
.
getJointName
(
parent_idx
)
+
"_frame"
);
const
SE3
&
frame
_p
lacement
=
SE3
::
Random
();
model
.
addFrame
(
frame_name
,
parent_idx
,
frame
_p
lacement
);
const
SE3
&
frame
P
lacement
=
SE3
::
Random
();
model
.
addFrame
(
frame_name
,
parent_idx
,
frame
P
lacement
);
se3
::
Data
data
(
model
);
VectorXd
q
=
VectorXd
::
Ones
(
model
.
nq
);
q
.
middleRows
<
4
>
(
3
).
normalize
();
framesForwardKinematic
(
model
,
data
,
q
);
BOOST_CHECK
(
data
.
oMof
[
model
.
getFrameId
(
frame_name
)].
isApprox
(
data
.
oMi
[
parent_idx
]
*
frame
_p
lacement
));
BOOST_CHECK
(
data
.
oMof
[
model
.
getFrameId
(
frame_name
)].
isApprox
(
data
.
oMi
[
parent_idx
]
*
frame
P
lacement
));
}
...
...
@@ -64,8 +64,8 @@ BOOST_AUTO_TEST_CASE ( test_jacobian )
se3
::
buildModels
::
humanoidSimple
(
model
);
Model
::
Index
parent_idx
=
model
.
existJointName
(
"rarm2_joint"
)
?
model
.
getJointId
(
"rarm2_joint"
)
:
(
Model
::
Index
)(
model
.
nbody
-
1
);
const
std
::
string
&
frame_name
=
std
::
string
(
model
.
getJointName
(
parent_idx
)
+
"_frame"
);
const
SE3
&
frame
_p
lacement
=
SE3
::
Random
();
model
.
addFrame
(
frame_name
,
parent_idx
,
frame
_p
lacement
);
const
SE3
&
frame
P
lacement
=
SE3
::
Random
();
model
.
addFrame
(
frame_name
,
parent_idx
,
frame
P
lacement
);
se3
::
Data
data
(
model
);
VectorXd
q
=
VectorXd
::
Ones
(
model
.
nq
);
...
...
@@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE ( test_jacobian )
Motion
nu_joint
(
Joj
*
q_dot
);
Motion
nu_frame_from_nu_joint
(
nu_joint
);
nu_frame_from_nu_joint
.
linear
()
-=
(
data
.
oMi
[
parent_idx
].
rotation
()
*
frame
_p
lacement
.
translation
()).
cross
(
nu_joint
.
angular
());
nu_frame_from_nu_joint
.
linear
()
-=
(
data
.
oMi
[
parent_idx
].
rotation
()
*
frame
P
lacement
.
translation
()).
cross
(
nu_joint
.
angular
());
BOOST_CHECK
(
nu_frame
.
toVector
().
isApprox
(
nu_frame_from_nu_joint
.
toVector
(),
1e-12
));
...
...
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE ( test_jacobian )
nu_frame
=
Jff
*
q_dot
;
nu_joint
=
Jjj
*
q_dot
;
BOOST_CHECK
(
nu_frame
.
toVector
().
isApprox
(
frame
_p
lacement
.
actInv
(
nu_joint
).
toVector
(),
1e-12
));
BOOST_CHECK
(
nu_frame
.
toVector
().
isApprox
(
frame
P
lacement
.
actInv
(
nu_joint
).
toVector
(),
1e-12
));
}
BOOST_AUTO_TEST_SUITE_END
()
...
...
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