Skip to content

Commit

Permalink
Add protected ankle getter in Foot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio El Khoury committed Oct 16, 2012
1 parent 7293a61 commit e599ba7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions include/ard/rbdl/model/foot.hh
Expand Up @@ -84,6 +84,10 @@ namespace ard
///
/// \param inCoordinates coordinates of the ankle joint center
virtual void setAnklePositionInLocalFrame (const vector3d& inCoordinates);

protected:
/// \brief Get the ankle to which the foot is attached
virtual void associatedAnkle (jointWkPtr_t& ankle) const;

private:
// Associated ankle joint attribute.
Expand Down
11 changes: 6 additions & 5 deletions src/foot.cc
Expand Up @@ -60,11 +60,7 @@ namespace ard
Foot::Foot (const Foot& foot) :
boost::enable_shared_from_this<Foot> ()
{
if (foot.associatedAnkle ())
getPtrFromBase (ankleJoint_, foot.associatedAnkle ());
else
ankleJoint_.reset ();

foot.associatedAnkle (ankleJoint_);
foot.getSoleSize (soleLength_, soleWidth_);
foot.getAnklePositionInLocalFrame (ankleInLocalFrame_);
}
Expand Down Expand Up @@ -105,5 +101,10 @@ namespace ard
ankleInLocalFrame_ = coordinates;
}

void Foot::associatedAnkle (jointWkPtr_t& ankle) const
{
ankle = ankleJoint_;
}

} // end of namespace rbdl.
} // end of namespace ard.

0 comments on commit e599ba7

Please sign in to comment.