Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-core
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
sot-core
Commits
a7804f51
Commit
a7804f51
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Clean dependencies and avoid unnecessary computation.
parent
ed217d46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/feature/feature-transformation.cpp
+16
-11
16 additions, 11 deletions
src/feature/feature-transformation.cpp
with
16 additions
and
11 deletions
src/feature/feature-transformation.cpp
+
16
−
11
View file @
a7804f51
...
...
@@ -70,8 +70,7 @@ FeatureTransformation( const string& pointName )
faMfbDes
.
setConstant
(
Id
);
faMfbDesDot
.
setConstant
(
Vector
::
Zero
(
6
));
jacobianSOUT
.
addDependencies
(
q_oMfbDes
<<
q_oMfb
<<
jbMfb
<<
jaMfa
<<
faMfbDes
jacobianSOUT
.
addDependencies
(
q_oMfbDes
<<
q_oMfb
<<
jaJja
<<
jbJjb
);
errorSOUT
.
addDependencies
(
q_oMfbDes
<<
q_oMfb
);
...
...
@@ -81,7 +80,7 @@ FeatureTransformation( const string& pointName )
errordotSOUT
.
setFunction
(
boost
::
bind
(
&
FeatureTransformation
::
computeErrorDot
,
this
,
_1
,
_2
));
errordotSOUT
.
addDependencies
(
q_oMfbDes
<<
q_oMfb
<<
faMfbDes
<<
faMfbDesDot
);
errordotSOUT
.
addDependencies
(
q_oMfbDes
<<
q_oMfb
<<
faMfbDesDot
);
// Commands
//
...
...
@@ -138,12 +137,15 @@ Matrix& FeatureTransformation::computeJacobian( Matrix& J,int time )
{
check
(
*
this
);
q_oMfb
.
recompute
(
time
);
q_oMfbDes
.
recompute
(
time
);
const
int
&
dim
=
dimensionSOUT
(
time
);
const
Flags
&
fl
=
selectionSIN
(
time
);
const
Matrix
&
_jbJjb
=
jbJjb
(
time
);
const
MatrixHomogeneous
&
_jbMfb
=
(
jbMfb
.
isPlugged
()
?
jbMfb
(
time
)
:
Id
);
const
MatrixHomogeneous
&
_jbMfb
=
(
jbMfb
.
isPlugged
()
?
jbMfb
.
accessCopy
(
)
:
Id
);
const
Matrix
::
Index
cJ
=
_jbJjb
.
cols
();
J
.
resize
(
dim
,
cJ
)
;
...
...
@@ -152,7 +154,7 @@ Matrix& FeatureTransformation::computeJacobian( Matrix& J,int time )
Eigen
::
Matrix
<
double
,
6
,
6
,
Eigen
::
RowMajor
>
Jminus
;
buildFrom
(
_jbMfb
.
inverse
(
Eigen
::
Affine
),
X
);
LieGroup_t
().
dDifference
<
pinocchio
::
ARG1
>
(
q_oMfbDes
(
time
),
q_oMfb
(
time
),
Jminus
);
LieGroup_t
().
dDifference
<
pinocchio
::
ARG1
>
(
q_oMfbDes
.
accessCopy
(),
q_oMfb
.
accessCopy
(
),
Jminus
);
// Contribution of b:
// J = Jminus * X * jbJjb;
...
...
@@ -163,10 +165,10 @@ Matrix& FeatureTransformation::computeJacobian( Matrix& J,int time )
if
(
jaJja
.
isPlugged
())
{
const
Matrix
&
_jaJja
=
jaJja
(
time
);
const
MatrixHomogeneous
&
_jaMfa
=
(
jaMfa
.
isPlugged
()
?
jaMfa
(
time
)
:
Id
),
_faMfbDes
=
(
faMfbDes
.
isPlugged
()
?
faMfbDes
(
time
)
:
Id
);
const
MatrixHomogeneous
&
_jaMfa
=
(
jaMfa
.
isPlugged
()
?
jaMfa
.
accessCopy
(
)
:
Id
),
_faMfbDes
=
(
faMfbDes
.
isPlugged
()
?
faMfbDes
.
accessCopy
(
)
:
Id
);
LieGroup_t
().
dDifference
<
pinocchio
::
ARG0
>
(
q_oMfbDes
(
time
),
q_oMfb
(
time
),
Jminus
);
LieGroup_t
().
dDifference
<
pinocchio
::
ARG0
>
(
q_oMfbDes
.
accessCopy
(),
q_oMfb
.
accessCopy
(
),
Jminus
);
buildFrom
((
_jaMfa
*
_faMfbDes
).
inverse
(
Eigen
::
Affine
),
X
);
// J += (Jminus * X) * jaJja(time);
...
...
@@ -224,11 +226,14 @@ Vector& FeatureTransformation::computeErrorDot( Vector& errordot,int time )
return
errordot
;
}
const
MatrixHomogeneous
&
_faMfbDes
=
(
faMfbDes
.
isPlugged
()
?
faMfbDes
(
time
)
:
Id
);
q_oMfb
.
recompute
(
time
);
q_oMfbDes
.
recompute
(
time
);
const
MatrixHomogeneous
&
_faMfbDes
=
(
faMfbDes
.
isPlugged
()
?
faMfbDes
.
accessCopy
()
:
Id
);
Eigen
::
Matrix
<
double
,
6
,
6
,
Eigen
::
RowMajor
>
Jminus
;
LieGroup_t
().
dDifference
<
pinocchio
::
ARG0
>
(
q_oMfbDes
(
time
),
q_oMfb
(
time
),
Jminus
);
LieGroup_t
().
dDifference
<
pinocchio
::
ARG0
>
(
q_oMfbDes
.
accessCopy
(),
q_oMfb
.
accessCopy
(
),
Jminus
);
// Assume _faMfbDesDot is expressed in fa
Jminus
=
Jminus
*
pinocchio
::
SE3
(
_faMfbDes
.
rotation
(),
_faMfbDes
.
translation
()).
toActionMatrixInverse
();
// Assume _faMfbDesDot is expressed in fb*
...
...
@@ -236,7 +241,7 @@ Vector& FeatureTransformation::computeErrorDot( Vector& errordot,int time )
unsigned
int
cursor
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
6
;
++
i
)
if
(
fl
(
i
)
)
errordot
(
cursor
++
)
=
Jminus
.
row
(
i
)
*
faMfbDesDot
(
time
);
errordot
(
cursor
++
)
=
Jminus
.
row
(
i
)
*
faMfbDesDot
.
accessCopy
(
);
return
errordot
;
}
...
...
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