Permalink
Browse files

Add protected ankle getter in Foot.

  • Loading branch information...
1 parent 7293a61 commit e599ba7fac8b4d2523c0de8b7fa863459eec7958 Antonio El Khoury committed Oct 16, 2012
Showing with 10 additions and 5 deletions.
  1. +4 −0 include/ard/rbdl/model/foot.hh
  2. +6 −5 src/foot.cc
@@ -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.
View
@@ -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_);
}
@@ -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.