Skip to content

Commit

Permalink
Improve the comment of _mapListNonCollidingInterGrabbedLinkPairsWhenG…
Browse files Browse the repository at this point in the history
…rabbed

Co-authored-by: Puttichai Lertkultanon <[email protected]>
  • Loading branch information
snozawa and Puttichai authored Nov 7, 2024
1 parent e331a70 commit 3d4efe2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion include/openrave/kinbody.h
Original file line number Diff line number Diff line change
Expand Up @@ -3820,7 +3820,18 @@ class OPENRAVE_API KinBody : public InterfaceBase
mutable std::string __hashKinematicsGeometryDynamics; ///< hash serializing kinematics, dynamics and geometry properties of the KinBody
int64_t _lastModifiedAtUS=0; ///< us, linux epoch, last modified time of the kinbody when it was originally loaded from the environment.
int64_t _revisionId = 0; ///< the webstack revision for this loaded kinbody
std::unordered_map<uint64_t, ListNonCollidingLinkPairs> _mapListNonCollidingInterGrabbedLinkPairsWhenGrabbed; ///< map of list of link pairs. This is computed when grabbed bodies are grabbed, and at taht time, two grabbed bodies are not touching each other. Since these links are not colliding at the time of grabbing, they should remain non-colliding with the grabbed body throughout. If, while grabbing, they collide with the grabbed body at some point, CheckSelfCollision should return true. It is important to note that the enable state of a link does *not* affect its membership of this list. Each pair in the list should be [Grabbed1-link, Grabbed2-link]. Note that this does not contain link pairs of [Grabbed-link, Grabber-link], c.f. Grabbed::_listNonCollidingGrabbedGrabberLinkPairsWhenGrabbed. Note that the key of this map is 'environment body indices pair', which lower 32bits are for the first KinBody's envBodyIndex, and which higher 32bits are for the second KinBody's envBodyIndex. The first envBodyIndex should be always smaller than the second envBodyIndex to simplify searching. Please also see _ComputeEnvironmentBodyIndicesPair.
/// _mapListNonCollidingInterGrabbedLinkPairsWhenGrabbed maps a pair of envBodyIndices of two grabbed bodies
/// (encoded into one uint64_t via _ComputeEnvironmentBodyIndicesPair) to a list of initially non-colliding link
/// pairs between the two. The ListNonCollidingLinkPairs for body1 and body2 is computed from state when the latest
/// body between body1 and body2 has been grabbed. Since these links in each pair are not colliding with each other
/// at the time of grabbing, they should remain non-colliding throughout (i.e. until either of them is released).
/// Notes:
/// - The enable states of links do *not* affect the membership of this ListNonCollidingLinkPair.
/// - ListNonCollidingLinkPair, which is the values of this map, only contains link pairs of *grabbed* bodies (i.e.
/// not grabber's links).
/// - Each link pair (grabbed1Link, grabbed2Link) in ListNonCollidingLinkPair must be such that the first element
/// corresponds to the grabbed body with lower environment body index.
std::unordered_map<uint64_t, ListNonCollidingLinkPairs> _mapListNonCollidingInterGrabbedLinkPairsWhenGrabbed;

private:
mutable std::vector<dReal> _vTempJoints;
Expand Down

0 comments on commit 3d4efe2

Please sign in to comment.