Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Simox
Commits
7d160cea
Commit
7d160cea
authored
7 years ago
by
Simon Ottenhaus
Browse files
Options
Downloads
Patches
Plain Diff
improved teast and added test comments
parent
cb5edb3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VirtualRobot/tests/VirtualRobotJacobianTest.cpp
+45
-18
45 additions, 18 deletions
VirtualRobot/tests/VirtualRobotJacobianTest.cpp
with
45 additions
and
18 deletions
VirtualRobot/tests/VirtualRobotJacobianTest.cpp
+
45
−
18
View file @
7d160cea
...
...
@@ -115,26 +115,53 @@ BOOST_AUTO_TEST_CASE(testJacobianRadianToMMfactor)
BOOST_REQUIRE
(
fileOK
);
RobotPtr
robot
=
RobotIO
::
loadRobot
(
filename
);
std
::
cout
<<
"robot loaded"
<<
std
::
endl
;
RobotNodeSetPtr
rns
=
robot
->
getRobotNodeSet
(
"RightArm"
);
//Eigen::VectorXf vel(6);
//vel << 1, 0, 0, 1, 0, 0;
VirtualRobot
::
DifferentialIK
ik
(
rns
,
RobotNodePtr
(),
JacobiProvider
::
eSVDDamped
);
ik
.
setRadianToMMfactor
(
10
);
Eigen
::
MatrixXf
jacobi
=
ik
.
getJacobianMatrix
(
rns
->
getTCP
());
Eigen
::
MatrixXf
invjac
=
ik
.
computePseudoInverseJacobianMatrix
(
jacobi
);
//std::cout << jacobi << std::endl;
//std::cout << invjac << std::endl;
//Eigen::VectorXf radVel = invjac * vel;
//std::cout << radVel << std::endl;
//Eigen::VectorXf check = jacobi * radVel;
//std::cout << check << std::endl;
std
::
cout
<<
jacobi
*
invjac
<<
std
::
endl
;
std
::
cout
<<
"robot loaded"
<<
std
::
endl
;
{
robot
->
setRadianToMMfactor
(
1
);
VirtualRobot
::
DifferentialIK
ik
(
rns
,
RobotNodePtr
(),
JacobiProvider
::
eSVDDamped
);
Eigen
::
MatrixXf
jacobi
=
ik
.
getJacobianMatrix
(
rns
->
getTCP
());
Eigen
::
MatrixXf
invjac
=
ik
.
computePseudoInverseJacobianMatrix
(
jacobi
);
Eigen
::
MatrixXf
test
=
jacobi
*
invjac
;
std
::
cout
<<
test
<<
std
::
endl
;
float
error
=
(
test
-
Eigen
::
MatrixXf
::
Identity
(
6
,
6
)).
squaredNorm
();
std
::
cout
<<
"error: "
<<
error
<<
std
::
endl
;
//check that error is big for SVDDamped when radians are not scaled up
BOOST_CHECK_GE
(
error
,
0.1
);
}
{
robot
->
setRadianToMMfactor
(
10
);
VirtualRobot
::
DifferentialIK
ik
(
rns
,
RobotNodePtr
(),
JacobiProvider
::
eSVDDamped
);
Eigen
::
MatrixXf
jacobi
=
ik
.
getJacobianMatrix
(
rns
->
getTCP
());
Eigen
::
MatrixXf
invjac
=
ik
.
computePseudoInverseJacobianMatrix
(
jacobi
);
Eigen
::
MatrixXf
test
=
jacobi
*
invjac
;
std
::
cout
<<
test
<<
std
::
endl
;
float
error
=
(
test
-
Eigen
::
MatrixXf
::
Identity
(
6
,
6
)).
squaredNorm
();
std
::
cout
<<
"error: "
<<
error
<<
std
::
endl
;
//check that error is small when radians are scaled up
BOOST_CHECK_LE
(
error
,
0.01
);
//check that error is still existant for SVDDamped
BOOST_CHECK_GE
(
error
,
1e-6
);
}
{
robot
->
setRadianToMMfactor
(
10
);
VirtualRobot
::
DifferentialIK
ik
(
rns
,
RobotNodePtr
(),
JacobiProvider
::
eSVD
);
Eigen
::
MatrixXf
jacobi
=
ik
.
getJacobianMatrix
(
rns
->
getTCP
());
Eigen
::
MatrixXf
invjac
=
ik
.
computePseudoInverseJacobianMatrix
(
jacobi
);
Eigen
::
MatrixXf
test
=
jacobi
*
invjac
;
std
::
cout
<<
test
<<
std
::
endl
;
float
error
=
(
test
-
Eigen
::
MatrixXf
::
Identity
(
6
,
6
)).
squaredNorm
();
std
::
cout
<<
"error: "
<<
error
<<
std
::
endl
;
//check that error is very small for SVD
BOOST_CHECK_LE
(
error
,
0.01
);
}
}
BOOST_AUTO_TEST_SUITE_END
()
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