Skip to content

Commit

Permalink
Refactored isCyclic to use isPositionLimited.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Koval committed Jul 9, 2015
1 parent 38d243d commit 0d7e4ea
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions dart/dynamics/BallJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ const std::string& BallJoint::getStaticType()
//==============================================================================
bool BallJoint::isCyclic(size_t _index) const
{
return std::isinf(getPositionLowerLimit(_index))
&& std::isinf(getPositionUpperLimit(_index));
return !isPositionLimited(_index);
}

//==============================================================================
Expand Down
3 changes: 1 addition & 2 deletions dart/dynamics/EulerJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ const std::string& EulerJoint::getStaticType()
//==============================================================================
bool EulerJoint::isCyclic(size_t _index) const
{
return std::isinf(getPositionLowerLimit(_index))
&& std::isinf(getPositionUpperLimit(_index));
return !isPositionLimited(_index);
}

//==============================================================================
Expand Down
3 changes: 1 addition & 2 deletions dart/dynamics/FreeJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ const std::string& FreeJoint::getStaticType()
//==============================================================================
bool FreeJoint::isCyclic(size_t _index) const
{
return _index < 3 && std::isinf(getPositionLowerLimit(_index))
&& std::isinf(getPositionUpperLimit(_index));
return _index < 3 && !isPositionLimited(_index);
}

//==============================================================================
Expand Down
3 changes: 1 addition & 2 deletions dart/dynamics/PlanarJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ const std::string& PlanarJoint::getStaticType()
//==============================================================================
bool PlanarJoint::isCyclic(size_t _index) const
{
return _index == 2 && std::isinf(getPositionLowerLimit(_index))
&& std::isinf(getPositionUpperLimit(_index));
return _index == 2 && !isPositionLimited(_index);
}

//==============================================================================
Expand Down
3 changes: 1 addition & 2 deletions dart/dynamics/RevoluteJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ const std::string& RevoluteJoint::getType() const
//==============================================================================
bool RevoluteJoint::isCyclic(size_t _index) const
{
return std::isinf(getPositionLowerLimit(_index))
&& std::isinf(getPositionUpperLimit(_index));
return !isPositionLimited(_index);
}

//==============================================================================
Expand Down
3 changes: 1 addition & 2 deletions dart/dynamics/UniversalJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ const std::string& UniversalJoint::getStaticType()
//==============================================================================
bool UniversalJoint::isCyclic(size_t _index) const
{
return std::isinf(getPositionLowerLimit(_index))
&& std::isinf(getPositionUpperLimit(_index));
return !isPositionLimited(_index);
}

//==============================================================================
Expand Down

0 comments on commit 0d7e4ea

Please sign in to comment.