Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cobotmpc
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Maxime Sabbah
cobotmpc
Commits
1939852b
Commit
1939852b
authored
8 months ago
by
Maxime Sabbah
Browse files
Options
Downloads
Patches
Plain Diff
change rnea by computeGeneralizedGravity
parent
13b89f86
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/cobotmpc/crocomplements/actuation-human-impedance.hxx
+8
-7
8 additions, 7 deletions
...ude/cobotmpc/crocomplements/actuation-human-impedance.hxx
with
8 additions
and
7 deletions
include/cobotmpc/crocomplements/actuation-human-impedance.hxx
+
8
−
7
View file @
1939852b
...
...
@@ -53,10 +53,10 @@ void ActuationModelHumanImpedanceTpl<Scalar>::calc(const boost::shared_ptr<Actua
const
Eigen
::
VectorBlock
<
const
Eigen
::
Ref
<
const
VectorXs
>
,
Eigen
::
Dynamic
>
v
=
x
.
tail
(
state_
->
get_nv
());
pinocchio
::
rnea
(
*
pin_model_
.
get
(),
*
d
->
pinocchio
,
q
,
VectorXs
::
Zero
(
state_
->
get_nv
())
,
VectorXs
::
Zero
(
state_
->
get_nv
())
);
pinocchio
::
computeGeneralizedGravity
(
*
pin_model_
.
get
(),
*
d
->
pinocchio
,
q
);
d
->
tau
.
head
(
nu_human_
)
=
(
Kp_
*
(
xref_
.
head
(
nu_human_
)
-
q
.
head
(
nu_human_
))
+
Kd_
*
(
xref_
.
tail
(
nu_human_
)
-
v
.
head
(
nu_human_
))
+
d
->
pinocchio
->
tau
.
head
(
nu_human_
));
d
->
tau
.
tail
(
nu_
)
=
u
+
d
->
pinocchio
->
tau
.
tail
(
nu_
);
d
->
tau
.
head
(
nu_human_
)
=
(
Kp_
*
(
xref_
.
head
(
nu_human_
)
-
q
.
head
(
nu_human_
))
+
Kd_
*
(
xref_
.
tail
(
nu_human_
)
-
v
.
head
(
nu_human_
))
+
d
->
pinocchio
->
g
.
head
(
nu_human_
));
d
->
tau
.
tail
(
nu_
)
=
u
+
d
->
pinocchio
->
g
.
tail
(
nu_
);
}
template
<
typename
Scalar
>
...
...
@@ -70,16 +70,17 @@ void ActuationModelHumanImpedanceTpl<Scalar>::calcDiff(const boost::shared_ptr<A
x
.
head
(
state_
->
get_nq
());
// const Eigen::VectorBlock<const Eigen::Ref<const VectorXs>, Eigen::Dynamic> v =
// x.tail(state_->get_nv());
MatrixXs
gravity_partial_dq
=
MatrixXs
::
Zero
(
state_
->
get_nv
(),
state_
->
get_nv
());
d
->
dtau_du
.
topRows
(
nu_human_
)
=
MatrixXs
::
Zero
(
nu_human_
,
nu_
);
d
->
dtau_du
.
bottomRows
(
nu_
)
=
MatrixXs
::
Identity
(
nu_
,
nu_
);
pinocchio
::
compute
RNEA
Derivatives
(
*
pin_model_
.
get
(),
*
d
->
pinocchio
,
q
,
VectorXs
::
Zero
(
state_
->
get_nv
()),
VectorXs
::
Zero
(
state_
->
get_nv
())
);
pinocchio
::
compute
GeneralizedGravity
Derivatives
(
*
pin_model_
.
get
(),
*
d
->
pinocchio
,
q
,
gravity_partial_dq
);
d
->
dtau_dx
.
leftCols
(
state_
->
get_n
q
())
=
d
->
pinocchio
->
dtau
_dq
;
d
->
dtau_dx
.
rightCols
(
state_
->
get_nv
())
=
d
->
pinocchio
->
dtau_dv
;
d
->
dtau_dx
.
leftCols
(
state_
->
get_n
v
())
=
gravity_partial
_dq
;
//
d->dtau_dx.rightCols(state_->get_nv())=d->pinocchio->dtau_dv;
d
->
dtau_dx
.
topLeftCorner
(
nu_human_
,
nu_human_
)
+=
-
Kp_
*
MatrixXs
::
Identity
(
nu_human_
,
nu_human_
);
d
->
dtau_dx
.
block
(
0
,
state_
->
get_n
q
(),
nu_human_
,
nu_human_
)
+=
-
Kd_
*
MatrixXs
::
Identity
(
nu_human_
,
nu_human_
);
d
->
dtau_dx
.
block
(
0
,
state_
->
get_n
v
(),
nu_human_
,
nu_human_
)
+=
-
Kd_
*
MatrixXs
::
Identity
(
nu_human_
,
nu_human_
);
}
...
...
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