Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
RobotAPI
Commits
704fba38
Commit
704fba38
authored
6 years ago
by
Fabian Paus
Browse files
Options
Downloads
Patches
Plain Diff
Prevent division by zero in carteisian velocity controller
parent
6f97f9b5
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
source/RobotAPI/libraries/core/CartesianPositionController.cpp
+2
-1
2 additions, 1 deletion
...e/RobotAPI/libraries/core/CartesianPositionController.cpp
source/RobotAPI/libraries/core/CartesianVelocityController.cpp
+7
-2
7 additions, 2 deletions
...e/RobotAPI/libraries/core/CartesianVelocityController.cpp
with
9 additions
and
3 deletions
source/RobotAPI/libraries/core/CartesianPositionController.cpp
+
2
−
1
View file @
704fba38
...
...
@@ -41,7 +41,8 @@ Eigen::VectorXf CartesianPositionController::calculate(const Eigen::Matrix4f& ta
if
(
posLen
)
{
Eigen
::
Vector3f
targetPos
=
targetPose
.
block
<
3
,
1
>
(
0
,
3
);
Eigen
::
Vector3f
errPos
=
targetPos
-
tcp
->
getPositionInRootFrame
();
Eigen
::
Vector3f
currentPos
=
tcp
->
getPositionInRootFrame
();
Eigen
::
Vector3f
errPos
=
targetPos
-
currentPos
;
Eigen
::
Vector3f
posVel
=
errPos
*
KpPos
;
if
(
maxPosVel
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/core/CartesianVelocityController.cpp
+
7
−
2
View file @
704fba38
...
...
@@ -69,7 +69,12 @@ Eigen::VectorXf CartesianVelocityController::calculate(const Eigen::VectorXf& ca
Eigen
::
VectorXf
nsv
=
Eigen
::
VectorXf
::
Zero
(
nullspace
.
rows
());
for
(
int
i
=
0
;
i
<
nullspace
.
cols
();
i
++
)
{
nsv
+=
nullspace
.
col
(
i
)
*
nullspace
.
col
(
i
).
dot
(
nullspaceVel
)
/
nullspace
.
col
(
i
).
squaredNorm
();
float
squaredNorm
=
nullspace
.
col
(
i
).
squaredNorm
();
// Prevent division by zero
if
(
squaredNorm
>
1.0e-32
f
)
{
nsv
+=
nullspace
.
col
(
i
)
*
nullspace
.
col
(
i
).
dot
(
nullspaceVel
)
/
nullspace
.
col
(
i
).
squaredNorm
();
}
}
// Eigen::VectorXf nsv = nullspace * nullspaceVel;
...
...
@@ -178,7 +183,7 @@ bool CartesianVelocityController::adjustJacobiForJointsAtJointLimits(VirtualRobo
if
(
node
->
isLimitless
()
||
// limitless joint cannot be out of limits
std
::
abs
(
jointVel
(
i
))
<
0.001
f
// If it the jacobi doesnt want this joint to move anyway, there is no point in recalculating the inverse jacobi
)
)
{
continue
;
}
...
...
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