Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrl-walkgen
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Guilhem Saurel
jrl-walkgen
Commits
29e4a528
Commit
29e4a528
authored
13 years ago
by
Jory Lafaye
Browse files
Options
Downloads
Patches
Plain Diff
compute the inverse of COP dynamic matrix U
parent
846126ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/PreviewControl/rigid-body-system.cpp
+29
-0
29 additions, 0 deletions
src/PreviewControl/rigid-body-system.cpp
src/PreviewControl/rigid-body.hh
+4
-0
4 additions, 0 deletions
src/PreviewControl/rigid-body.hh
with
33 additions
and
0 deletions
src/PreviewControl/rigid-body-system.cpp
+
29
−
0
View file @
29e4a528
...
...
@@ -255,6 +255,32 @@ RigidBodySystem::update( const std::deque<support_state_t> & SupportStates_deq,
}
/* TODO : Move this function on another file
*
* Matrix inversion routine.
Uses lu_factorize and lu_substitute in uBLAS to invert a matrix */
template
<
class
T
>
bool
invertMatrix
(
const
boost_ublas
::
matrix
<
T
>&
input
,
boost_ublas
::
matrix
<
T
>&
inverse
)
{
using
namespace
boost
::
numeric
::
ublas
;
typedef
permutation_matrix
<
std
::
size_t
>
pmatrix
;
// create a working copy of the input
matrix
<
T
>
A
(
input
);
// create a permutation matrix for the LU-factorization
pmatrix
pm
(
A
.
size1
());
// perform LU-factorization
int
res
=
lu_factorize
(
A
,
pm
);
if
(
res
!=
0
)
return
false
;
// create identity matrix of "inverse"
inverse
.
assign
(
boost_ublas
::
identity_matrix
<
T
>
(
A
.
size1
()));
// backsubstitute to get the inverse
lu_substitute
(
A
,
pm
,
inverse
);
return
true
;
}
int
RigidBodySystem
::
compute_dyn_cop
(
const
std
::
deque
<
support_state_t
>
&
SupportStates_deq
)
...
...
@@ -316,6 +342,9 @@ RigidBodySystem::compute_dyn_cop( const std::deque<support_state_t> & SupportSta
RFTraj_it
++
;
}
CoPDynamicsJerk_
.
Um1
.
resize
(
CoPDynamicsJerk_
.
U
.
size1
(),
CoPDynamicsJerk_
.
U
.
size2
());
invertMatrix
(
CoPDynamicsJerk_
.
U
,
CoPDynamicsJerk_
.
Um1
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/PreviewControl/rigid-body.hh
+
4
−
0
View file @
29e4a528
...
...
@@ -80,6 +80,10 @@ namespace PatternGeneratorJRL
{
/// \brief Control matrix
boost_ublas
::
matrix
<
double
>
U
;
/// \brief Inverse of control matrix
boost_ublas
::
matrix
<
double
>
Um1
;
/// \brief Transpose of control matrix
boost_ublas
::
matrix
<
double
>
UT
;
...
...
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