Navigation Menu

Skip to content

Commit

Permalink
Added changes to KDL brought after the SVN merge, where applicable
Browse files Browse the repository at this point in the history
Taken from commits 470880e, df4c99f, cd0ae20, efb0823, c519989
  • Loading branch information
yorikvanhavre committed Oct 14, 2015
1 parent 9304f7a commit ba2e003
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Robot/App/kdl_cp/chaindynparam.hpp
Expand Up @@ -57,7 +57,7 @@ namespace KDL {
const Chain chain;
int nr;
unsigned int nj;
unsigned int ns;
unsigned int ns;
Vector grav;
Vector vectornull;
JntArray jntarraynull;
Expand Down
6 changes: 6 additions & 0 deletions src/Mod/Robot/App/kdl_cp/chainiksolvervel_pinv_nso.hpp
Expand Up @@ -28,6 +28,10 @@

namespace KDL
{

// FIXME: seems this class is unused/unmaintained/unfinished for several years
// it supposed to be either fixer or removed

/**
* Implementation of a inverse velocity kinematics algorithm based
* on the generalize pseudo inverse to calculate the velocity
Expand Down Expand Up @@ -60,6 +64,8 @@ namespace KDL
* @param alpha the null-space velocity gain
*
*/

// FIXME: alpha is int but is initialized with a float value.
ChainIkSolverVel_pinv_nso(const Chain& chain, JntArray opt_pos, JntArray weights, double eps=0.00001,int maxiter=150, double alpha = 0.25);
explicit ChainIkSolverVel_pinv_nso(const Chain& chain, double eps=0.00001,int maxiter=150, double alpha = 0.25);
~ChainIkSolverVel_pinv_nso();
Expand Down
24 changes: 12 additions & 12 deletions src/Mod/Robot/App/kdl_cp/frameacc.hpp
Expand Up @@ -45,18 +45,18 @@ class FrameAcc;
class RotationAcc;
class VectorAcc;

IMETHOD bool Equal(const FrameAcc& r1,const FrameAcc& r2,double eps=epsilon);
IMETHOD bool Equal(const Frame& r1,const FrameAcc& r2,double eps=epsilon);
IMETHOD bool Equal(const FrameAcc& r1,const Frame& r2,double eps=epsilon);
IMETHOD bool Equal(const RotationAcc& r1,const RotationAcc& r2,double eps=epsilon);
IMETHOD bool Equal(const Rotation& r1,const RotationAcc& r2,double eps=epsilon);
IMETHOD bool Equal(const RotationAcc& r1,const Rotation& r2,double eps=epsilon);
IMETHOD bool Equal(const TwistAcc& a,const TwistAcc& b,double eps=epsilon);
IMETHOD bool Equal(const Twist& a,const TwistAcc& b,double eps=epsilon);
IMETHOD bool Equal(const TwistAcc& a,const Twist& b,double eps=epsilon);
IMETHOD bool Equal(const VectorAcc& r1,const VectorAcc& r2,double eps=epsilon);
IMETHOD bool Equal(const Vector& r1,const VectorAcc& r2,double eps=epsilon);
IMETHOD bool Equal(const VectorAcc& r1,const Vector& r2,double eps=epsilon);
IMETHOD bool Equal(const FrameAcc& r1,const FrameAcc& r2,double eps);
IMETHOD bool Equal(const Frame& r1,const FrameAcc& r2,double eps);
IMETHOD bool Equal(const FrameAcc& r1,const Frame& r2,double eps);
IMETHOD bool Equal(const RotationAcc& r1,const RotationAcc& r2,double eps);
IMETHOD bool Equal(const Rotation& r1,const RotationAcc& r2,double eps);
IMETHOD bool Equal(const RotationAcc& r1,const Rotation& r2,double eps);
IMETHOD bool Equal(const TwistAcc& a,const TwistAcc& b,double eps);
IMETHOD bool Equal(const Twist& a,const TwistAcc& b,double eps);
IMETHOD bool Equal(const TwistAcc& a,const Twist& b,double eps);
IMETHOD bool Equal(const VectorAcc& r1,const VectorAcc& r2,double eps);
IMETHOD bool Equal(const Vector& r1,const VectorAcc& r2,double eps);
IMETHOD bool Equal(const VectorAcc& r1,const Vector& r2,double eps);

class VectorAcc
{
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Robot/App/kdl_cp/frames.cpp
Expand Up @@ -387,7 +387,7 @@ double Rotation::GetRotAngle(Vector& axis,double eps) const {

bool operator==(const Rotation& a,const Rotation& b) {
#ifdef KDL_USE_EQUAL
return Equal(a,b);
return Equal(a,b,epsilon);
#else
return ( a.data[0]==b.data[0] &&
a.data[1]==b.data[1] &&
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Robot/App/kdl_cp/frames.inl
Expand Up @@ -1267,7 +1267,7 @@ IMETHOD void posrandom(Frame& F) {

IMETHOD bool operator==(const Frame& a,const Frame& b ) {
#ifdef KDL_USE_EQUAL
return Equal(a,b);
return Equal(a,b,epsilon);
#else
return (a.p == b.p &&
a.M == b.M );
Expand All @@ -1280,7 +1280,7 @@ IMETHOD bool operator!=(const Frame& a,const Frame& b) {

IMETHOD bool operator==(const Vector& a,const Vector& b) {
#ifdef KDL_USE_EQUAL
return Equal(a,b);
return Equal(a,b,epsilon);
#else
return (a.data[0]==b.data[0]&&
a.data[1]==b.data[1]&&
Expand All @@ -1294,7 +1294,7 @@ IMETHOD bool operator!=(const Vector& a,const Vector& b) {

IMETHOD bool operator==(const Twist& a,const Twist& b) {
#ifdef KDL_USE_EQUAL
return Equal(a,b);
return Equal(a,b,epsilon);
#else
return (a.rot==b.rot &&
a.vel==b.vel );
Expand All @@ -1307,7 +1307,7 @@ IMETHOD bool operator!=(const Twist& a,const Twist& b) {

IMETHOD bool operator==(const Wrench& a,const Wrench& b ) {
#ifdef KDL_USE_EQUAL
return Equal(a,b);
return Equal(a,b,epsilon);
#else
return (a.force==b.force &&
a.torque==b.torque );
Expand All @@ -1323,7 +1323,7 @@ IMETHOD bool operator!=(const Rotation& a,const Rotation& b) {

IMETHOD bool operator==(const Vector2& a,const Vector2& b) {
#ifdef KDL_USE_EQUAL
return Equal(a,b);
return Equal(a,b,epsilon);
#else
return (a.data[0]==b.data[0]&&
a.data[1]==b.data[1] );
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Robot/App/kdl_cp/jacobian.cpp
Expand Up @@ -126,12 +126,12 @@ namespace KDL

bool Jacobian::operator ==(const Jacobian& arg)const
{
return Equal((*this),arg);
return Equal((*this),arg,epsilon);
}

bool Jacobian::operator!=(const Jacobian& arg)const
{
return !Equal((*this),arg);
return !Equal((*this),arg,epsilon);
}

bool Equal(const Jacobian& a,const Jacobian& b,double eps)
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Robot/App/kdl_cp/jacobian.hpp
Expand Up @@ -29,7 +29,7 @@ namespace KDL
{
// Equal is friend function, but default arguments for friends are forbidden (§8.3.6.4)
class Jacobian;
bool Equal(const Jacobian& a,const Jacobian& b,double eps=epsilon);
bool Equal(const Jacobian& a,const Jacobian& b,double eps);


class Jacobian
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Robot/App/kdl_cp/jntspaceinertiamatrix.cpp
Expand Up @@ -115,7 +115,7 @@ namespace KDL
return src1.data.isApprox(src2.data,eps);
}

bool operator==(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2){return Equal(src1,src2);};
bool operator==(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2){return Equal(src1,src2,epsilon);};
//bool operator!=(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2){return Equal(src1,src2);};

}
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Robot/App/kdl_cp/path_composite.cpp
Expand Up @@ -132,13 +132,13 @@ int Path_Composite::GetNrOfSegments() {

Path* Path_Composite::GetSegment(int i) {
assert(i>=0);
assert(i<dv.size());
assert(i<static_cast<int>(dv.size()));
return gv[i].first;
}

double Path_Composite::GetLengthToEndOfSegment(int i) {
assert(i>=0);
assert(i<dv.size());
assert(i<static_cast<int>(dv.size()));
return dv[i];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Robot/App/kdl_cp/tree.cpp
Expand Up @@ -33,8 +33,8 @@ Tree::Tree(const std::string& _root_name) :

Tree::Tree(const Tree& in) {
segments.clear();
nrOfSegments = 0;
nrOfJoints = 0;
nrOfSegments = 0;
root_name = in.root_name;

segments.insert(make_pair(root_name, TreeElement::Root(root_name)));
Expand Down

0 comments on commit ba2e003

Please sign in to comment.