Skip to content

Commit

Permalink
Import matplotlib 3D tools in the bodies of grasp plotting functions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass authored Sep 24, 2024
1 parent 0c94fd2 commit d1dd041
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyrobosim/pyrobosim/manipulation/grasping.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import matplotlib.pyplot as plt

from enum import Enum
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from transforms3d.quaternions import rotate_vector, qinverse


Expand Down Expand Up @@ -107,6 +105,8 @@ def translate_origin(self, vec):

def plot(self, ax, color, alpha=0.8):
"""Displays the grasp on an existing set of axes."""
from mpl_toolkits.mplot3d.art3d import Poly3DCollection

d = self.properties.depth
h = self.properties.height / 2
w = self.properties.max_width / 2
Expand Down Expand Up @@ -563,6 +563,9 @@ def show_grasps(
:param object_footprint: Optional N-by-2 array of the object footprint points to overlay
:type object_footprint: :class:`numpy.ndarray`, optional
"""
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection

fig = plt.figure()
ax = Axes3D(fig)
fig.add_axes(ax)
Expand Down

0 comments on commit d1dd041

Please sign in to comment.