Skip to content
Browse files

ADd protected wrist getter in Hand.

  • Loading branch information...
1 parent e599ba7 commit 3e657c1da94e60a7acedf448fd56b92bfbb7069d Antonio El Khoury committed Oct 16, 2012
Showing with 10 additions and 5 deletions.
  1. +4 −0 include/ard/rbdl/model/hand.hh
  2. +6 −5 src/hand.cc
View
4 include/ard/rbdl/model/hand.hh
@@ -112,6 +112,10 @@ namespace ard
/// wrist.
virtual void setPalmNormal (const vector3d& inPalmNormal);
+ protected:
+ /// \brief Get the wrist joint to which the hand is attached.
+ virtual void associatedWrist (jointWkPtr_t& wrist) const;
+
private:
// Associated wrist joint attribute.
jointWkPtr_t wristJoint_;
View
11 src/hand.cc
@@ -62,11 +62,7 @@ namespace ard
Hand::Hand (const Hand& hand) :
boost::enable_shared_from_this<Hand> ()
{
- if (hand.associatedWrist ())
- getPtrFromBase (wristJoint_, hand.associatedWrist ());
- else
- wristJoint_.reset ();
-
+ hand.associatedWrist (wristJoint_);
hand.getCenter (center_);
hand.getThumbAxis (thumbAxis_);
hand.getForeFingerAxis (foreFingerAxis_);
@@ -127,5 +123,10 @@ namespace ard
palmNormal_ = palmNormal;
}
+ void Hand::associatedWrist (jointWkPtr_t& wrist) const
+ {
+ wrist = wristJoint_;
+ }
+
} // end of namespace rbdl.
} // end of namespace ard.

0 comments on commit 3e657c1

Please sign in to comment.
Something went wrong with that request. Please try again.