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
250411be
Commit
250411be
authored
10 years ago
by
asantamaria
Browse files
Options
Downloads
Patches
Plain Diff
Before isolating visual servo into a single function
parent
d997fafd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/quadarm_task_priority_ctrl.cpp
+22
-30
22 additions, 30 deletions
src/quadarm_task_priority_ctrl.cpp
with
22 additions
and
30 deletions
src/quadarm_task_priority_ctrl.cpp
+
22
−
30
View file @
250411be
...
...
@@ -200,56 +200,50 @@ MatrixXd CQuadarm_Task_Priority_Ctrl::quadrotor_jacobian()
// Control
void
CQuadarm_Task_Priority_Ctrl
::
qa_control
(){
// Control law ________________________________________________________________
// TASK: Security task (Inflation radius) _____________________
// task Jacobian and sigma
MatrixXd
JIR
,
JIR_pseudo
,
sigmaIR
;
task_infrad
(
JIR
,
JIR_pseudo
,
sigmaIR
);
// TASK: Visual Servo _________________________________________
// Underactuated Quadrotor
MatrixXd
J1
(
8
,
4
),
J2
(
8
,
2
),
Jqa1
(
6
,
4
+
this
->
arm_
.
nj
),
Jqa2
(
6
,
2
);
// 9 DOF Extracting wx and wy from quadrotor
//////////////////
// 9 DOF Extracting wx and wy from quadrotor
Jqa1
.
block
(
0
,
0
,
6
,
3
)
=
this
->
Jqa_
.
block
(
0
,
0
,
6
,
3
);
Jqa1
.
block
(
0
,
3
,
6
,
1
+
this
->
arm_
.
nj
)
=
this
->
Jqa_
.
block
(
0
,
5
,
6
,
1
+
this
->
arm_
.
nj
);
Jqa2
=
this
->
Jqa_
.
block
(
0
,
3
,
6
,
2
);
MatrixXd
eye
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
eye
=
MatrixXd
::
Identity
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
// compute pseudo inverse /////////////
MatrixXd
Jqa1_pseudo
(
4
+
this
->
arm_
.
nj
,
6
);
Jqa1_pseudo
=
calcPinv
(
Jqa1
);
// compute pseudo inverse
//MatrixXd Jqa1_pseudo(4+this->arm_.nj,6);
//Jqa1_pseudo = calcPinv(Jqa1);
MatrixXd
Jqa1_wpseudo
(
4
+
this
->
arm_
.
nj
,
6
);
Jqa1_wpseudo
=
weight_jacvs_inverse
(
Jqa1
);
MatrixXd
sigmaVS
=
this
->
vel_
.
cam
-
Jqa2
*
this
->
ctrl_params_
.
v_rollpitch
;
// Control law ________________________________________________________________
// Secutiry task (Inflation radius)
MatrixXd
JIR
,
JIR_pseudo
,
sigmaIR
;
task_infrad
(
JIR
,
JIR_pseudo
,
sigmaIR
);
// Primary control task (Visual Servo) ________________________
this
->
ctrl_params_
.
vs_vel
=
Jqa1_wpseudo
*
sigmaVS
;
// Jqa1
// Jqa1_wpseudo
// sigmaVS
// Secondary control task (CoG alignement) ____________________
// TASK: CoG alignement ______________________________________
// Null space projector
//MatrixXd Nqa1 = (eye-(Jqa1_pseudo*Jqa1));
MatrixXd
Nqa1
=
(
eye
-
(
Jqa1_wpseudo
*
Jqa1
));
//
Secondary
task Jacobian and sigma
// task Jacobian and sigma
MatrixXd
JG
,
JG_pseudo
,
sigmaG
;
task_cog
(
JG
,
JG_pseudo
,
sigmaG
);
// Gain
double
lambdaG
=
this
->
ctrl_params_
.
cog_gain
;
//
Secondary
task velocity
// task velocity
this
->
ctrl_params_
.
cog_vel
=
Nqa1
*
JG_pseudo
*
lambdaG
*
sigmaG
;
// Third control task (Joint limits) ________________________
...
...
@@ -260,21 +254,19 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
Jqa1_G
.
block
(
Jqa1
.
rows
()
-
1
,
0
,
JG
.
rows
(),
JG
.
cols
())
=
JG
;
MatrixXd
Nqa1_G
=
MatrixXd
::
Zero
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
MatrixXd
Jqa1_G_pseudo
=
calcPinv
(
Jqa1_G
);
// Third task after secondary aligning CoG
Nqa1_G
=
(
eye
-
(
Jqa1_G_pseudo
*
Jqa1_G
));
//Nqa1_G = Nqa1; // Third task as secondary
// Third task as secondary
//Nqa1_G = Nqa1;
// Sec task Jacobian and sigma
// task Jacobian and sigma
MatrixXd
JL
,
JL_pseudo
,
sigmaL
;
task_jl
(
JL
,
JL_pseudo
,
sigmaL
);
// Gain
double
lambdaL
=
this
->
ctrl_params_
.
jntlim_gain
;
//
Third
task velocity
// task velocity
this
->
ctrl_params_
.
jntlim_vel
=
Nqa1_G
*
JL_pseudo
*
lambdaL
*
sigmaL
;
//******************************************************************
...
...
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