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
cf889b7a
Commit
cf889b7a
authored
9 years ago
by
asantamaria
Browse files
Options
Downloads
Patches
Plain Diff
minor changes to add obstacle avoidance simulation
parent
40b78021
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/quadarm_task_priority_ctrl.cpp
+16
-9
16 additions, 9 deletions
src/quadarm_task_priority_ctrl.cpp
src/quadarm_task_priority_ctrl.h
+2
-2
2 additions, 2 deletions
src/quadarm_task_priority_ctrl.h
with
18 additions
and
11 deletions
src/quadarm_task_priority_ctrl.cpp
+
16
−
9
View file @
cf889b7a
...
@@ -16,7 +16,7 @@ CQuadarm_Task_Priority_Ctrl::~CQuadarm_Task_Priority_Ctrl()
...
@@ -16,7 +16,7 @@ CQuadarm_Task_Priority_Ctrl::~CQuadarm_Task_Priority_Ctrl()
}
}
// Main public function
// Main public function
void
CQuadarm_Task_Priority_Ctrl
::
quadarm_task_priority_ctrl
(
const
double
&
quad_height
,
void
CQuadarm_Task_Priority_Ctrl
::
quadarm_task_priority_ctrl
(
const
MatrixXd
&
quad_dist_obs
,
const
goal_obj
&
goal
,
const
goal_obj
&
goal
,
ht
&
HT
,
ht
&
HT
,
arm
&
arm
,
arm
&
arm
,
...
@@ -27,7 +27,7 @@ void CQuadarm_Task_Priority_Ctrl::quadarm_task_priority_ctrl(const double& quad_
...
@@ -27,7 +27,7 @@ void CQuadarm_Task_Priority_Ctrl::quadarm_task_priority_ctrl(const double& quad_
{
{
// Current quadrotor height
// Current quadrotor height
this
->
quad_
height
_
=
quad_
height
;
this
->
quad_
dist_obs
_
=
quad_
dist_obs
;
// Goal related objects
// Goal related objects
this
->
cam_vel_
=
goal
.
cam_vel
;
this
->
cam_vel_
=
goal
.
cam_vel
;
...
@@ -330,8 +330,7 @@ void CQuadarm_Task_Priority_Ctrl::uam_control(){
...
@@ -330,8 +330,7 @@ void CQuadarm_Task_Priority_Ctrl::uam_control(){
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
)
{
{
// Distance to the obstacle (currently detecting only the ground)
// Distance to the obstacle (currently detecting only the ground)
MatrixXd
d_obs
=
MatrixXd
::
Zero
(
3
,
1
);
MatrixXd
d_obs
=
this
->
quad_dist_obs_
;
d_obs
(
2
,
0
)
=
this
->
quad_height_
;
// Inflation radius
// Inflation radius
MatrixXd
inf_radius
=
MatrixXd
::
Zero
(
1
,
1
);
MatrixXd
inf_radius
=
MatrixXd
::
Zero
(
1
,
1
);
...
@@ -339,7 +338,8 @@ void CQuadarm_Task_Priority_Ctrl::task_infrad(MatrixXd& JIR,MatrixXd& JIR_pseudo
...
@@ -339,7 +338,8 @@ void CQuadarm_Task_Priority_Ctrl::task_infrad(MatrixXd& JIR,MatrixXd& JIR_pseudo
// Task vector
// Task vector
Eigen
::
MatrixXd
euc_d_obs
=
(
d_obs
.
transpose
()
*
d_obs
).
array
().
sqrt
();
Eigen
::
MatrixXd
euc_d_obs
=
(
d_obs
.
transpose
()
*
d_obs
).
array
().
sqrt
();
sigmaIR
=
inf_radius
-
euc_d_obs
;
// sigmaIR = inf_radius-euc_d_obs;
sigmaIR
=
euc_d_obs
-
inf_radius
;
// Task Jacobian
// Task Jacobian
JIR
=
MatrixXd
::
Zero
(
1
,
4
+
this
->
arm_
.
nj
);
JIR
=
MatrixXd
::
Zero
(
1
,
4
+
this
->
arm_
.
nj
);
...
@@ -349,12 +349,19 @@ void CQuadarm_Task_Priority_Ctrl::task_infrad(MatrixXd& JIR,MatrixXd& JIR_pseudo
...
@@ -349,12 +349,19 @@ void CQuadarm_Task_Priority_Ctrl::task_infrad(MatrixXd& JIR,MatrixXd& JIR_pseudo
// Bloquing matrix
// Bloquing matrix
MatrixXd
H
=
MatrixXd
::
Zero
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
MatrixXd
H
=
MatrixXd
::
Zero
(
4
+
this
->
arm_
.
nj
,
4
+
this
->
arm_
.
nj
);
for
(
unsigned
int
ii
=
0
;
ii
<
3
;
++
ii
)
// Euclidean distance to the obstacle
if
(
d_obs
(
ii
,
0
)
<
inf_radius
(
0
,
0
)
&&
d_obs
(
ii
,
0
)
>
0.0
)
// if (sqrt(pow(d_obs(0,0),2)+pow(d_obs(1,0),2)+pow(d_obs(2,0),2))<inf_radius(0,0))
// {
// DOF to block
for
(
unsigned
int
ii
=
0
;
ii
<
3
;
++
ii
)
{
{
cout
<<
"WARNING!! Inflation Radius violation. DOF: "
<<
ii
<<
" Inf. radius: "
<<
inf_radius
(
0
,
0
)
<<
" Obstacle distance: "
<<
d_obs
(
ii
,
0
)
<<
endl
;
if
(
d_obs
(
ii
,
0
)
<
inf_radius
(
0
,
0
)
&&
d_obs
(
ii
,
0
)
>
0.0
)
H
(
ii
,
ii
)
=
1.0
;
{
cout
<<
"WARNING!! Inflation Radius violation. DOF: "
<<
ii
<<
" Inf. radius: "
<<
inf_radius
(
0
,
0
)
<<
" Obstacle distance: "
<<
d_obs
(
ii
,
0
)
<<
endl
;
H
(
ii
,
ii
)
=
1.0
;
}
}
}
// }
MatrixXd
Hinv
=
calcPinv
(
H
);
MatrixXd
Hinv
=
calcPinv
(
H
);
...
...
This diff is collapsed.
Click to expand it.
src/quadarm_task_priority_ctrl.h
+
2
−
2
View file @
cf889b7a
...
@@ -140,7 +140,7 @@ class CQuadarm_Task_Priority_Ctrl
...
@@ -140,7 +140,7 @@ class CQuadarm_Task_Priority_Ctrl
double
target_dist_
;
// Euclidean distance to target.
double
target_dist_
;
// Euclidean distance to target.
double
quad_height_
;
// Quadrotor ground distanc
e.
MatrixXd
quad_dist_obs_
;
// Quadrotor distance to obstacl
e.
string
datetime_
;
// Initial date and time.
string
datetime_
;
// Initial date and time.
...
@@ -281,7 +281,7 @@ class CQuadarm_Task_Priority_Ctrl
...
@@ -281,7 +281,7 @@ class CQuadarm_Task_Priority_Ctrl
* Main public function call of Quadarm Task Priority Control.
* Main public function call of Quadarm Task Priority Control.
*
*
*/
*/
void
quadarm_task_priority_ctrl
(
const
double
&
quad_height
,
void
quadarm_task_priority_ctrl
(
const
MatrixXd
&
quad_dist_obs
,
const
goal_obj
&
goal
,
const
goal_obj
&
goal
,
ht
&
HT
,
ht
&
HT
,
arm
&
arm
,
arm
&
arm
,
...
...
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