Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
uam_task_ctrl
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Pep Martí Saumell
uam_task_ctrl
Commits
dc5fff77
Commit
dc5fff77
authored
8 years ago
by
Angel Santamaria-Navarro
Browse files
Options
Downloads
Patches
Plain Diff
debugging sgfault
parent
0c90d839
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/common_fc.cpp
+9
-0
9 additions, 0 deletions
src/common_fc.cpp
src/common_fc.h
+1
-7
1 addition, 7 deletions
src/common_fc.h
src/common_obj.h
+2
-2
2 additions, 2 deletions
src/common_obj.h
src/kinematics.cpp
+3
-1
3 additions, 1 deletion
src/kinematics.cpp
src/kinematics.h
+0
-1
0 additions, 1 deletion
src/kinematics.h
with
15 additions
and
11 deletions
src/common_fc.cpp
+
9
−
0
View file @
dc5fff77
...
@@ -6,6 +6,15 @@ CCommon_Fc::CCommon_Fc(){}
...
@@ -6,6 +6,15 @@ CCommon_Fc::CCommon_Fc(){}
CCommon_Fc
::~
CCommon_Fc
(){}
CCommon_Fc
::~
CCommon_Fc
(){}
Eigen
::
MatrixXd
CCommon_Fc
::
CalcPinv
(
const
Eigen
::
MatrixXd
&
a
,
double
epsilon
)
{
Eigen
::
JacobiSVD
<
Eigen
::
MatrixXd
>
svdd
(
a
,
Eigen
::
ComputeThinU
|
Eigen
::
ComputeThinV
);
double
tolerance
=
epsilon
*
std
::
max
(
a
.
cols
(),
a
.
rows
())
*
svdd
.
singularValues
().
array
().
abs
()(
0
);
Eigen
::
MatrixXd
mpinv
=
svdd
.
matrixV
()
*
(
svdd
.
singularValues
().
array
().
abs
()
>
tolerance
).
select
(
svdd
.
singularValues
().
array
().
inverse
(),
0
).
matrix
().
asDiagonal
()
*
svdd
.
matrixU
().
adjoint
();
return
mpinv
;
}
Eigen
::
MatrixXd
CCommon_Fc
::
WeightInvJac
(
const
Eigen
::
MatrixXd
&
J
,
const
Eigen
::
MatrixXd
&
invjac_delta_gain
,
const
double
&
invjac_alpha_min
,
const
double
&
target_dist
)
Eigen
::
MatrixXd
CCommon_Fc
::
WeightInvJac
(
const
Eigen
::
MatrixXd
&
J
,
const
Eigen
::
MatrixXd
&
invjac_delta_gain
,
const
double
&
invjac_alpha_min
,
const
double
&
target_dist
)
{
{
// W: Weighting matrix (motion distribution) ______________________
// W: Weighting matrix (motion distribution) ______________________
...
...
This diff is collapsed.
Click to expand it.
src/common_fc.h
+
1
−
7
View file @
dc5fff77
...
@@ -57,13 +57,7 @@ class CCommon_Fc
...
@@ -57,13 +57,7 @@ class CCommon_Fc
*
*
* Compute the matrix pseudo-inverse using SVD
* Compute the matrix pseudo-inverse using SVD
*/
*/
template
<
typename
_Matrix_Type_
>
static
_Matrix_Type_
CalcPinv
(
const
_Matrix_Type_
&
a
,
double
epsilon
=
std
::
numeric_limits
<
double
>::
epsilon
())
static
Eigen
::
MatrixXd
CalcPinv
(
const
Eigen
::
MatrixXd
&
a
,
double
epsilon
=
std
::
numeric_limits
<
double
>::
epsilon
());
{
Eigen
::
JacobiSVD
<
_Matrix_Type_
>
svdd
(
a
,
Eigen
::
ComputeThinU
|
Eigen
::
ComputeThinV
);
double
tolerance
=
epsilon
*
std
::
max
(
a
.
cols
(),
a
.
rows
())
*
svdd
.
singularValues
().
array
().
abs
()(
0
);
_Matrix_Type_
mpinv
=
svdd
.
matrixV
()
*
(
svdd
.
singularValues
().
array
().
abs
()
>
tolerance
).
select
(
svdd
.
singularValues
().
array
().
inverse
(),
0
).
matrix
().
asDiagonal
()
*
svdd
.
matrixU
().
adjoint
();
return
mpinv
;
}
/**
/**
* \brief KDL Frame to Homogeneous transform
* \brief KDL Frame to Homogeneous transform
...
...
This diff is collapsed.
Click to expand it.
src/common_obj.h
+
2
−
2
View file @
dc5fff77
...
@@ -39,7 +39,7 @@ class CArmJoint{
...
@@ -39,7 +39,7 @@ class CArmJoint{
class
ArmCogData
{
class
ArmCogData
{
public:
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
std
::
vector
<
Eigen
::
MatrixXd
>
link_cog
;
// Vector of link CoG relative to base
std
::
vector
<
Eigen
::
MatrixXd
,
Eigen
::
aligned_allocator
<
Eigen
::
MatrixXd
>
>
link_cog
;
// Vector of link CoG relative to base
Eigen
::
MatrixXd
arm_cog
;
// Arm CoG coordinates w.r.t. arm base link;
Eigen
::
MatrixXd
arm_cog
;
// Arm CoG coordinates w.r.t. arm base link;
};
};
...
@@ -56,7 +56,7 @@ class CArm{
...
@@ -56,7 +56,7 @@ class CArm{
boost
::
scoped_ptr
<
KDL
::
ChainJntToJacSolver
>
jnt_to_jac_solver
;
// chain solver.
boost
::
scoped_ptr
<
KDL
::
ChainJntToJacSolver
>
jnt_to_jac_solver
;
// chain solver.
KDL
::
JntArray
jnt_pos_kdl
;
// Array of arm positions.
KDL
::
JntArray
jnt_pos_kdl
;
// Array of arm positions.
KDL
::
Jacobian
jacobian
;
// Jacobian.
KDL
::
Jacobian
jacobian
;
// Jacobian.
std
::
vector
<
Eigen
::
MatrixXd
>
T_base_to_joint
;
// Homogenous Transforms from arm base to each link.
std
::
vector
<
Eigen
::
MatrixXd
,
Eigen
::
aligned_allocator
<
Eigen
::
MatrixXd
>
>
T_base_to_joint
;
// Homogenous Transforms from arm base to each link.
CArm
(){};
CArm
(){};
~
CArm
(){};
~
CArm
(){};
};
};
...
...
This diff is collapsed.
Click to expand it.
src/kinematics.cpp
+
3
−
1
View file @
dc5fff77
...
@@ -24,8 +24,10 @@ void CKinematics::UAMKine(const UAM::CQuad& quad, UAM::CArm& arm, UAM::CHT& HT,
...
@@ -24,8 +24,10 @@ void CKinematics::UAMKine(const UAM::CQuad& quad, UAM::CArm& arm, UAM::CHT& HT,
// Quadrotor Jacobian body to inertial frames
// Quadrotor Jacobian body to inertial frames
Eigen
::
MatrixXd
Jb2i
=
QuadJac
(
quad
.
pos
);
Eigen
::
MatrixXd
Jb2i
=
QuadJac
(
quad
.
pos
);
std
::
cout
<<
__LINE__
<<
" ["
<<
quad
.
pos
.
transpose
()
<<
"]"
<<
std
::
endl
;
// Inertial to body frames
// Inertial to body frames
Eigen
::
MatrixXd
Ji2b
=
Jb2i
.
inverse
(
);
Eigen
::
MatrixXd
Ji2b
=
UAM
::
CCommon_Fc
::
CalcPinv
(
Jb2i
);
// Jacobian from quadrotor body to camera
// Jacobian from quadrotor body to camera
Eigen
::
MatrixXd
Jb2c
=
Eigen
::
MatrixXd
::
Zero
(
6
,
6
);
Eigen
::
MatrixXd
Jb2c
=
Eigen
::
MatrixXd
::
Zero
(
6
,
6
);
...
...
This diff is collapsed.
Click to expand it.
src/kinematics.h
+
0
−
1
View file @
dc5fff77
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
#include
<kdl/chainiksolvervel_pinv.hpp>
#include
<kdl/chainiksolvervel_pinv.hpp>
#include
<kdl/chainiksolvervel_pinv_givens.hpp>
#include
<kdl/chainiksolvervel_pinv_givens.hpp>
#include
<kdl/chainjnttojacsolver.hpp>
#include
<kdl/chainjnttojacsolver.hpp>
#include
<kdl/chainjnttojacsolver.hpp>
// Own stuff
// Own stuff
#include
"common_obj.h"
#include
"common_obj.h"
...
...
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