diff --git a/dart/dynamics/MetaSkeleton.h b/dart/dynamics/MetaSkeleton.h index de952b38ddcb9..7d6041ea28ada 100644 --- a/dart/dynamics/MetaSkeleton.h +++ b/dart/dynamics/MetaSkeleton.h @@ -475,7 +475,7 @@ class MetaSkeleton : public common::Subject /// You can specify a coordinate Frame to express the Jabocian in. virtual math::LinearJacobian getLinearJacobianDeriv( const JacobianNode* _node, - const Eigen::Vector3d& _localOffset = Eigen::Vector3d::Zero(), + const Eigen::Vector3d& _localOffset, const Frame* _inCoordinatesOf = Frame::World()) const = 0; /// Get the angular Jacobian time derivative of a BodyNode. You can specify a diff --git a/dart/dynamics/ReferentialSkeleton.h b/dart/dynamics/ReferentialSkeleton.h index f7baeb0f8231f..eda06c81ed04d 100644 --- a/dart/dynamics/ReferentialSkeleton.h +++ b/dart/dynamics/ReferentialSkeleton.h @@ -214,7 +214,7 @@ class ReferentialSkeleton : public MetaSkeleton // Documentation inherited math::LinearJacobian getLinearJacobianDeriv( const JacobianNode* _node, - const Eigen::Vector3d& _localOffset = Eigen::Vector3d::Zero(), + const Eigen::Vector3d& _localOffset, const Frame* _inCoordinatesOf = Frame::World()) const override; // Documentation inherited diff --git a/dart/dynamics/Skeleton.h b/dart/dynamics/Skeleton.h index 6ebc3c1f1f68a..6cf7952367c92 100644 --- a/dart/dynamics/Skeleton.h +++ b/dart/dynamics/Skeleton.h @@ -776,7 +776,7 @@ class Skeleton : public virtual common::AddonManager, // Documentation inherited math::LinearJacobian getLinearJacobianDeriv( const JacobianNode* _node, - const Eigen::Vector3d& _localOffset = Eigen::Vector3d::Zero(), + const Eigen::Vector3d& _localOffset, const Frame* _inCoordinatesOf = Frame::World()) const override; // Documentation inherited diff --git a/unittests/testSkeleton.cpp b/unittests/testSkeleton.cpp index 76c3b3e7535db..02297778dc1ca 100644 --- a/unittests/testSkeleton.cpp +++ b/unittests/testSkeleton.cpp @@ -1223,6 +1223,20 @@ TEST(Skeleton, Configurations) EXPECT_TRUE(c2.mAccelerations.size() == 0); } +TEST(Skeleton, LinearJacobianDerivOverload) +{ + // Regression test for #626: Make sure that getLinearJacobianDeriv's overload + // is working appropriately. + SkeletonPtr skeleton = createThreeLinkRobot(Vector3d::Ones(), DOF_PITCH, + Vector3d::Ones(), DOF_ROLL, + Vector3d::Ones(), DOF_YAW); + + skeleton->getLinearJacobianDeriv(skeleton->getBodyNode(0)); + + LinkagePtr linkage = Branch::create(skeleton->getBodyNode(0)); + linkage->getLinearJacobianDeriv(linkage->getBodyNode(0)); +} + int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv);