Skip to content

Commit

Permalink
Joint callback
Browse files Browse the repository at this point in the history
  • Loading branch information
LLipter committed Jan 11, 2024
1 parent c34d697 commit 181e653
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/openrave/kinbody.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<void(KinBody::JointInfoPtr)> callback) {
_callbackOnModify = callback;
}

protected:
JointInfo _info;

Expand Down Expand Up @@ -2161,6 +2166,8 @@ class OPENRAVE_API KinBody : public InterfaceBase

boost::array<dReal,3> _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<void(KinBody::JointInfoPtr)> _callbackOnModify;

private:
/// Sensitive variables that should not be modified.
/// @name Private Joint Variables
Expand Down

0 comments on commit 181e653

Please sign in to comment.