diff --git a/include/openrave/kinbody.h b/include/openrave/kinbody.h index 537f32edd6..b5a6e1d026 100644 --- a/include/openrave/kinbody.h +++ b/include/openrave/kinbody.h @@ -1410,6 +1410,7 @@ class OPENRAVE_API KinBody : public InterfaceBase LinkInfo _info; ///< parameter information of the link + private: /// Sensitive variables that are auto-generated and should not be modified by the user. /// @name Private Link Variables @@ -2111,6 +2112,10 @@ class OPENRAVE_API KinBody : public InterfaceBase /// \brief update the cached _doflastsetvalues //virtual void SetDOFLastSetValue(dReal dofvalue, const int iaxis = 0); + inline void RegisterCallbackOnModify(std::function callback) { + _callbackOnModify = callback; + } + protected: JointInfo _info; @@ -2161,6 +2166,8 @@ class OPENRAVE_API KinBody : public InterfaceBase boost::array _doflastsetvalues; ///< the last set value by the kinbody (_voffsets not applied). For revolute joints that have a range greater than 2*pi, it is only possible to recover the joint value from the link positions mod 2*pi. In order to recover the branch, multiplies of 2*pi are added/subtracted to this value that is closest to _doflastsetvalues. For circular joints, the last set value can be ignored since they always return a value from [-pi,pi) + std::function _callbackOnModify; + private: /// Sensitive variables that should not be modified. /// @name Private Joint Variables