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
fc632cdd
Commit
fc632cdd
authored
10 years ago
by
asantamaria
Browse files
Options
Downloads
Patches
Plain Diff
simplified input vars
parent
9df0591b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CMakeLists.txt
+6
-4
6 additions, 4 deletions
src/CMakeLists.txt
src/quadarm_task_priority_ctrl.cpp
+25
-16
25 additions, 16 deletions
src/quadarm_task_priority_ctrl.cpp
src/quadarm_task_priority_ctrl.h
+12
-10
12 additions, 10 deletions
src/quadarm_task_priority_ctrl.h
with
43 additions
and
30 deletions
src/CMakeLists.txt
+
6
−
4
View file @
fc632cdd
...
@@ -7,10 +7,11 @@ SET(headers quadarm_task_priority_ctrl.h)
...
@@ -7,10 +7,11 @@ SET(headers quadarm_task_priority_ctrl.h)
# locate the necessary dependencies
# locate the necessary dependencies
# KDL #########
# KDL #########
INCLUDE
(
${
PROJECT_SOURCE_DIR
}
/FindPkgConfig.cmake
)
#INCLUDE (${PROJECT_SOURCE_DIR}/FindPkgConfig.cmake)
SET
(
KDL_INSTALL
${
CMAKE_INSTALL_PREFIX
}
CACHE PATH
"The KDL installation directory."
)
#SET( KDL_INSTALL ${CMAKE_INSTALL_PREFIX} CACHE PATH "The KDL installation directory.")
INCLUDE
(
${
PROJECT_SOURCE_DIR
}
/FindKDL.cmake
)
#INCLUDE (${PROJECT_SOURCE_DIR}/FindKDL.cmake)
find_package
(
Orocos-KDL REQUIRED
)
# Boost #######
# Boost #######
set
(
Boost_USE_STATIC_LIBS ON
)
set
(
Boost_USE_STATIC_LIBS ON
)
...
@@ -27,6 +28,7 @@ INCLUDE_DIRECTORIES(. ${EIGEN_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
...
@@ -27,6 +28,7 @@ INCLUDE_DIRECTORIES(. ${EIGEN_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
# create the shared library
# create the shared library
ADD_LIBRARY
(
quadarm_task_priority_ctrl SHARED
${
sources
}
)
ADD_LIBRARY
(
quadarm_task_priority_ctrl SHARED
${
sources
}
)
#TARGET_LINK_LIBRARIES(quadarm_task_priority_ctrl ${EIGEN_LIBRARY} ${Boost_LIBRARIES} orocos-kdl)
TARGET_LINK_LIBRARIES
(
quadarm_task_priority_ctrl
${
EIGEN_LIBRARY
}
${
Boost_LIBRARIES
}
)
TARGET_LINK_LIBRARIES
(
quadarm_task_priority_ctrl
${
EIGEN_LIBRARY
}
${
Boost_LIBRARIES
}
)
...
...
This diff is collapsed.
Click to expand it.
src/quadarm_task_priority_ctrl.cpp
+
25
−
16
View file @
fc632cdd
...
@@ -13,24 +13,32 @@ CQuadarm_Task_Priority_Ctrl::~CQuadarm_Task_Priority_Ctrl()
...
@@ -13,24 +13,32 @@ CQuadarm_Task_Priority_Ctrl::~CQuadarm_Task_Priority_Ctrl()
{
{
}
}
void
CQuadarm_Task_Priority_Ctrl
::
quadarm_task_priority_ctrl
(
const
MatrixXd
&
cam_vel
,
/*void CQuadarm_Task_Priority_Ctrl::quadarm_task_priority_ctrl(const goal_obj& goal,
const
Matrix4d
&
Tcam_in_tip
,
const ht& HT,
const
Matrix4d
&
Ttag_in_cam
,
const Chain& kdl_chain,
const
double
&
target_dist
,
const
Chain
&
kdl_chain
,
const vector<arm_joint> joint_info,
const vector<arm_joint> joint_info,
ctrl_params& ctrl_params,
ctrl_params& ctrl_params,
MatrixXd
&
joint_pos
,
MatrixXd& joint_pos,
MatrixXd
&
robot_vels
)
MatrixXd& robot_vels)*/
void
CQuadarm_Task_Priority_Ctrl
::
quadarm_task_priority_ctrl
(
const
goal_obj
&
goal
,
const
ht
&
HT
,
const
arm
&
arm
,
ctrl_params
&
ctrl_params
,
MatrixXd
&
joint_pos
,
MatrixXd
&
robot_vel
)
{
{
this
->
vel_
.
cam
=
cam_vel
;
// Goal related objects
this
->
T_
.
cam_in_tip
=
Tcam_in_tip
;
this
->
vel_
.
cam
=
goal
.
cam_vel
;
this
->
T_
.
tag_in_cam
=
Ttag_in_cam
;
this
->
target_dist_
=
goal
.
target_dist
;
this
->
arm_
.
chain
=
kdl_chain
;
// Homogeneous transformations
this
->
arm_
.
joint_info
=
joint_info
;
this
->
T_
=
HT
;
this
->
arm_
.
jnt_pos
=
joint_pos
;
// Control parameters
this
->
target_dist_
=
target_dist
;
this
->
ctrl_params_
=
ctrl_params
;
this
->
ctrl_params_
=
ctrl_params
;
// Arm data
this
->
arm_
.
chain
=
arm
.
chain
;
this
->
arm_
.
joint_info
=
arm
.
joint_info
;
this
->
arm_
.
jnt_pos
=
arm
.
jnt_pos
;
// Arm DOFs
// Arm DOFs
this
->
arm_
.
nj
=
this
->
arm_
.
chain
.
getNrOfJoints
();
this
->
arm_
.
nj
=
this
->
arm_
.
chain
.
getNrOfJoints
();
...
@@ -42,10 +50,11 @@ void CQuadarm_Task_Priority_Ctrl::quadarm_task_priority_ctrl(const MatrixXd& cam
...
@@ -42,10 +50,11 @@ void CQuadarm_Task_Priority_Ctrl::quadarm_task_priority_ctrl(const MatrixXd& cam
this
->
arm_
.
jnt_pos
.
block
(
6
,
0
,
this
->
arm_
.
nj
,
1
)
=
this
->
arm_
.
jnt_pos
.
block
(
6
,
0
,
this
->
arm_
.
nj
,
1
)
+
(
this
->
vel_
.
quadarm
.
block
(
6
,
0
,
this
->
arm_
.
nj
,
1
)
*
this
->
ctrl_params_
.
dt
);
this
->
arm_
.
jnt_pos
.
block
(
6
,
0
,
this
->
arm_
.
nj
,
1
)
=
this
->
arm_
.
jnt_pos
.
block
(
6
,
0
,
this
->
arm_
.
nj
,
1
)
+
(
this
->
vel_
.
quadarm
.
block
(
6
,
0
,
this
->
arm_
.
nj
,
1
)
*
this
->
ctrl_params_
.
dt
);
// Quadrotor positions increment
// Quadrotor positions increment
this
->
arm_
.
jnt_pos
.
block
(
0
,
0
,
6
,
1
)
=
this
->
arm_
.
jnt_pos
.
block
(
0
,
0
,
6
,
1
)
+
(
this
->
vel_
.
quadarm
.
block
(
0
,
0
,
6
,
1
)
*
this
->
ctrl_params_
.
dt
);
this
->
arm_
.
jnt_pos
.
block
(
0
,
0
,
6
,
1
)
=
this
->
arm_
.
jnt_pos
.
block
(
0
,
0
,
6
,
1
)
+
(
this
->
vel_
.
quadarm
.
block
(
0
,
0
,
6
,
1
)
*
this
->
ctrl_params_
.
dt
);
// return values
// return values
ctrl_params
=
this
->
ctrl_params_
;
ctrl_params
=
this
->
ctrl_params_
;
joint_pos
=
this
->
arm_
.
jnt_pos
;
joint_pos
=
this
->
arm_
.
jnt_pos
;
robot_vel
s
=
this
->
vel_
.
quadarm
;
robot_vel
=
this
->
vel_
.
quadarm
;
}
}
void
CQuadarm_Task_Priority_Ctrl
::
qa_kinematics
(){
void
CQuadarm_Task_Priority_Ctrl
::
qa_kinematics
(){
...
@@ -873,4 +882,4 @@ void CQuadarm_Task_Priority_Ctrl::write_to_file(const string& folder_name, const
...
@@ -873,4 +882,4 @@ void CQuadarm_Task_Priority_Ctrl::write_to_file(const string& folder_name, const
File
<<
data
(
data
.
rows
()
-
1
,
data
.
cols
()
-
1
);
File
<<
data
(
data
.
rows
()
-
1
,
data
.
cols
()
-
1
);
File
<<
"
\n
"
;
File
<<
"
\n
"
;
File
.
close
();
File
.
close
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/quadarm_task_priority_ctrl.h
+
12
−
10
View file @
fc632cdd
...
@@ -35,7 +35,13 @@ using namespace Eigen;
...
@@ -35,7 +35,13 @@ using namespace Eigen;
using
namespace
KDL
;
using
namespace
KDL
;
using
namespace
std
;
using
namespace
std
;
// Homogenous Transforms
// Goal related objects
typedef
struct
{
MatrixXd
cam_vel
;
// Desired camera velocity (end-effector)
double
target_dist
;
// Target distance
}
goal_obj
;
// Homogeneous Transforms
typedef
struct
{
typedef
struct
{
Matrix4d
tag_in_cam
;
// Tag in camera frames.
Matrix4d
tag_in_cam
;
// Tag in camera frames.
Matrix4d
tag_in_baselink
;
// Tag in base_link frames.
Matrix4d
tag_in_baselink
;
// Tag in base_link frames.
...
@@ -273,16 +279,12 @@ class CQuadarm_Task_Priority_Ctrl
...
@@ -273,16 +279,12 @@ 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
MatrixXd
&
cam_vel
,
void
quadarm_task_priority_ctrl
(
const
goal_obj
&
goal
,
const
Matrix4d
&
Tcam_in_tip
,
const
ht
&
HT
,
const
Matrix4d
&
Ttag_in_cam
,
const
arm
&
arm
,
const
double
&
target_dist
,
const
Chain
&
kdl_chain
,
const
vector
<
arm_joint
>
joint_info
,
ctrl_params
&
ctrl_params
,
ctrl_params
&
ctrl_params
,
MatrixXd
&
joint_pos
,
MatrixXd
&
joint_pos
,
MatrixXd
&
joint_vels
);
MatrixXd
&
robot_vel
);
/**
/**
* \brief Write to file
* \brief Write to file
...
...
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