Skip to content

Instantly share code, notes, and snippets.

@cmower
Created June 14, 2023 18:04
Show Gist options
  • Save cmower/bb08a94775a67321b1d4945efb039459 to your computer and use it in GitHub Desktop.
Save cmower/bb08a94775a67321b1d4945efb039459 to your computer and use it in GitHub Desktop.
Draw a frame in PyBullet.
import pybullet as p
import numpy as np
def draw_frame(T: np.ndarray) -> None:
""" Draw a frame represented by the 4-by-4 homogenous transformation matrix T."""
for i in range(3):
color = [0, 0, 0]
color[i] = 1
p.addUserDebugLine(
lineFromXYZ=T[:3, 3],
lineToXYZ=T[:3, 3] + T[:3, i],
lineColorRGB=color,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment