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
dda9c08d
Commit
dda9c08d
authored
10 years ago
by
asantamaria
Browse files
Options
Downloads
Patches
Plain Diff
cleaned code and VS moved to a single function. Starting with Inflation radius task
parent
250411be
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/quadarm_task_priority_ctrl.cpp
+30
-25
30 additions, 25 deletions
src/quadarm_task_priority_ctrl.cpp
src/quadarm_task_priority_ctrl.h
+1
-1
1 addition, 1 deletion
src/quadarm_task_priority_ctrl.h
with
31 additions
and
26 deletions
src/quadarm_task_priority_ctrl.cpp
+
30
−
25
View file @
dda9c08d
...
@@ -211,30 +211,18 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
...
@@ -211,30 +211,18 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
// TASK: Visual Servo _________________________________________
// TASK: Visual Servo _________________________________________
// Underactuated Quadrotor
// task Jacobian and sigma
MatrixXd
J1
(
8
,
4
),
J2
(
8
,
2
),
Jqa1
(
6
,
4
+
this
->
arm_
.
nj
),
Jqa2
(
6
,
2
);
MatrixXd
JVS
,
JVS_wpseudo
,
sigmaVS
;
task_vs
(
JVS
,
JVS_wpseudo
,
sigmaVS
);
// 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);
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
;
this
->
ctrl_params_
.
vs_vel
=
Jqa1_wpseudo
*
sigmaVS
;
// task velocity
this
->
ctrl_params_
.
vs_vel
=
JVS_wpseudo
*
sigmaVS
;
// TASK: CoG alignement ______________________________________
// TASK: CoG alignement ______________________________________
// Null space projector
// Null space projector
MatrixXd
Nqa1
=
(
eye
-
(
Jqa1_wpseudo
*
Jqa1
));
MatrixXd
eye
=
MatrixXd
::
Identity
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
MatrixXd
Nqa1
=
(
eye
-
(
JVS_wpseudo
*
JVS
));
// task Jacobian and sigma
// task Jacobian and sigma
MatrixXd
JG
,
JG_pseudo
,
sigmaG
;
MatrixXd
JG
,
JG_pseudo
,
sigmaG
;
...
@@ -249,14 +237,14 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
...
@@ -249,14 +237,14 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
// Third control task (Joint limits) ________________________
// Third control task (Joint limits) ________________________
// Augmented null space projector from Augmented Jacobian
// Augmented null space projector from Augmented Jacobian
MatrixXd
J
qa1
_G
=
MatrixXd
::
Zero
(
J
qa1
.
rows
()
+
JG
.
rows
(),
J
qa1
.
cols
());
MatrixXd
J
VS
_G
=
MatrixXd
::
Zero
(
J
VS
.
rows
()
+
JG
.
rows
(),
J
VS
.
cols
());
J
qa1
_G
.
block
(
0
,
0
,
J
qa1
.
rows
(),
J
qa1
.
cols
())
=
J
qa1
;
J
VS
_G
.
block
(
0
,
0
,
J
VS
.
rows
(),
J
VS
.
cols
())
=
J
VS
;
J
qa1
_G
.
block
(
J
qa1
.
rows
()
-
1
,
0
,
JG
.
rows
(),
JG
.
cols
())
=
JG
;
J
VS
_G
.
block
(
J
VS
.
rows
()
-
1
,
0
,
JG
.
rows
(),
JG
.
cols
())
=
JG
;
MatrixXd
Nqa1_G
=
MatrixXd
::
Zero
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
MatrixXd
Nqa1_G
=
MatrixXd
::
Zero
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
MatrixXd
J
qa1
_G_pseudo
=
calcPinv
(
J
qa1
_G
);
MatrixXd
J
VS
_G_pseudo
=
calcPinv
(
J
VS
_G
);
// Third task after secondary aligning CoG
// Third task after secondary aligning CoG
Nqa1_G
=
(
eye
-
(
J
qa1
_G_pseudo
*
J
qa1
_G
));
Nqa1_G
=
(
eye
-
(
J
VS
_G_pseudo
*
J
VS
_G
));
//Nqa1_G = Nqa1; // Third task as secondary
//Nqa1_G = Nqa1; // Third task as secondary
// task Jacobian and sigma
// task Jacobian and sigma
...
@@ -298,9 +286,26 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
...
@@ -298,9 +286,26 @@ void CQuadarm_Task_Priority_Ctrl::qa_control(){
this
->
vel_
.
quadarm
.
block
(
0
,
0
,
3
,
1
)
=
Vtotal
.
block
(
0
,
0
,
3
,
1
);
this
->
vel_
.
quadarm
.
block
(
0
,
0
,
3
,
1
)
=
Vtotal
.
block
(
0
,
0
,
3
,
1
);
this
->
vel_
.
quadarm
.
block
(
5
,
0
,
1
+
this
->
arm_
.
nj
,
1
)
=
Vtotal
.
block
(
3
,
0
,
1
+
this
->
arm_
.
nj
,
1
);
this
->
vel_
.
quadarm
.
block
(
5
,
0
,
1
+
this
->
arm_
.
nj
,
1
)
=
Vtotal
.
block
(
3
,
0
,
1
+
this
->
arm_
.
nj
,
1
);
}
}
void
CQuadarm_Task_Priority_Ctrl
::
task_vs
(
MatrixXd
&
J
qa1
,
MatrixXd
&
J
qa1_w
pseudo
,
MatrixXd
&
sigmaVS
)
void
CQuadarm_Task_Priority_Ctrl
::
task_vs
(
MatrixXd
&
J
VS
,
MatrixXd
&
J
VS_
pseudo
,
MatrixXd
&
sigmaVS
)
{
{
// 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
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
=
MatrixXd
::
Identity
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
// task jacobian
JVS
=
Jqa1
;
// task jacobian pseudo inverse
//JVS_pseudo = calcPinv(Jqa1);
JVS_pseudo
=
weight_jacvs_inverse
(
Jqa1
);
// task velocity vector
sigmaVS
=
this
->
vel_
.
cam
-
Jqa2
*
this
->
ctrl_params_
.
v_rollpitch
;
}
}
void
CQuadarm_Task_Priority_Ctrl
::
task_infrad
(
MatrixXd
&
JIR
,
MatrixXd
&
JIR_pseudo
,
MatrixXd
&
sigmaIR
)
void
CQuadarm_Task_Priority_Ctrl
::
task_infrad
(
MatrixXd
&
JIR
,
MatrixXd
&
JIR_pseudo
,
MatrixXd
&
sigmaIR
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/quadarm_task_priority_ctrl.h
+
1
−
1
View file @
dda9c08d
...
@@ -177,7 +177,7 @@ class CQuadarm_Task_Priority_Ctrl
...
@@ -177,7 +177,7 @@ class CQuadarm_Task_Priority_Ctrl
* Compute vector and jacobians of the task corresponding to the visual servoing.
* Compute vector and jacobians of the task corresponding to the visual servoing.
*
*
*/
*/
void
task_vs
(
MatrixXd
&
J
qa1
,
MatrixXd
&
J
qa1_w
pseudo
,
MatrixXd
&
sigmaVS
);
void
task_vs
(
MatrixXd
&
J
VS
,
MatrixXd
&
J
VS_
pseudo
,
MatrixXd
&
sigmaVS
);
/**
/**
* \brief Task: Security inflation radius
* \brief Task: Security inflation radius
...
...
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