Permalink
Browse files

Add protected joint getter in Body class.

  • Loading branch information...
1 parent f7a568d commit 045c22d4b1a83b246552dabf3c9a13b4124758bc Antonio El Khoury committed Oct 16, 2012
Showing with 11 additions and 4 deletions.
  1. +5 −0 include/ard/rbdl/model/body.hh
  2. +6 −4 src/body.cc
@@ -95,6 +95,11 @@ namespace ard
/// getter. There is therefore no guarantee that the joint will
/// still exist once the shared pointer has been deleted.
virtual to_pointer<const CjrlJoint>::type joint () const;
+
+ protected:
+ /// \brief Get const pointer to the joint the body is attached
+ /// to.
+ virtual void joint (jointWkPtr_t& joint) const;
private:
/// \brief Name attribute.
View
@@ -55,11 +55,8 @@ namespace ard
{
name_ = body.getName ();
rbdlBody_ = body.rbdlBody ();
+ body.joint (joint_);
- if (body.joint ())
- getPtrFromBase (joint_, body.joint ());
- else
- joint_.reset ();
}
Body::~Body ()
@@ -127,5 +124,10 @@ namespace ard
return getSharedPointer (joint_);
}
+ void Body::joint (jointWkPtr_t& joint) const
+ {
+ joint = joint_;
+ }
+
} // end of namespace rbdl.
} // end of namespace ard.

0 comments on commit 045c22d

Please sign in to comment.