Skip to content

Commit 3240822

Browse files
committed
fix(docs): pick a collision-checking example that actually collides
The intro.rst example placed a 1x1x1 box at (1,0,0), which is outside the Panda's reach at q=0/qr — panda.iscollided() always returned False, so the example never demonstrated the feature it was illustrating. Use a smaller box positioned to intersect the forearm at q=0 instead.
1 parent 29ee42b commit 3240822

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

docs/source/intro.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,15 @@ to the shape used for rendering.
661661
``pip install`` on Windows.
662662

663663
We can conveniently perform collision checks between links as well as between
664-
whole robots, discrete links, and objects in the world. For example a :math:`1
665-
\times 1 \times 1` box centered at :math:`(1,0,0)` can be tested against all, or
664+
whole robots, discrete links, and objects in the world. For example a :math:`0.3
665+
\times 0.3 \times 0.3` box centered at :math:`(0,0,0.6)` -- which intersects the
666+
robot's forearm in its zero-angle configuration -- can be tested against all, or
666667
just one link, of the robot by::
667668

668669
>>> panda = rtb.models.Panda()
669-
>>> obstacle = Cuboid([1, 1, 1], pose = SE3(1, 0, 0))
670-
>>> iscollision = panda.iscollided(panda.q, obstacle) # boolean
671-
>>> iscollision = panda.links[0].iscollided(obstacle)
670+
>>> obstacle = Cuboid([0.3, 0.3, 0.3], pose = SE3(0, 0, 0.6))
671+
>>> iscollision = panda.iscollided(panda.q, obstacle) # True, some link hits the box
672+
>>> iscollision = panda.links[0].iscollided(obstacle) # False, the base link is clear
672673

673674

674675
Additionally, we can compute the minimum Euclidean distance between whole

0 commit comments

Comments
 (0)