diff --git a/include/ard/rbdl/model/joint.hh b/include/ard/rbdl/model/joint.hh index 5886694..7d8cdb7 100644 --- a/include/ard/rbdl/model/joint.hh +++ b/include/ard/rbdl/model/joint.hh @@ -78,6 +78,9 @@ namespace ard /// still exist once the shared pointer has been deleted. virtual to_pointer::type parentJoint () const; + /// \brief Get shared pointer to parent joint. + virtual void parentJoint (jointShPtr_t& joint) const; + /// \brief Add a child joint. virtual bool addChildJoint (CjrlJoint& joint); diff --git a/src/joint.cc b/src/joint.cc index bf2aa55..d4573ac 100644 --- a/src/joint.cc +++ b/src/joint.cc @@ -167,6 +167,11 @@ namespace ard return getSharedPointer (parentJoint_); } + void Joint::parentJoint (jointShPtr_t& joint) const + { + joint = getSharedPointer (parentJoint_); + } + bool Joint::addChildJoint (CjrlJoint& joint) { // Link joints in abstract robot dynamics. The rbdl joints