Skip to content

Commit

Permalink
Merge pull request #628 from dartsim/fix_issue_626
Browse files Browse the repository at this point in the history
Fix for issue #626
  • Loading branch information
jslee02 committed Mar 7, 2016
2 parents 840dedf + e691d14 commit c2ed0ea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dart/dynamics/MetaSkeleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/ReferentialSkeleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/Skeleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions unittests/testSkeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c2ed0ea

Please sign in to comment.