Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
master project
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joschua Gosda
master project
Commits
e6646cff
Commit
e6646cff
authored
3 years ago
by
Joschua Gosda
Browse files
Options
Downloads
Patches
Plain Diff
extended code by blending function, needs testing whether working correctly
parent
60e613ff
Branches
Branches containing commit
No related tags found
1 merge request
!2
Cleanup
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
c++/include/yumi.hpp
+6
-0
6 additions, 0 deletions
c++/include/yumi.hpp
c++/src/py2gpmbind.cpp
+1
-0
1 addition, 0 deletions
c++/src/py2gpmbind.cpp
c++/src/yumi.cpp
+22
-1
22 additions, 1 deletion
c++/src/yumi.cpp
with
29 additions
and
1 deletion
c++/include/yumi.hpp
+
6
−
0
View file @
e6646cff
...
...
@@ -26,6 +26,7 @@ class Yumi {
void
set_kp
(
double
kp
);
void
set_operationPoint
(
double
op
);
void
set_hybridControl
(
bool
hybridControl
);
void
set_transitionTime
(
double
transitionTime
);
void
process
();
...
...
@@ -54,6 +55,10 @@ class Yumi {
// gain for control
double
m_kp
=
1.0
;
// time for transition between position control to force control in the wires axis
double
m_transitionTime
=
0.0
;
double
m_deltaTime
=
0.0
;
// vars to store configuration
rl
::
math
::
Vector3
m_desPosition
=
rl
::
math
::
Vector3
::
Zero
();
rl
::
math
::
Vector3
m_desPositionDot
=
rl
::
math
::
Vector3
::
Zero
();
...
...
@@ -84,6 +89,7 @@ class Yumi {
Eigen
::
Matrix3d
euler2rotMatrix
(
rl
::
math
::
Vector3
orientation
);
void
compTaskSpaceInput
();
void
compForce2VelocityController
();
void
modifySelectionMatrix
();
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
c++/src/py2gpmbind.cpp
+
1
−
0
View file @
e6646cff
...
...
@@ -21,5 +21,6 @@ PYBIND11_MODULE(invKin, m) {
.
def
(
"set_kp"
,
&
Yumi
::
set_kp
)
.
def
(
"set_operationPoint"
,
&
Yumi
::
set_operationPoint
)
.
def
(
"set_hybridControl"
,
&
Yumi
::
set_hybridControl
)
.
def
(
"set_transitionTime"
,
&
Yumi
::
set_transitionTime
)
.
def
(
"set_force"
,
&
Yumi
::
set_force
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
c++/src/yumi.cpp
+
22
−
1
View file @
e6646cff
...
...
@@ -86,6 +86,7 @@ void Yumi::compTaskSpaceInput(){
void
Yumi
::
process
(){
doForwardKinematics
();
modifySelectionMatrix
();
compForce2VelocityController
();
compTaskSpaceInput
();
...
...
@@ -123,6 +124,7 @@ void Yumi::compForce2VelocityController(){
// have a look at chosen ee frame in RS
velocityEE
<<
0
,
m_force
-
m_forceOP
,
0
;
velocityEE
*=
m_kp
;
velocityEE
=
(
Eigen
::
Matrix3d
::
Identity
()
-
m_selectVelMatrix
)
*
velocityEE
;
// perform blending - transition from position control to force control
// transform the velocities computed in the ee frame to the world frame
m_forceTaskSpaceInput
=
m_rotationMatrix
.
transpose
()
*
velocityEE
;
}
...
...
@@ -143,9 +145,28 @@ void Yumi::set_hybridControl(bool hybridControl){
0
,
0
,
0
,
0
,
0
,
1
;
}
else
{
}
else
{
// position control
m_selectVelMatrix
=
Eigen
::
Matrix3d
::
Identity
();
m_deltaTime
=
0.0
;
// reset variable to apply blending when changing to hybrid control again
}
}
m_hybridControl
=
hybridControl
;
}
void
Yumi
::
set_transitionTime
(
double
transitionTime
){
m_transitionTime
=
transitionTime
;
}
void
Yumi
::
modifySelectionMatrix
(){
Eigen
::
Matrix3d
blendingMatrix
;
if
(
m_deltaTime
<
m_transitionTime
){
m_deltaTime
+=
1.0
/
m_sampleTime
;
blendingMatrix
<<
0
,
0
,
0
,
0
,
(
1
-
m_deltaTime
/
m_transitionTime
),
0
,
0
,
0
,
0
;
}
else
{
blendingMatrix
=
Eigen
::
Matrix3d
::
Zero
();
}
m_selectVelMatrix
+=
blendingMatrix
;
}
\ No newline at end of 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